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?

Secure On-Premise Deployment of Open-Weights Large Language Models in Radiology

https://arxiv.org/abs/2604.22768
1•PaulHoule•1m ago•0 comments

Craig Federighi Explains Why Apple Pivoted to a Siri Chatbot App

https://www.macrumors.com/2026/06/10/federighi-explains-why-apple-pivoted-to-siri-chatbot/
1•tosh•1m ago•0 comments

I Hate (Most) Keyboard 'Fn' Keys

https://danq.me/2026/06/09/fn-keys/
1•speckx•1m ago•0 comments

Collective of economists considers 'growth' a doomed strategy

https://www.theguardian.com/commentisfree/2026/jun/10/economists-maths-growth-doomed-strategy-un-...
1•jmngomes•2m ago•0 comments

macOS 27 Golden Gate Is the Last to Support Intel Apps via Rosetta 2

https://www.macrumors.com/2026/06/10/macos-golden-gate-last-to-support-intel-apps/
1•tosh•3m ago•0 comments

LinkedIn wants to own B2B creator discovery with new creator marketplace

https://digiday.com/marketing/linkedin-wants-to-own-b2b-creator-discovery-with-new-creator-market...
1•thm•4m ago•0 comments

Oh Good, Screwworms Are Back

https://www.marginallycompelling.com/p/oh-good-screwworms-are-back
1•timr•4m ago•0 comments

Quantum error correction with the toric code on neutral atoms

https://arxiv.org/abs/2606.04079
2•nryoo•4m ago•1 comments

Show HN: GripeFind – find product pain points without Reddit API

https://gripefind.com
1•zeph_wheeler•4m ago•0 comments

Ask HN: Are most corporate SWE jobs performative?

2•hnthrow10282910•6m ago•0 comments

Scientists Precisely Edit Human Embryo Genes

https://www.nytimes.com/2026/06/04/science/embryos-gene-editing-crispr.html
1•gmays•7m ago•0 comments

Coding Agent Memory Benchmarks

1•kushalpatil07•7m ago•0 comments

Commonwealth Fusion makes the physics case for its 400 MW reactor

https://arstechnica.com/science/2026/06/__trashed-19/
1•LorenDB•9m ago•0 comments

Show HN: Employment contract analysis for Ontario's Workforce

https://basalaw.vercel.app
1•edimaudo•11m ago•0 comments

Show HN: Orange Crumbs - Wikipedia articles filtered by Hacker News

https://www.orangecrumbs.com/
1•oyster143•11m ago•0 comments

"I've lost sentences of text to this incompetent implementation."

https://unsung.aresluna.org/ive-lost-entire-sentences-of-text-to-this-incompetent-implementation/
3•speckx•11m ago•0 comments

Cybersecurity Product Launch Specifically Keeping AI in Focus

1•gladiator291288•13m ago•0 comments

Building a multi-tenant SaaS for an emerging market, what nobody tells you

https://medium.com/@walexy85/building-a-multi-tenant-saas-for-an-emerging-market-what-nobody-tell...
1•joshuaajayi•14m ago•0 comments

Not Wordle

https://notwordle0.netlify.app
1•kamphey•14m ago•1 comments

Meta's attempts to play catch-up with AI

https://arstechnica.com/ai/2026/06/inside-metas-attempts-to-play-catch-up-with-ai/
1•gmays•16m ago•0 comments

Show HN: Ray Hosting – Topology-aware game server orchestrator made from scratch

https://ray-hosting.com/en-US
1•bardhyliis•17m ago•0 comments

OWASP Dependency-Track 5.0 Is Now Generally Available

https://owasp.org/blog/2026/06/09/dependency-track-v5
1•jruohonen•18m ago•0 comments

Re-quantizing a local LLM 14x faster by skipping the tensors that didn't change

https://andreaborio.substack.com/p/re-quantizing-a-local-model-14-faster
3•andreaborio•19m ago•0 comments

The Tick-Tock AI Development Cycle

https://wilsoniumite.com/2026/06/10/the-tick-tock-ai-development-cycle/
1•Wilsoniumite•20m ago•0 comments

Paris Hilton is Android's first icon in residence

https://blog.google/products-and-platforms/platforms/android/paris-hilton/
2•throw7•20m ago•0 comments

Google Gemini down? Users report problems with AI chatbot

https://www.providencejournal.com/story/news/technology/2026/06/10/is-google-gemini-down-what-we-...
1•rebekkamikkoa•21m ago•0 comments

Show HN: Scribix – Transcribe audio and video in the browser

https://scribix.io
1•lyl_003•21m ago•0 comments

Let's Encrypt Certificate Rules Now Include U.S. Sanctions Warranties

https://linuxiac.com/lets-encrypt-certificate-rules-now-include-u-s-sanctions-warranties/
1•speckx•21m ago•0 comments

Dependency Graph Is a Liability You Haven't Priced Yet

https://shippingbytes.com/2026/06/09/your-dependency-graph-is-a-liability-you-havent-priced-yet/
1•gsky•23m ago•0 comments

WebCLI – Agent Interface Device for the World Wide Web

https://www.webcli.sh/?thevar
1•keepamovin•25m ago•0 comments