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

PHPantom: A PHP LSP Written in Rust

https://github.com/AJenbo/phpantom_lsp
1•Einenlum•33s ago•0 comments

How to Just Do a Thing

https://www.raptitude.com/2026/05/how-to-just-do-a-thing/
1•crescit_eundo•1m ago•0 comments

Langwag: Learn a Language from News Stories

https://langwag.com/en
1•danosull•2m ago•1 comments

Dell confirms its SupportAssist software causes Windows BSOD crashes

https://www.bleepingcomputer.com/news/software/dell-confirms-its-supportassist-software-causes-wi...
1•Brajeshwar•2m ago•0 comments

VectorSmuggle: Steganographic exfiltration in vector embedding stores

https://arxiv.org/abs/2605.13764
1•smugglereal•3m ago•0 comments

I cut my OpenRouter bill 43% by fixing my own prompts. Then shipped the tool

https://fixmyprompt.net/
1•chewymole•4m ago•0 comments

From latency to instant: Modernizing GitHub Issues navigation performance

https://github.blog/engineering/architecture-optimization/from-latency-to-instant-modernizing-git...
1•soheilpro•4m ago•0 comments

The Graveyard of the Internet

https://doublespeed.ai/
1•nwhnwh•4m ago•0 comments

Httpx2

https://tildeweb.nl/~michiel/httpx2.html
1•thm•6m ago•0 comments

The Agent Is a Workflow That Writes Itself

https://www.getauctor.com/blog/the-agent-is-a-workflow-that-writes-itself
4•tjbai•6m ago•0 comments

Interrogatory LLM

https://martinfowler.com/bliki/InterrogatoryLLM.html
1•soheilpro•7m ago•0 comments

Cuba says it has run out of fuel, blames U.S. embargo

https://www.upi.com/Top_News/World-News/2026/05/14/Cuba-says-oil-reserves-totally-drained/9311778...
2•thm•9m ago•0 comments

"This was a user-friendly computer."

https://unsung.aresluna.org/this-was-a-user-friendly-computer/
1•bobbiechen•9m ago•0 comments

All 11 onboard survived after plane made emergency landing near the Bahamas

https://www.theguardian.com/us-news/2026/may/14/florida-atlantic-plane-rescue-fuel-low
1•tosh•10m ago•0 comments

Magnetic switch for multimodal, chip-free, and batteryless airway sensing

https://www.science.org/doi/10.1126/sciadv.aed3998
1•PaulHoule•11m ago•0 comments

Restoring the Flow: A Milestone in the Revival of the Everglades

https://e360.yale.edu/features/picayune-strand-restoration-project
1•Brajeshwar•12m ago•0 comments

'The Most Bipartisan Issue Since Beer': Opposition to Data Centers

https://www.nytimes.com/2026/05/01/us/politics/liberals-conservatives-data-centers.html
2•Teever•12m ago•0 comments

Performance per engineer doubled at six big tech companies, and the metric used

https://medium.com/@navigara/performance-per-engineer-doubled-at-six-big-tech-companies-heres-how...
1•alienll•12m ago•0 comments

Turning recorded D&D sessions into comics

https://haffi112.github.io/2026/05/14/dnd-comics/
1•haffi112•13m ago•0 comments

Req Is All You Need

https://benreinhart.com/blog/req-is-all-you-need/
2•ezekg•14m ago•0 comments

I Prefer Djot over Markdown

https://www.karl.berlin/djot.html
1•Tomte•14m ago•0 comments

Apple's Security Has Been Tough to Crack. Mythos Helped Find a Way In

https://www.wsj.com/tech/ai/anthropic-mythos-apple-macos-bug-339da403
2•jbredeche•15m ago•0 comments

You didn't start a business to write content

https://www.muana.page/
1•oktra_dev•15m ago•0 comments

Desperate Trump Taps "Tim Apple," Jensen Huang, Elon Musk to Attend Xi Summit

https://arstechnica.com/tech-policy/2026/05/desperate-trump-taps-tim-apple-jensen-huang-elon-musk...
3•rbanffy•16m ago•0 comments

The SpaceX IPO is upending the stock market

https://www.axios.com/2026/05/14/spacex-musk-sp-stocks
1•Brajeshwar•21m ago•1 comments

Cyber lack of security and AI governance

https://thezvi.substack.com/p/cyber-lack-of-security-and-ai-governance
1•maxutility•21m ago•0 comments

I let Claude autonomously create a graphic novel

https://twitter.com/deepwhitman/status/2054466408835350985
1•bilater•23m ago•1 comments

Extracting the Root VCEK Seed on EPYC Milan via a Software-Only Attack

https://arxiv.org/abs/2605.12990
1•Timofeibu•25m ago•0 comments

RTX 5090 and M4 MacBook Air: Can It Game?

https://scottjg.com/posts/2026-05-05-egpu-mac-gaming/
4•allenleee•26m ago•0 comments

Fully-functional RTX 3070 16GB gets frankensteined into existence

https://www.tomshardware.com/pc-components/gpus/fully-functional-rtx-3070-16gb-gets-frankensteine...
2•Timofeibu•26m ago•0 comments