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?

Show HN: Run Log – drop a FIT or GPX file and read what happened on your run

https://runlogapp.com/
1•wally2026•5m ago•1 comments

OpenAI Computer History remembers your activity across the apps and websites

https://twitter.com/OpenAI/status/2087996496088297746
1•acheong08•5m ago•0 comments

When OpenAI employees have a problem, they email this special address

https://fortune.com/2026/08/11/openai-employees-email-friction-address-to-eliminate-bureaucratic-...
1•mji•5m ago•0 comments

Show HN: Inplan – Before Start Coding

https://github.com/melly-lgtm/inplan
1•diane-cis•6m ago•0 comments

The Mystery of Dark Oxygen

https://www.newyorker.com/science/elements/the-mystery-of-dark-oxygen
1•petethomas•6m ago•0 comments

TOSTracker – The Terms Have Changed

https://tostracker.app/briefing
2•tldrthelaw•10m ago•0 comments

Minutes of drawing can reset your nervous system

https://www.washingtonpost.com/wellness/2026/08/13/how-10-minutes-drawing-can-reset-your-nervous-...
3•malloci•14m ago•0 comments

Foothills of the Bay Area house party

https://www.astralcodexten.com/p/the-foothills-of-bay-area-house-party
1•MattSayar•14m ago•0 comments

Sailor went overboard on USS Lincoln; report of worsening mental health for crew

https://www.cnn.com/2026/08/13/politics/uss-abraham-lincoln-conditions-extended-deployment-hnk
1•1659447091•20m ago•0 comments

Show HN: Minesweeper with flowers game you can fork

https://forkcade.com/gallery/minesweeper-flowers
1•jonaldomo•21m ago•0 comments

Bluesky Protocol Services

https://atproto.com/blog/introducing-bluesky-protocol-services
16•danabramov•21m ago•0 comments

Glass Is Glass [video]

https://www.youtube.com/watch?v=7YrdI7h2XoY
1•ValentineC•21m ago•0 comments

SparrowMap – Cameras that watch government vehicles

https://sparrowmap.com/
4•paulnpace•25m ago•0 comments

How Obama's BlackBerry got secured (2023)

https://www.electrospaces.net/2013/04/how-obamas-blackberry-got-secured.html
3•downbad_•25m ago•0 comments

Possession, poem by Jo McCormick (Compaq tech demo circa 1982) [video]

https://www.youtube.com/watch?v=cTg1Smo5CFk
1•joeycastillo•28m ago•0 comments

GitHub adds an ROI section to the Copilot impact dashboard

https://github.blog/changelog/2026-08-07-copilot-impact-dashboard-adds-a-return-on-investment-sec...
2•jamesfinlayson•28m ago•0 comments

Kennedy Center Board Decides to Inscribe Trump's Name on Building

https://www.nytimes.com/2026/08/13/arts/design/kennedy-center-closure-board-vote-trump.html
4•2OEH8eoCRo0•29m ago•0 comments

How Can LLM RL Work Despite Information-Theoretic Inefficiency

https://www.beren.io/2026-07-26-How-Can-LLM-RL-Work-Despite-Information-Theoretic-Inefficiency/
2•jxmorris12•29m ago•0 comments

Show HN: Auto-train the harness, not the LLM. cross-model, cross-benchmark gains

https://github.com/workofart/harness-training
3•megadragon9•30m ago•0 comments

TRS-80 Color Computer Extended Basic Emulator in JavaScript

https://github.com/bshichman/trs80-coco-basic
2•codazoda•30m ago•0 comments

Gitmon Cards – Generate Pokemon-style TCG cards from real GitHub data

https://github.com/mcsscalabrin/gitmon-cards
1•Jojokujo404•32m ago•0 comments

Technological breakthroughs are easy to miss

https://johnjdavis.io/posts/technological-breakthroughs-are-easy-to-miss/
1•jcdavis•32m ago•0 comments

AI Pen Testing Chrome Extension

https://github.com/brianhama/in-browser-sec-audit
2•brianhama•34m ago•0 comments

Hideous Little Bugs Are Invading California and Biting People's Feet (2022)

https://www.bgr.com/science/these-hideous-little-bugs-are-invading-california-and-biting-peoples-...
1•mooreds•39m ago•0 comments

OpenAI launches Computer History to track macOS activity as memory timeline

https://thenewstack.io/openai-chatgpt-computer-history/
2•thoughtpeddler•39m ago•0 comments

AMD Instinct MI455X Deep Dive: CDNA 5 Marks the Next Era of Instinct

https://www.servethehome.com/amd-instinct-mi455x-deep-dive-cdna-5-marks-the-next-era-of-instinct/
1•rbanffy•39m ago•0 comments

Apply for a Second US Passport Book

https://travel.state.gov/en/passports/apply/unique-needs/second-passport-book.html
2•mooreds•39m ago•0 comments

AI Can Now Design Functional Viruses

https://spectrum.ieee.org/ai-designed-virus
1•rbanffy•41m ago•0 comments

Show HN: Referee.Chat - Set the goal. An AI panel works. Referee clears it done

https://referee.chat/
1•nadermx•42m ago•0 comments

Administration to impose tariffs on drone imports, White House says

https://www.reuters.com/world/us/trump-administration-impose-tariffs-drone-imports-white-house-sa...
1•petethomas•42m ago•0 comments