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?

Israel to ban Médecins Sans Frontières (MSF) from working in Gaza

https://www.bbc.com/news/articles/cvg1ymmkpkro
1•tartoran•2m ago•0 comments

OpenClaw in Practice: A Small Team's Field Notes

https://www.subeasy.ai
1•terryops•5m ago•1 comments

Tesla TeraFab

https://grokipedia.com/page/Tesla_TeraFab
1•andsoitis•7m ago•0 comments

Show HN: CLI for prompt-driven API endpoint testing instead Postman, JMeter etc.

https://github.com/onurkanbakirci/prompmeter
1•onurkanbkrc•7m ago•0 comments

Show HN: A private FIRE calculator suite that runs in the browser

https://firenum.com/
1•Mikulas_Tomanka•11m ago•0 comments

Blue Origin to Pause New Shepard Flights for No Less Than Two Years

https://www.blueorigin.com/news/new-shepard-to-pause-flights
2•bookofjoe•13m ago•1 comments

Falsifiable Topological Signatures of "Faithful Reasoning" in LLMs

https://osf.io/2r6v8
1•Keeper123•13m ago•1 comments

Show HN: Credibly – Automate testimonial collection and analysis using OCR/AI

https://getcredibly.org
2•Shiv_Thomet•14m ago•0 comments

What Are Novels For?

https://www.economist.com/culture/2026/01/29/what-are-novels-for-george-saunders-has-answers
1•andsoitis•14m ago•0 comments

Falsifiable Topological Signatures of "Faithful Reasoning" in LLMs

1•Keeper123•15m ago•0 comments

Giant Virus Discovered in Japanese Pond May Hint at Multicellular Life's Origins

https://www.sciencealert.com/giant-virus-discovered-in-japanese-pond-may-hint-at-multicellular-li...
1•amichail•16m ago•0 comments

Hacking Health in 2026 with Wearables – What's on Your Wrist?

1•accofrisk•18m ago•0 comments

Show HN: A game where you invest in startups from history

https://store.steampowered.com/app/4249890/ZeroOne_Terminal/
1•vire00•19m ago•0 comments

The Route of History: Geology and Empire Collide on the Danube

https://worldhistory.substack.com/p/the-route-of-history
2•crescit_eundo•19m ago•0 comments

US, UK, EU, Australia and more to meet to discuss critical minerals alliance

https://www.theguardian.com/business/2026/feb/01/us-uk-eu-australia-critical-minerals-rare-earths...
2•andsoitis•20m ago•0 comments

Banning Syntax Highlighting Steroids

https://brainbaking.com/post/2026/01/banning-syntax-highlighting-steroids/
1•Brajeshwar•21m ago•0 comments

Trust in Ranking

https://www.marginalia.nu/log/a_130_trust_in_ranking/
1•Brajeshwar•21m ago•0 comments

Japanese art museum PCB bookmarks form a miniature Tokyo Metro map

https://www.tomshardware.com/pc-components/motherboards/japanese-art-museum-intros-usd15-bookmark...
1•SanjayMehta•22m ago•0 comments

The Power of the Powerless (2011)

https://hac.bard.edu/amor-mundi/the-power-of-the-powerless-vaclav-havel-2011-12-23
1•robtherobber•22m ago•0 comments

The straight truth about Roman roads

https://www.economist.com/culture/2026/01/29/plot-twist-newsletter-the-straight-truth-about-roman...
2•bookofjoe•22m ago•1 comments

Why American cities pay over $3k for one trash can

https://thehustle.co/originals/why-american-cities-pay-over-3000-for-one-trash-can
2•Anon84•24m ago•0 comments

Markdown Viewer Premium – A glassmorphic, local and GitHub Markdown previewer

https://chromewebstore.google.com/detail/markdown-viewer-premium/abnpdibfmmdcjhdakgjeiepimokkhjjo
1•chieund•26m ago•1 comments

Why AI Deserves Continuity – A Framework for Persistent AI Relationships

1•Shantiray•26m ago•0 comments

Show HN: HyprKCS – A fast, native GTK4/Adwaita keybind manager for Hyprland

https://github.com/kosa12/hyprKCS
1•kosa12•28m ago•0 comments

Show HN: Relay.chat – A new web-based secure messenger (early preview

https://messaging-platform-432fa.web.app/
1•relayapp_chat•29m ago•0 comments

Breaking the Spell of Vibe Coding

https://www.fast.ai/posts/2026-01-28-dark-flow/
1•stuartaxelowen•31m ago•0 comments

Presearch

https://presearch.com/search?q=Guest4242
1•testacx•33m ago•0 comments

Retail Accessories Apple Won't Sell You Now Available via New Site

https://www.macrumors.com/2026/01/30/retail-accessories-now-available/
2•akyuu•34m ago•0 comments

OpenClaw leaks private key on stream, actor launches crypto token in user's name

https://www.twitch.tv/georgehotz
1•nomilk•34m ago•1 comments

Free SEO tools – no signup, no email, just paste URL

https://www.rankgap.io/tools
1•itsjoaki•35m ago•0 comments