frontpage.
newsnewestaskshowjobs

Open Source @Github

fp.

Open in hackernews

Ask HN: How can I load test PostgreSQL but avoid changing actual data?

1•LawZiL•1y ago
I'm running a load test on my Node.js application and want to simulate realistic write-heavy scenarios to stress test the system — especially the PostgreSQL database.

There's a part of the code that performs UPDATE queries, but during load testing, I don't want these updates to actually change the state of the database. However, I still want the database to experience the full impact of the update — query planning, locking, I/O, WAL writes, etc. — so I can measure how it affects performance under peak load.

Is there a best-practice approach to achieve this?

So far, the most viable option I’ve found is to wrap the UPDATE queries in a transaction and then roll it back — that way, the queries still execute, but the state doesn’t change. Is this the right way to go? Does rollback introduce any performance overhead that would skew my results? Are there better or more realistic alternatives that simulate the full write path without persisting changes?

Thanks in advance!

Comments

sargstuff•1y ago
pgbench[2] / pgreplay-go[0] / python locust[1]

very old school approach:

Misuse sql VIEW[3][4] to generate a temporary parallel table setup. Testing database separate from production database would be 'better', IMHO.

-----

[0] pgreplay-go : https://github.com/gocardless/pgreplay-go

[1] python locust : https://miguel-codes.medium.com/unconventional-load-testing-...

[2] pgbench load testing :

   a) https://medium.com/@c.ucanefe/pgbench-load-test-166bdfb5c75a

   b) https://neon.tech/blog/autoscaling-in-action-postgres-load-testing-with-pgbench

   c) https://hackernoon.com/how-to-create-and-load-test-data-in-postgresql-i41e353m
----------------------------

[3] : a) https://hashrocket.com/blog/posts/materialized-view-strategi...

      b) https://tech.jonathangardner.net/wiki/PostgreSQL/Materialized_Views

      c) https://stackoverflow.com/questions/77603705/what-is-the-use-of-materialized-view-in-postgresql
[4] : https://en.wikipedia.org/wiki/View_(SQL)
LawZiL•1y ago
but again, how can i perform the query, but not actually change the state, i really need the state to keep untouched, but be able to perform the query itself.
MatthiasPortzel•1y ago
> Does rollback introduce any performance overhead that would skew my results?

I would expect it to be the other way around—since the transactions are rolled back and not committed, they would have significantly less performance impact. But I’m working from an academic model of the database.

apothegm•1y ago
Load test against a clone instead of a DB whose contents you care about?

Swarm – open-source control center for Claude Code / Gemini / Codex agents

https://github.com/miopea/swarm
1•miopea•1m ago•0 comments

Intel Arc G3 Extreme Handheld Gaming Performance

https://www.lttlabs.com/articles/2026/06/23/msi-claw-8-ex-ai-cg3em-with-intel-arc-g3-extreme
1•LabsLucas•2m ago•0 comments

Show HN: Zova – Objects, vectors and records in one SQLite file

https://github.com/ata-sesli/zova
1•ata-sesli•2m ago•0 comments

Quake Turns 30 Today

https://videocardz.com/newz/quake-turns-30-today
1•speckx•2m ago•0 comments

The EF's New Structure

https://blog.ethereum.org/2026/06/23/ef-structure
1•ilreb•3m ago•0 comments

Trump's Prescription Drug Shakedown: How He Made Other Countries Pay Up

https://asurawebmaster.blogspot.com/2026/06/trumps-prescription-drug-shakedown-how.html
1•laurentlof•3m ago•1 comments

A skill pack that stops coding agents from agreeing with bad startup ideas

https://github.com/machinesoul11/anti-sycophant-ai-agent-skills
1•machinesoul11•4m ago•0 comments

Show HN: Find and fix issues in your AI Agents (MIT, open source)

https://github.com/latitude-dev/latitude-llm
2•paulaq•5m ago•0 comments

