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

NPR finds "no sign" of Polymarket at its Panama HQ address

https://www.npr.org/2026/05/05/nx-s1-5807918/polymarket-panama-prediction-market
2•ilamont•2m ago•0 comments

Complete Guide: How to Integrate Beehiiv with Hugo via Cloudflare Workers

https://www.lucasaguiar.xyz/posts/newsletter-beehiiv-cloudflare-github/
1•isfttr•6m ago•0 comments

E.F. Schumacher: The Other Way (1975)

https://www.youtube.com/watch?v=lb-OaI0w0cw
1•andrewvc•7m ago•0 comments

Span to launch distributed AI data centers for edge compute

https://www.latitudemedia.com/news/span-to-launch-mini-ai-data-centers-for-distributed-at-home-co...
2•kochb•7m ago•0 comments

A website ranking judges by elo for the cases they dismiss in SF

https://sfcrime.pages.dev/
2•grand_larsony•8m ago•0 comments

Sovereign AI: Control, Choice, and Why It Goes Beyond Geopolitics

https://blog.mozilla.ai/sovereign-ai-control-choice-and-why-it-goes-beyond-geopolitics/
3•benbreen•9m ago•0 comments

Big-fish–little-pond effect

https://en.wikipedia.org/wiki/Big-fish%E2%80%93little-pond_effect
2•chistev•9m ago•0 comments

How the Emerging Indian Middle Handles Money

https://ehdata.org/eh360
1•gmays•10m ago•0 comments

Bose Brings Back Its 'Lifestyle' Branding with New Speakers for the Home

https://www.wired.com/story/bose-brings-back-its-lifestyle-branding-with-new-speakers-for-the-home/
1•apparent•10m ago•1 comments

Perplexity Computer for Professional Finance

https://xcancel.com/perplexity_ai/status/2051693893473935372
1•RockstarSprain•12m ago•0 comments

Why did AI destroy my production database?

https://ulveon.net/p/2026-05-05-why-did-ai-destroy-my-production-database/
2•kevin061•12m ago•0 comments

Apple Reaches $250M Settlement Over Claims It Misled People on A.I

https://www.nytimes.com/2026/05/05/technology/apple-intelligence-lawsuit-settlement.html
2•blintz•12m ago•0 comments

UK's National Health Service to close-source 100+ repos over security concerns

https://www.theregister.com/2026/05/05/nhs_to_closesource_hundreds_of_repos/
3•maxloh•13m ago•0 comments

Show HN: Keyterm Filtering for Voice AI

https://aditu.tech/keyterm-filtering
2•mayowa_osibodu•15m ago•0 comments

Tokenmaxxing: Brute-Forcing AGI by Scaling Usage

https://modular.cloud/blog/tokenmaxxing-brute-forcing-agi-by
1•liamcardenas•16m ago•0 comments

Artificial SUPER INTELLIGENCE Asolaria on a 16gb RAM stick

https://github.com/JesseBrown1980/asolaria-behcs-256
1•jessedaniel•17m ago•0 comments

Apartments Are the Climate Solution Hiding in Plain Sight

https://www.sightline.org/apartments-are-the-climate-solution-hiding-in-plain-sight/
1•oftenwrong•17m ago•0 comments

RFK Jr. plans to curb antidepressants, which he falsely compares to heroin

https://arstechnica.com/health/2026/05/rfk-jr-plans-to-curb-antidepressants-which-he-falsely-comp...
2•rbanffy•20m ago•1 comments

Vibe coding or spec-driven development? How to choose

https://www.infoworld.com/article/4166817/vibe-coding-or-spec-driven-development-how-to-choose.html
1•t2f2•21m ago•1 comments

Models hallucinate more than you think

https://arxiv.org/abs/2602.01031
1•axelriet•24m ago•1 comments

Write some software, give it away for free

https://nonogra.ph/write-some-software-give-it-away-for-free-05-05-2026
9•nohell•25m ago•0 comments

A virtual copy of your brain? Scientists say it's closer than you think

https://medicalxpress.com/news/2026-05-virtual-brain-scientists-closer.html
2•PaulHoule•26m ago•0 comments

Pragmatic Agent-Native Architecture

https://gmays.com/building-agent-native-software/
1•gmays•26m ago•0 comments

The Quest for Equivalent Exchange – Supporting Exchange in Thunderbird

https://brendan.abolivier.bzh/exchange-pt-1/
2•babolivier•28m ago•0 comments

Amplitude and Statsig Partnership

https://amplitude.com/blog/amplitude-and-statsig-partnership
4•brendanashworth•28m ago•0 comments

Show HN: Rocketship, the only AI app builder with built-in sales team

https://deployrocketship.com
1•CarlosJeer•29m ago•1 comments

Software as the Product of Obsession Times Voice

https://daringfireball.net/2026/05/software_as_the_product_of_obsession_times_voice
3•ndr42•30m ago•0 comments

Shalizi's frame of artificial intelligence as mechanized tradition

https://www.argmin.net/p/cosma-shalizi-is-aware-of-all-internet
1•megamike•30m ago•0 comments

Stephen Hawking fan tests time travel with past party invites (2013)

https://www.telegraph.co.uk/news/picturegalleries/howaboutthat/10488058/Professor-Hawking-fan-tri...
2•downbad_•31m ago•0 comments

How Americans Caught Gold Fever Again

https://www.newyorker.com/magazine/2026/05/11/how-americans-caught-gold-fever-again
1•littlexsparkee•31m ago•1 comments