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?

OpenAI Lied about ad revenue lol

1•askadityapandey•1m ago•0 comments

Inference Engineering, from Scratch

https://ai-inference-engineering-from-scrat.vercel.app/
1•jonbaer•3m ago•0 comments

Qwen 4 Is Looped, 18.3 pts on LiveCodeBench, 6.7 pts on AIME, Zero Regressions

https://blog.tiltastech.com/projects/looped-qwen4-35b-recurrent-depth/
1•nateb2022•7m ago•0 comments

Deterministic ~0.04ms pre-execution payout firewall for AI agents (MIT)

1•owais_globoo•13m ago•0 comments

GTA VI's lessons for the Chinese gaming industry

https://www.scmp.com/tech/tech-trends/article/3376871/grand-theft-auto-vis-lessons-chinese-gaming...
4•fowler64•17m ago•0 comments

Ask HN: Is there is any offline password manager that use PQC?

2•DeepLogin•22m ago•0 comments

SlimPeak Review: Benefits, Features, Ingredients and Results

https://open.spotify.com/episode/3UsNk9fkFVjRbQp1Hen4Dp
1•Tylerwalter•25m ago•1 comments

Cory Doctorow: Regulating, fast and slow

https://pluralistic.net/2026/12/04/quick-fixes/
4•catab•28m ago•0 comments

Will AI Kill SaaS Like Streaming Disrupted Vinyl Records?

https://neatread.net/will-ai-kill-saas-like-streaming-disrupted-vinyl-records
1•piter691777•30m ago•0 comments

Former St. Helena photographer who took iconic Windows XP photo dies at 84

https://napavalleyregister.com/star/lifestyles/st-helena-charles-chuck-orear-obituary-photography...
1•toomuchtodo•33m ago•1 comments

Congress nears ban on cheap Chinese cars

https://www.usatoday.com/story/cars/technology/2026/12/04/congress-cheap-chinese-car-ban/93073829...
5•thereader12•38m ago•3 comments

I Met Your Change: read a pull request as a story

https://github.com/skynyrd/how-I-met-your-change
2•anilsurmeli•39m ago•0 comments

Pipedream Cybersecurity Incident

https://status.perplexity.com/incidents/01M915PACNW98P5015NZ4NTQHE
5•xishi•42m ago•0 comments

OpenAI hasn't proved P=BQP

https://twitter.com/markchen90/status/2129032404861907422
5•espeed•42m ago•0 comments

Show HN: Roomzine – turn a photo of your room into a redesign magazine

https://roomzine.com/
1•ayarmots•43m ago•0 comments

Show HN: Uikits.tech – 84 open-source UI Skill Packs for AI coding agents

https://uikits.tech
2•vietlinhh02•46m ago•0 comments

Show HN: Pulse – Give your AI harnesses subscription usage context

https://github.com/ashwnn/pulse
2•axa14•49m ago•0 comments

Enable 10Gbp/s on ezcap401 GameDock Extreme Pro capture card on macOS

https://github.com/alex0com/ezcap401-mac
2•alex0com•51m ago•1 comments

SF supe weighing limits on AI labs in indu. districts after new Anthropic lease

https://sfist.com/2026/12/04/sf-leaders-push-to-restrict-ai-labs-in-industrial-districts-after-an...
2•littlexsparkee•54m ago•0 comments

A Poem

https://welcometoannexia.net/a-poem/
1•aprentic•56m ago•0 comments

FreeHand

https://microsoft.github.io/FreeHand/
2•jhack•56m ago•0 comments

Tech Isn't a Normal Sector

https://seamusbehan.substack.com/p/tech-isnt-a-normal-sector
1•reasonableklout•57m ago•0 comments

What Was Coding?

https://aeon.co/essays/programming-existed-before-code-it-will-survive-ai-too
3•tirsky•58m ago•0 comments

Tailscale: Post-Quantum Cryptography

https://tailscale.com/docs/concepts/post-quantum-cryptography
2•theptip•1h ago•0 comments

Qdrant security incident notice – 2026-12-04

https://twitter.com/jedisct1/status/2128905258248360438
3•dr_pardee•1h ago•0 comments

Bitcoin Plunges on Fears of A.I. Attacks on Foundations of Encryption

https://www.nytimes.com/2026/12/03/business/bitcoin-price-crypto-stocks-crash.html
4•jonbaer•1h ago•0 comments

Show HN: Dani, a team of AI agents that works on your own computer

https://dani.danlab.dev
2•somdipto-nandy•1h ago•0 comments

Mixpanel security incident notice – 2026-12-04

https://www.reddit.com/r/cybersecurity/comments/1yd2x2g/mixpanel_security_incident_notice_custome...
2•dr_pardee•1h ago•1 comments

Commitment tuning: Training reasoning models without annotated rationales

https://research.google/blog/commitment-tuning-training-reasoning-models-without-annotated-ration...
2•Bitvexel•1h ago•0 comments

Information Risk Insights Study: Xtreme Edition, 2026

https://www.cyentia.com/publication/iris-xtreme-2026/
1•worik•1h ago•0 comments