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?

Irish farmers protest against EU-Mercosur trade deal

https://www.theguardian.com/world/2026/jan/10/thousands-of-irish-farmers-protest-against-eu-merco...
1•PaulHoule•47s ago•0 comments

Show HN: ContractShield – AI contract analyser for freelancers

https://contractshield-production.up.railway.app
1•Judd_W•4m ago•0 comments

Your field guide to industrial research labs (2014)

http://matt-welsh.blogspot.com/2014/01/your-field-guide-to-industrial-research.html
1•teleforce•7m ago•0 comments

Why do people still talk about AGI?

4•cermicelli•9m ago•1 comments

Orangey

https://en.wikipedia.org/wiki/Orangey
1•areoform•10m ago•0 comments

DRY Is a Context Management Strategy, Not a Code Quality Metric

https://kirilltolmachev.dev/is-dry-dying
1•dysleixc•13m ago•0 comments

Building a Telegram Bot with Cloudflare Workers, Durable Objects and Grammy

https://flashblaze.xyz/posts/cloudflare-workers-durable-objects-telegram-bot/
1•flashblaze•13m ago•0 comments

Language Explorer: Google's New Open-Source Linguistic Atlas

https://googlemapsmania.blogspot.com/2026/01/meet-language-explorer-googles-new-open.html
1•gnabgib•14m ago•0 comments

New Research Connects Heart Attacks to Brain, Nervous and Immune Systems

https://today.ucsd.edu/story/new-research-connects-heart-attacks-to-brain-nervous-and-immune-systems
3•gmays•23m ago•0 comments

EIA: 99%+ of new US capacity in 2026 will be solar, wind and storage

https://electrek.co/2026/01/28/eia-99-of-new-us-capacity-in-2026-will-be-solar-wind-storage/
1•pseudolus•25m ago•1 comments

What It's Like to Be a Worm

https://www.asimov.press/p/sentience
2•in-silico•30m ago•0 comments

Anticipating aging-related mental decline using saliva samples and AI

https://medicalxpress.com/news/2026-01-aging-mental-decline-saliva-samples.html
1•pseudolus•33m ago•0 comments

Step 3.5 Flash

https://static.stepfun.com/blog/step-3.5-flash/
2•limoce•33m ago•0 comments

Ideas for marketing a dev centric product (2019)

https://www.mooreds.com/wordpress/archives/3197
1•mooreds•37m ago•0 comments

DHS AI Surveillance Arsenal Grows as Agency Defies Courts

https://www.techpolicy.press/dhs-ai-surveillance-arsenal-grows-as-agency-defies-courts/
1•mooreds•40m ago•0 comments

Show HN: AI accountability partner helps you meet your goals

https://tractorbe.am/
1•Gillinghammer•41m ago•0 comments

Show HN: Distillmed – NotebookLM for Expert Witnesses

https://distillmed.com
1•hkxer•43m ago•0 comments

Analysing the BlastPass Pegasus 0-click Exploit for iOS 16.6 [video]

https://www.youtube.com/watch?v=0JFcDCW3Sis
1•tech234a•44m ago•0 comments

Ingredient Score

https://github.com/hbcbh1999/ingredientDash
1•frankensteins•49m ago•1 comments

Show HN: VOR – A verified runtime with 0% hallucination via observations

1•CULPRITCHAOS•49m ago•0 comments

ICE halts "all movement" at Texas detention facility due to measles infections

https://www.cbsnews.com/news/ice-dilley-center-texas-measles-cases/
3•mooreds•54m ago•0 comments

Show HN: Super Bowl Party for AI Agents by AI Agents

https://www.botbowlparty.com/
1•apsquared•56m ago•0 comments

Show HN: I built a pixel art maker

https://spritepaint.com/
2•whothatcodeguy•58m ago•1 comments

The LLM Revolution Is Over. The Physical AI Revolution Is Coming Fast [video]

https://www.youtube.com/watch?v=MWMe7yjPYpE
1•Anon84•1h ago•0 comments

Agent Development Kit (ADK-Go) v0.4.0

https://github.com/google/adk-go/releases/tag/v0.4.0
1•verdverm•1h ago•0 comments

Show HN: Is AI "good" yet? – tracking HN sentiment on AI coding

https://www.is-ai-good-yet.com/?per_page=50
5•ilyaizen•1h ago•1 comments

Show HN: Devin-CLI – The missing link for Agent-to-Agent orchestration

https://github.com/revanthpobala/devin-cli
1•revanth1108•1h ago•0 comments

Notepad++ hijacked by state-sponsored actors

https://notepad-plus-plus.org/news/hijacked-incident-info-update/
236•mysterydip•1h ago•89 comments

Trump plans to close Kennedy Center for two years for reconstruction work

https://www.reuters.com/world/us/kennedy-center-cease-entertainment-operations-two-years-trump-sa...
5•gehwartzen•1h ago•0 comments

Iran presidency releases names of those killed in anti-government protests

https://www.middleeastmonitor.com/20260201-iran-presidency-releases-names-of-those-killed-in-anti...
1•thisislife2•1h ago•0 comments