frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

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

1•LawZiL•8mo 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•8mo 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•8mo 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•8mo 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•8mo ago
Load test against a clone instead of a DB whose contents you care about?

Research Papers Defining the SLM Revolution

https://neurometric.substack.com/p/the-small-model-revolution-5-papers
1•robmay•2m ago•0 comments

What's Next for Prediction Markets?

https://apps.apple.com/us/app/gamestock-trading-tournaments/id6751907522
1•amistico•3m ago•1 comments

SEO Question: How to Improve Click-Through-Rate(CTR)?

1•dabojula•3m ago•0 comments

Adaptive Cards – inject your actionable content directly into MS apps

https://adaptivecards.io/
1•smartmic•3m ago•0 comments

Is Fast Charging Killing the Battery? A 2-Year Test on 40 Phones [video]

https://www.youtube.com/watch?v=kLS5Cg_yNdM
1•teekert•3m ago•0 comments

I Cut My Docker Image by 99.7% (846MB to 2.5MB). Here Is the Full Breakdown

https://www.hexplain.space/blog/42ZscpWSpYhH1vIhfMIY
1•thunderbong•6m ago•0 comments

Founding Engineer| Pet Care Market Place| Feline Tails

1•vcastant•7m ago•0 comments

Rockstar Launches Official User-Generated Content Marketplace for Mods

https://www.ign.com/articles/rockstar-launches-official-user-generated-content-marketplace-for-mods
1•_____k•7m ago•0 comments

Building Docfind: Fast Client-Side Search with Rust and WebAssembly

https://code.visualstudio.com/blogs/2026/01/15/docfind
1•joaomoreno•7m ago•0 comments

Iterative image reconstruction using random cubic bézier strokes

https://tangled.org/luthenwald.tngl.sh/splined
1•luthenwald•8m ago•0 comments

Show HN: Pawnch – Addicitve chess puzzles with explanations

https://puzzle-crush.vercel.app/
1•galgia•8m ago•0 comments

Show HN: I, AI – A story about AI

https://antjanus.com/ai/stories/spare-cycles
1•antjanus•9m ago•0 comments

Founding Engineer| Pet Care Market Place| Feline Tails

1•vcastant•9m ago•0 comments

AWS Launches AWS European Sovereign Cloud and Announces Expansion Across Europe

https://www.pap.pl/mediaroom/aws-launches-aws-european-sovereign-cloud-and-announces-expansion-ac...
1•_____k•9m ago•0 comments

Best Practices for AI-Assisted Coding with Claude Code and Building Claude.md

https://antjanus.com/ai/claude-code-best-practices
2•antjanus•9m ago•0 comments

Mole: Deep clean and optimize your Mac

https://github.com/tw93/Mole
1•trueduke•9m ago•0 comments

I crawled 1,500 sites: 30% block AI bots, 0.2% use llms.txt

https://websiteaiscore.com/blog/case-study-1500-websites-ai-readability-audit
2•aggeeinn•10m ago•1 comments

Mahmood has no confidence in police chief after Israeli fan ban

https://www.bbc.co.uk/news/articles/cvgn984j9d7o
1•Delphiza•11m ago•1 comments

AWS flips switch on Euro cloud as customers fret about digital sovereignty

https://www.theregister.com/2026/01/15/aws_european_sovereign_cloud/
1•Bender•11m ago•0 comments

Evaluating OCR-to-Markdown systems is fundamentally broken

https://nanonets.com/blog/evaluating-ocr-to-markdown-systems-is-fundamentally-broken-and-why-that...
1•PixelPanda•11m ago•0 comments

Ask HN: What is your favourite GitHub Repo?

1•amanverasia•11m ago•0 comments

Firefox 147 brings GPU boost, tidier tabs, and video that follows you around

https://www.theregister.com/2026/01/14/firefox_and_tbird_147/
1•Bender•12m ago•0 comments

Conditions in the Intel 8087 floating-point chip's microcode

https://www.righto.com/2025/12/8087-microcode-conditions.html
1•diogotozzi•12m ago•0 comments

Auto-CPUFreq 3.0 Released to Help You Extend Laptop Battery Life on Linux

https://www.phoronix.com/news/Auto-CPUFreq-3.0
1•Bender•13m ago•0 comments

Show HN: See the best daily US stock trades with entry and exit timing

https://www.finsuba.com/premium/
3•finsuba•14m ago•0 comments

Independent Guest Virtual Machine (IGVM) File Format

https://github.com/microsoft/igvm
1•ingve•16m ago•0 comments

MacPaw Pulls Plug on Setapp Mobile iOS Store

https://www.macrumors.com/2026/01/15/setapp-mobile-eu-app-store-closing-next-month/
1•thm•17m ago•0 comments

Programming, Evolved: Lessons and Observations

https://github.com/kulesh/dotfiles/blob/main/dev/dev/docs/programming-evolved.md
2•dnw•17m ago•0 comments

25 Years of Wikipedia

https://wikipedia25.org
1•easton•18m ago•0 comments

The Surprisingly Long Life of the Vacuum Tube

https://www.construction-physics.com/p/the-surprisingly-long-life-of-the
2•chmaynard•19m ago•0 comments