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?

Using the Future to Train Prediction Models

https://blog.lightningrod.ai/p/using-the-future-to-train-prediction-models
1•gweets•1m ago•0 comments

Simon Willison on Technical Blogging

https://writethatblog.substack.com/p/simon-willison-on-technical-blogging
1•cyndunlop•3m ago•0 comments

Nvidia makes AI weather forecasting more accessible, no supercomputer needed

https://thenewstack.io/nvidia-makes-ai-weather-forecasting-more-accessible-no-supercomputer-needed/
1•nick217•3m ago•0 comments

pi

https://buildwithpi.ai/
1•tosh•3m ago•0 comments

EU, India wrap up talks for landmark trade deal amid strained US ties

https://www.reuters.com/world/china/india-eu-wrap-up-talks-landmark-trade-deal-amid-strained-us-t...
1•alephnerd•4m ago•0 comments

Did they just nuke Opus 4.5 into the ground?

https://old.reddit.com/r/ClaudeCode/comments/1qmsfyo/did_they_just_nuke_opus_45_into_the_ground/
1•tamnd•4m ago•0 comments

Maia 200: The AI accelerator built for inference

https://blogs.microsoft.com/blog/2026/01/26/maia-200-the-ai-accelerator-built-for-inference/
1•Handy-Man•5m ago•0 comments

Women Game Designers

https://daily.jstor.org/the-hidden-history-of-women-game-designers/
1•ohjeez•6m ago•0 comments

Show HN: a habit tracker that only lets you track one habit

https://ahabit.app
1•davvie•6m ago•0 comments

Sometimes Your Job Is to Stay the Hell Out of the Way

https://randsinrepose.com/archives/sometimes-your-job-is-to-stay-the-hell-out-of-the-way/
2•Tomte•7m ago•1 comments

Ask HN: How do you prevent children from accessing your products?

3•eastoeast•8m ago•0 comments

Show HN: EhAye Engine – Give your AI a voice

https://ehaye.io
1•avidcoder•9m ago•0 comments

Ask HN: Open Source PM Work

2•conner_h5•9m ago•0 comments

Return Void (Hacking a Vespera II Telescope)

https://thomasloupe.com/project/a-telescope-for-the-world/
3•alnwlsn•10m ago•0 comments

Former astronaut on lunar spacesuits: "I don't think they're great "

https://arstechnica.com/space/2026/01/former-astronaut-on-lunar-spacesuits-i-dont-think-theyre-gr...
2•CharlesW•10m ago•0 comments

Show HN: Chord: Clawdbot alternative with a security layer

https://github.com/tvytlx/chord-releases
1•arctanx•10m ago•0 comments

Show HN: OffLingua on Device AI Translator

https://offlingua.rdcopilot.com/
1•mvpasarel•10m ago•0 comments

Literature Clock

https://literature-clock.jenevoldsen.com/
1•grajmanu•11m ago•0 comments

Temperature and the Sackur–Tetrode Equation [video]

https://www.youtube.com/watch?v=gRPv4rd_6O4
1•surprisetalk•12m ago•0 comments

The mountain that weighed the Earth

https://signoregalilei.com/2026/01/18/the-mountain-that-weighed-the-earth/
2•surprisetalk•12m ago•0 comments

What Drives Retention (2019)

https://www.raphkoster.com/2019/01/30/what-drives-retention/
1•surprisetalk•12m ago•0 comments

Bop It Playing Robot [video]

https://www.youtube.com/watch?v=i9Kmm2tILVo
1•surprisetalk•12m ago•0 comments

Study: More market freedom may mean fewer homicides

https://news.uga.edu/more-market-freedom-fewer-homicides/
1•giuliomagnifico•13m ago•0 comments

Show HN: Dhi – 520x faster data validation for Python, 77x faster for TypeScript

https://github.com/justrach/dhi
2•rachpradhan•13m ago•0 comments

Manage AI Agent skills easily with one CLI command

https://ai-devkit.com/docs/7-skills/
1•hoangnnguyen•14m ago•0 comments

Curl Project Drops Bug Bounties Due to AI Slop Blog – By Maya Posch

https://hackaday.com/2026/01/26/the-curl-project-drops-bug-bounties-due-to-ai-slop/
1•grajmanu•15m ago•1 comments

MCP and Skills: Why Not Both?

https://kvg.dev/posts/20260125-skills-and-mcp/
2•tanelpoder•15m ago•0 comments

The Death of Software 2.0 (A Better Analogy)

https://www.fabricatedknowledge.com/p/the-death-of-software-20-a-better
1•sasvari•16m ago•0 comments

Show HN: Recal – Turn meetings and Slack threads into actionable tasks

https://tryrecal.com
1•markbuilds•17m ago•0 comments

Challenging the dance of bailout and austerity (2025)

https://www.cambridge.org/core/journals/finance-and-society/article/challenging-the-dance-of-bail...
1•robtherobber•18m ago•0 comments