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

Claude hits #1 on the App Store as users rally behind Anthropic

https://9to5mac.com/2026/03/01/claude-hits-1-on-the-app-store-as-users-rally-behind-anthropics-go...
1•doctoboggan•1m ago•0 comments

Earn Compute Credits

https://www.hpc-ai.com/blog/Share-And-Earn-Social-Media-Campaign
1•hpcaitech•2m ago•0 comments

Secure LLM Scripting. Finally

https://mlld.ai/
1•dahjelle•6m ago•0 comments

RunWatch – CI/CD Observability for GitHub and GitLab

https://runwatch.io
1•toconnor•6m ago•1 comments

We will sacrifice quality for convenience

https://twitter.com/backnotprop/status/2028293637373841759
3•ramoz•6m ago•0 comments

Readout

https://www.readout.org/
1•handfuloflight•7m ago•0 comments

Dual chamber microbial fuel cells using human urine

https://www.sciencedirect.com/science/article/pii/S2211715625008719
1•PaulHoule•9m ago•0 comments

The Metamorphosis of Prime Intellect (1994)

https://localroger.com/prime-intellect/mopiidx.html
1•nz•11m ago•0 comments

There Are Many Ways to Read Hacker News

https://readhacker.news/
1•TigerUniversity•12m ago•0 comments

Show HN: Anime AI Agent for end-to-end anime short creation

https://www.animeaistudio.com/anime-ai-agent
1•deepseekai•14m ago•1 comments

The Crossing Guard Making $14,000 a Month Mailing Out Her Musings from the Job

https://www.wsj.com/lifestyle/careers/crossing-guard-mail-club-14-000-a-month-42afb85d
1•impish9208•14m ago•1 comments

Read Michel de Montaigne's Essays in Modern English

https://magicreader.com/montaigne
1•mzelling•24m ago•0 comments

Block and Tackle: Job Cuts and the AI Narrative

https://om.co/2026/02/28/block-tackle-job-cuts-the-ai-narrative/
1•qwikhost•25m ago•1 comments

Smallest QR Code Is So Tiny It's Invisible to the Human Eye

https://www.sciencealert.com/worlds-smallest-qr-code-is-so-tiny-its-invisible-to-the-human-eye
1•rendx•27m ago•0 comments

Show HN: Foundations Chat, macOS AI chat built on Apple's local models

https://codeeverywhereca.github.io/foundations-chat/
1•coevcan•29m ago•0 comments

A curious phenomenon called 'Etak' (2024)

https://maphappenings.com/2024/04/11/story-of-etak/
1•giancarlostoro•31m ago•0 comments

The limited utility of the phrase "GNU/Linux" (2022)

https://seirdy.one/posts/2022/12/09/limited-utility-gnu-linux/
1•LorenDB•31m ago•0 comments

Show HN: Sun – Realtime voice agent for group conservation not just turn taking

https://www.getsun.io/
2•anand_pattern•33m ago•2 comments

A semantic Code Search CLI but with grep filters

https://github.com/lightonai/next-plaid
1•raphaelty•37m ago•1 comments

Swarming, spinning microrobots can manipulate their surroundings

https://news.cornell.edu/stories/2026/02/swarming-spinning-microrobots-can-manipulate-their-surro...
1•geox•45m ago•0 comments

I'm Sorry This New Artist Sucks [video]

https://www.youtube.com/watch?v=eKxNGFjyRv0
1•thunderbong•48m ago•0 comments

Opponent Modeling Wins 2× Faster Than Stockfish

https://blog.lukesalamone.com/posts/winning-faster-than-stockfish/
1•salamo•49m ago•0 comments

Personal token: share equity in your lifetime upside

https://github.com/homan9/personal-token/blob/main/whitepaper.md
1•koopuluri•53m ago•0 comments

Future of Devtools and Moats

https://ravivyas.com/2026/03/01/dev-tools-and-moats
2•ravivyas•54m ago•1 comments

Piezoelectric gel to regenerate lost bone (e.g. periodontitis)

https://oralbiolife.com/
2•camebeforeagain•55m ago•1 comments

Show HN: Orcv: If tmux was built for window management on macOS in 2026

https://github.com/jasonjmcghee/orcv
1•jasonjmcghee•57m ago•1 comments

Show HN: I used LLMs to build a compression tool that beats xz on x86_64 ELFs

4•mohsen1•57m ago•3 comments

Vibe Knowing

https://idiallo.com/blog/large-language-models-make-us-feel-smarter
1•foxfired•57m ago•0 comments

How Nanotech Made an Old Leukemia Drug 22,000x Stronger

https://www.medscape.com/viewarticle/how-nanotech-made-old-leukemia-drug-22-000x-stronger-2026a10...
1•wjb3•1h ago•1 comments

Show HN: Aver - Git-native CLI knowledge management tool (keep issues with code)

https://github.com/dentm42/aver
1•dentm42•1h ago•1 comments