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

Ask HN: Google account on old yahoo.com email hijacked to Google Workspace

1•FlyingAvatar•2m ago•0 comments

AI Agents Can Autonomously Perform Experimental High Energy Physics

https://arxiv.org/abs/2603.20179
1•KolenCh•3m ago•0 comments

Asia boosts coal use as Iran war squeezes global LNG supplies

https://www.npr.org/2026/03/24/g-s1-114940/asia-boosts-coal-use-as-iran-war-squeezes-global-lng-s...
1•geox•4m ago•0 comments

The Rise of the Ray-Ban Meta Creep

https://www.wired.com/story/the-rise-of-the-ray-ban-meta-creep/
2•thm•5m ago•0 comments

DOGE Goes Nuclear: How Trump Invited Silicon Valley into Nuclear Power Regulator

https://www.propublica.org/article/trump-nuclear-power-nrc-safety-doge-vought
1•ourmandave•5m ago•0 comments

Coding After Coders: The End of Computer Programming as We Know It

https://www.nytimes.com/2026/03/12/magazine/ai-coding-programming-jobs-claude-chatgpt.html
1•nguyentranvu•6m ago•0 comments

Debunking Zswap and Zram Myths

https://chrisdown.name/2026/03/24/zswap-vs-zram-when-to-use-what.html
2•javierhonduco•10m ago•0 comments

Building a symbolic math REPL in C

https://github.com/marcomit/derive.c
1•marcomit•12m ago•1 comments

Aletheia – deterministic COBOL verification for mainframe migrations

https://github.com/Aletheia-Verification/Aletheia
1•HectorBlai•12m ago•0 comments

Porting Doom to AIX on IBM RS/6000 [video]

https://www.youtube.com/watch?v=XzhCGSE7KKw
1•hxorr•14m ago•0 comments

LLM Neuroanatomy II: Modern LLM Hacking and Hints of a Universal Language?

https://dnhkng.github.io/posts/rys-ii/
1•realberkeaslan•15m ago•0 comments

Ask HN: Anyone trading prediction markets programmatically?

1•sharp_runner_84•17m ago•0 comments

Hack discovered at (NL) Ministry of Finance; Unclear if data was accessed

https://nltimes.nl/2026/03/24/hack-discovered-ministry-finance-unclear-data-accessed
1•mvdwoord•21m ago•0 comments

USA bans all new routers for consumers

https://www.heise.de/en/news/USA-bans-all-new-routers-for-consumers-11222049.html
4•esher•21m ago•0 comments

Synaps a self-hosted personal health monitor as a weighted knowledge grap

https://github.com/scerelli/SYNAPS
1•succo•24m ago•1 comments

Steve Jobs, speech at the Apple campus (1999) [video]

https://www.youtube.com/watch?v=EoM2Y2KO6kU
1•rbinv•24m ago•0 comments

Can It Resolve Doom? Game Engine in 2k DNS Records

https://core-jmp.org/2026/03/can-it-resolve-doom-game-engine-in-2000-dns-records/
2•Einenlum•26m ago•0 comments

Yann LeCun's LeWorldModel: Stable End-to-End JEPA from Pixels

https://le-wm.github.io/
2•matthieu_bl•27m ago•1 comments

America's Chief Financial Officers Say AI Is Coming for Admin Jobs

https://www.wsj.com/tech/ai/ai-admin-job-market-6a1c3436
1•cebert•29m ago•1 comments

The Wrong Abstraction

https://sandimetz.com/blog/2016/1/20/the-wrong-abstraction
2•mihau•31m ago•1 comments

A Mysterious Numbers Station Is Broadcasting Through the Iran War

https://www.wired.com/story/a-mysterious-numbers-station-is-broadcasting-through-the-iran-war/
2•iamben•31m ago•1 comments

OpenBSD.Amsterdam

https://openbsd.amsterdam/
3•sph•32m ago•1 comments

The orderbook dynamics of prediction markets

2•sharp_runner_84•34m ago•0 comments

Donut Lab's solid-state battery could barely hold a charge after getting damaged

https://www.theverge.com/transportation/898881/donut-lab-solid-state-battery-damage-test
1•tromp•37m ago•1 comments

Show HN: Offline-first UK train planner

https://railraptor.com
1•marcusdev•40m ago•0 comments

curl > /dev/sda: How I made a Linux distro that runs wget | dd

https://astrid.tech/2026/03/24/0/curl-to-dev-sda/
2•astralbijection•43m ago•0 comments

More Magic Math from OpenAI?

https://om.co/2026/03/23/more-magic-math-from-openai/
2•MindGods•43m ago•0 comments

Asyncio is neither fast nor slow

https://blog.changs.co.uk/asyncio-is-neither-fast-nor-slow.html
1•tmarice•45m ago•0 comments

Emerging SaaS trends that are accelerating

2•rado-bogdaonv•48m ago•2 comments

Show HN: CertPulse – Certificate monitoring for multi-cloud teams

https://certpulse.dev
2•xdsai•49m ago•1 comments