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?

Democrats and Republicans agree: AI is scary

https://economist.com/united-states/2026/06/25/democrats-and-republicans-agree-ai-is-scary
1•andsoitis•4m ago•0 comments

Mathematics: Its Content, Methods and Meaning

https://old.maa.org/press/maa-reviews/mathematics-its-content-methods-and-meaning
1•teleforce•5m ago•0 comments

Ford execs say they made a mistake when they replaced human engineers with AI

https://www.neowin.net/news/ford-execs-say-they-made-a-mistake-when-they-replaced-human-engineers...
1•gscott•9m ago•0 comments

We measured whether AI obeys architecture rules. Even Opus ignored them 60%

https://hunch-pi.vercel.app/blog/post?slug=ai-ignores-your-architecture
1•davesheffer•9m ago•0 comments

Show HN: OpenClaw Launch – deploy a managed OpenClaw AI agent in 30s

https://openclawlaunch.com
1•zackchew•10m ago•0 comments

CraftsmanSHIP. Not CraftsmanSHIT

https://fagnerbrack.com/craftsmanship-not-craftsmanshit-88db7c982103
1•fagnerbrack•10m ago•0 comments

LFM2 VL WebGPU

https://huggingface.co/spaces/LiquidAI/LFM2-VL-WebGPU
1•fagnerbrack•10m ago•0 comments

Qwen3.5 WebGPU

https://huggingface.co/spaces/webml-community/Qwen3.5-WebGPU
1•fagnerbrack•10m ago•0 comments

Show HN: An LLM that designs M5Stack hardware builds

https://unitkit.pages.dev/
1•toyoshi•12m ago•0 comments

Explore the Leading Global Data Center Database

https://www.datacentermap.com/
1•zeristor•12m ago•0 comments

AirPlay for Google (Android) TV Chromecast

https://github.com/lekandigital/android-tv-airplay-receiver
1•lekan_digital•13m ago•0 comments

Emergent Geometry from the IKKT Matrix Model: Convergence to S^4

https://zenodo.org/records/19558001
1•RIshabh235•15m ago•0 comments

What Is an AI Intelligence Layer for Business Data?

https://www.corpusiq.io/blog/what-is-ai-intelligence-layer-business-data
2•corpusiq_io•16m ago•0 comments

Voxel Collision in SuperSplat

https://twitter.com/willeastcott/status/2070110425648128245
1•wildpeaks•27m ago•0 comments

Apple asks Trump admin to approve Chinese RAM after product price increases

https://9to5mac.com/2026/06/26/apple-asks-trump-admin-to-approve-chinese-ram-after-product-price-...
3•alwillis•28m ago•1 comments

Blue print to let machines think like humans

1•cysparrow•28m ago•0 comments

Sony's State of Play Showed That Every Publisher Is Terrified of GTA 6

https://kotaku.com/sonys-state-of-play-showed-that-every-publisher-is-terrified-of-gta-6-2000701746
1•classified•30m ago•0 comments

Ping pong: A game that requires a C compiler to play

https://www.ioccc.org/2025/uellenberg/index.html
3•thunderbong•30m ago•0 comments

IBM MCGA Gate Array Reverse Engineering

https://github.com/schlae/IBM_MCGA
3•userbinator•30m ago•0 comments

Testing 67 Models: Combining LLMs Rarely Beats the Best Single Model

https://huggingface.co/spaces/josefchen/orchestration-is-allocation
2•josefchen•31m ago•0 comments

Dan Petersen: Is this an worse time for a math career?

https://mathoverflow.net/questions/511484/is-this-an-even-worse-moment-for-a-math-career
2•reasonableklout•35m ago•0 comments

Apple Loses Another Top Executive to OpenAI

https://www.macrumors.com/2026/06/26/apple-loses-another-executive-to-openai/
3•mgh2•35m ago•0 comments

Is Germany looking again at coal-powered electricity?

https://www.bbc.com/news/articles/cy04ykxrj5eo
1•leonidasrup•37m ago•0 comments

'Fingerprints' of black hole's event horizon detected for first time

https://phys.org/news/2026-06-fingerprints-black-hole-event-horizon.html
1•signa11•42m ago•0 comments

5120x2160 100Hz Android Desktop Mode on Razor Fold

https://old.reddit.com/r/motorola/comments/1ufzwyt/i_just_got_5k2k_5120x2160_100hz_smoothly_on_a/
2•politelemon•50m ago•0 comments

AI glasses help students cheat in exams – test-obsessed Asia is ground zero

https://www.rnz.co.nz/news/world/628396/ai-glasses-are-helping-students-cheat-in-exams-test-obses...
4•billybuckwheat•54m ago•0 comments

Certainty Volatility Theory: Stable Uncertainty vs. Fluctuating Certainty

https://theguptalog.blogspot.com/2026/06/adaptive-certainty-theory-maybe-we-dont.html
1•GeorgeWoff25•58m ago•0 comments

Everything* – An interactive voyage through all orders of magnitude

https://www.everything.one/#overview
1•bj-rn•1h ago•0 comments

Lore: Next-generation open source version control

https://github.com/EpicGames/lore
2•taubek•1h ago•0 comments

Gambling disorder cases skyrockets in states where sports betting is legal

https://twitter.com/cremieuxrecueil/status/2070651565107446116
1•MrBuddyCasino•1h ago•0 comments