I sleep less when I exercise more

https://mdickens.me/2026/05/18/I_sleep_less_when_I_exercise_more/
1•surprisetalk•5m ago•0 comments

Running GLM-5.2 on a 64GB Mac, barely

https://andreaborio.substack.com/p/i-tried-to-run-glm-52-on-a-64gb-mac
2•andreaborio•6m ago•0 comments

Task Failed Successfully: Saturating NIC and Disk Bandwidth

https://blog.mrcroxx.com/posts/task-failed-successfully-saturating-nic-and-disk-bandwidth/
1•MrCroxx•7m ago•0 comments

FDA Allows New Sunscreen, but Consumers Are Still Being Burned by Cronyism

https://www.independent.org/article/2026/06/12/fda-new-sunscreen/
1•littlexsparkee•7m ago•0 comments

Pew Research: AI adoption is rising. Trust isn't

https://www.pewresearch.org/internet/2026/06/17/americans-and-ai-2026-chatbots-smart-devices-and-...
1•dd-sharma•8m ago•1 comments

Anthropic – Elevated error rate across multiple models

https://downdetector.com.br/en/status/claude-ai/
1•brenoRibeiro706•9m ago•0 comments

European Parliament committee backs digital euro

https://www.euronews.com/business/2026/06/23/european-parliament-backs-long-awaited-digital-euro-...
2•lode•10m ago•1 comments

Sunsetting Porto to focus on Tempo accounts

https://ithaca.xyz/updates/sunsetting-porto
1•kindkang2024•10m ago•0 comments

Show HN: TikZ Editor – WYSIWYG editor for figures in LaTeX

https://tikz.dev/editor/
1•DominikPeters•11m ago•0 comments

The AI Code Agent Hype: Real Progress vs. Expectations

https://jawuil.dev/en/blog/the-ai-code-agent-hype-real-progress-vs-expectations/
1•jawuilp•12m ago•0 comments

Badakhshan Falls Under Mafia: Systematic Gold Mine Plunder, Taliban Corruption

https://8am.media/eng/badakhshan-falls-under-mafia-control-systematic-gold-mine-plunder-and-talib...
1•JPLeRouzic•12m ago•0 comments

Meta Glasses

https://www.meta.com/at/en/ai-glasses/meta-glasses/
1•tosh•12m ago•0 comments

Ask HN: How do you keep up with tech news

1•dariusogenyiebu•12m ago•0 comments

Vulgar Materialism

https://borretti.me/article/on-vulgar-materialism
1•ibobev•13m ago•0 comments

Second taskbar to my Windows PC

https://www.makeuseof.com/add-second-taskbar-to-windows-with-windowsill/
1•veler•15m ago•0 comments

Show HN: Bun-sqlgen – Type-safe raw SQL for Bun, no ORM

https://github.com/ilbertt/bun-sqlgen
6•ilbert•15m ago•0 comments

Elevated error rate across multiple models

https://status.claude.com/incidents/jbhf20wjmzrf
56•rob•16m ago•19 comments

The eerie interface of man and machine (Life Magazine, October 1967)

https://blog.jgc.org/2026/06/the-eerie-interface-of-man-and-machine.html
1•jgrahamc•16m ago•0 comments

The AI-powered World Cup runs on thousands of data workers

https://restofworld.org/2026/fifa-world-cup-ai-data-workers/
1•jyunwai•18m ago•0 comments

OctoPunk – a full-featured, AI-integrated GitHub client

https://www.octopunk.io/
1•ldelossa•18m ago•1 comments

Useful app changed how I use Windows 11's taskbar

https://www.xda-developers.com/using-windowsill-to-change-windows-11-taskbar/
1•veler•18m ago•0 comments

Ushering in the Next Frontier of Quantum Innovation

https://www.whitehouse.gov/presidential-actions/2026/06/ushering-in-the-next-frontier-of-quantum-...
1•Tomte•18m ago•0 comments