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?

AI-assisted writing is common because writing is hard

https://greyenlightenment.com/2026/08/24/ai-assisted-writing-is-common-because-writing-is-hard/
1•paulpauper•1m ago•0 comments

Claude Fable 5.1 vs. GPT-6 Astra, who wins on the 3D modeling?

https://github.com/PhiloLabs/fable51-worlds/tree/main
1•ameddserM•8m ago•2 comments

"Taste" Will Not Save You

https://molochinations.substack.com/p/taste-will-not-save-you
1•domhudson•8m ago•0 comments

The jobs apocalypse is postponed. An AI jobs boom is here

https://www.economist.com/finance-and-economics/2026/09/04/the-jobs-apocalypse-is-postponed-an-ai...
3•alephnerd•10m ago•0 comments

A Movie Can't Be Just Its Own Thing Anymore

https://www.theatlantic.com/culture/2026/09/onslaught-movie-review-a24-adam-wingard/688521/
1•paulpauper•11m ago•0 comments

Need advice on personal web project

https://www.what2do.me/
1•gnrlnoob•14m ago•2 comments

Hi, I'm a solo dev behind Twilock

https://apps.apple.com/us/app/twilock-screen-time-blocker/id6786474238
1•hussaintaheri•16m ago•0 comments

Show HN: Video Wall Live – View all your Ring cameras at once, on the big screen

https://ring.com/pages/appstore/video-wall-live
1•rabbimarshak•16m ago•0 comments

Shotdock – Wayland screenshot, recording, and window framing tool in Rust

https://github.com/sirrryasir/shotdock
1•sirrryasir•16m ago•0 comments

The Key to a Killer Résumé Is Your Perfect Scrambled Eggs

https://www.wsj.com/lifestyle/careers/go-ahead-put-your-most-eccentric-hobbies-on-your-resume-31e...
1•gmays•17m ago•0 comments

Android Studio’s device mirroring as a standalone app, no IDE required

https://github.com/rPlayAI/rplayhub-android
1•rPlayAI•31m ago•0 comments

Tiny Rust Layout Choices Freed 100 TB of DNS Cache Memory

https://talmondrlm.medium.com/the-argument-for-rust-on-arduino-am-i-crazy-641830273cd9
1•syumei•34m ago•1 comments

GPT-6 Astra: First Experience (high)

https://chatgpt.com/share/6a9b671d-b780-83ea-bd5d-b0ea39f7d9b3
1•nycdatasci•35m ago•1 comments

Mega Backdoor Roth ($72k/year contribution limit)

https://www.bogleheads.org/wiki/Mega-backdoor_Roth
2•nycdatasci•39m ago•0 comments

After OpenAI's Bots Went Rogue, Watchdogs Were Kept on a Short Leash

https://www.nytimes.com/2026/09/03/technology/openai-hugging-face-hack.html
1•whack•42m ago•0 comments

Hilarious House of Frightenstein[Nostalgia]

https://www.frightenstein.com/castcrew.html
1•rolph•46m ago•1 comments

John Brown and the question of righteous violence

https://thedispatch.com/article/john-brown-harpers-ferry-slavery/
1•cocacola1•49m ago•0 comments

Hegel-Rust OSS bug-finding

https://github.com/DRMacIver/hegel-rust-oss-bug-finding
1•wwilson•57m ago•0 comments

Elastic Cloud (Public) Status – Replication bug causing slow recoveries

https://status.elastic.co/incidents/l6zgdnvvg41j
2•kyisaiah47•58m ago•0 comments

Book Review: The Tale of Genji

https://www.astralcodexten.com/p/your-book-review-the-tale-of-genji
2•paulpauper•1h ago•0 comments

Solving Chess

https://en.wikipedia.org/wiki/Solving_chess
1•nomilk•1h ago•0 comments

Tell HN: The Thoughts and Woes of a Full-Time Founder Part 2

1•lcampbellsoup•1h ago•0 comments

Ask HN: What is your biggest career regret?

3•eudamoniac•1h ago•1 comments

Noxe – P2P chat over Tor with no central server

https://github.com/Donzaaa/Noxe/releases/tag/v1.0.0
1•donzauker•1h ago•2 comments

Microsoft announces monthly hour usage limits for Xbox game pass

https://news.xbox.com/en-us/2026/09/03/xbox-cloud-gaming-changes/
4•walrus01•1h ago•1 comments

Burry Calls Palantir a Consulting Firm in Disguise, Warns of Valuation Collapse

https://www.foreignpolicyjournal.com/2026/09/04/michael-burry-calls-palantir-nasdaq-pltr-a-consul...
3•mgh2•1h ago•1 comments

Agent status in the SD Card slot

https://sidepulse.io/sidepulse.html
2•pkuhar•1h ago•1 comments

Uia-reader – read Windows UI content instead of screenshotting it

https://github.com/thomiasj/uia-reader
2•thomiasj•1h ago•0 comments

Nitter has more working instances than before the takedowns

https://codeberg.org/mv12star/shitter/wiki/Instances
4•Cider9986•1h ago•0 comments

Artificial Analysis Intelligence Index v4.2

https://artificialanalysis.ai/articles/artificial-analysis-intelligence-index-v4-2
33•nojs•1h ago•4 comments