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

Islamic Medicine (2018)

https://hekint.org/2018/11/19/islamic-medicine/
1•debo_•1m ago•0 comments

Intel Is Making Progress. But It Isn't Out of the Woods Yet

https://www.wsj.com/finance/stocks/intel-is-making-progress-but-it-isnt-out-of-the-woods-yet-f69c...
1•Brajeshwar•3m ago•0 comments

I don't care that it's X times faster

https://tinkering.xyz/faster/
1•RohanAdwankar•5m ago•0 comments

Robot breaks human world record for half-marathon in China

https://www3.nhk.or.jp/nhkworld/en/news/20260419_13/
1•baal80spam•6m ago•0 comments

Bringing the Power of the Sun to Earth: Nuclear Fusion Reactors

https://www.simonsfoundation.org/2026/02/18/bringing-the-power-of-the-sun-to-earth/
1•ganitam•7m ago•0 comments

Egypt's Forgotten Industrial Revolution

https://lostfutures.substack.com/p/egypts-forgotten-industrial-revolution
1•Lost-Futures•7m ago•0 comments

Swiss authorities want to reduce dependency on Microsoft

https://www.swissinfo.ch/eng/swiss-ai/swiss-authorities-want-to-reduce-dependency-on-microsoft/91...
3•doener•8m ago•0 comments

The time when we suffer from large amounts of AI slop is gone

https://lists.haxx.se/pipermail/daniel/2026-April/000153.html
2•jicea•9m ago•0 comments

Yoshihisa Kishimoto (1961 – 2026), creator of Double Dragon and Kunio-kun

https://old.reddit.com/r/NintendoClassics/comments/1sp8dao/in_tribute_to_yoshihisa_kishimoto_1961...
1•alberto-m•12m ago•0 comments

A trainspotter's dream: our own station on England's most scenic railway

https://www.ft.com/content/999edf24-3737-44ba-8ecb-57baa6493a27
1•bwb•14m ago•1 comments

The Weird, Dangerous, Isolated Life of the Saturation Diver

https://www.atlasobscura.com/articles/what-is-a-saturation-diver
2•thunderbong•15m ago•0 comments

Autoloom – Autonomous AI Agent built on tinyloom

https://github.com/thresher-sh/autoloom
2•rmason•16m ago•0 comments

Self-improving Artificial Intelligence (2007) [video]

https://www.youtube.com/watch?v=omsuTsOmvsc
2•downboots•16m ago•0 comments

George McGovern: On Taxing and Redistributing Income (1972)

https://www.nybooks.com/articles/1972/05/04/george-mcgovern-on-taxing-redistributing-income/
2•mitchbob•17m ago•1 comments

The making of a search engine: A conversation with the creator of Tantivy

https://www.paradedb.com/blog/tantivy-interview
3•philippemnoel•19m ago•0 comments

AI Assistance Reduces Persistence and Hurts Independent Performance

https://arxiv.org/abs/2604.04721
1•yagyu•21m ago•0 comments

Iron Galaxy Studios Lays Off Staff, Blames "Current Market Conditions"

https://www.techpowerup.com/348330/iron-galaxy-studios-lays-off-staff-blames-current-market-condi...
3•mikhael•24m ago•0 comments

Stop trying to engineer your way out of listening to people

https://ashley.rolfmore.com/stop-trying-to-engineer-your-way-out-of-listening-to-people/
1•walterbell•24m ago•0 comments

What Anthropic's Mythos and Project Glasswing Mean for Your Apple Devices

https://tidbits.com/2026/04/09/what-anthropics-mythos-and-project-glasswing-mean-for-your-apple-d...
1•JumpCrisscross•25m ago•0 comments

How the JVM Optimizes Generic Code – A Deep Dive [video]

https://www.youtube.com/watch?v=J4O5h3xpIY8
1•pron•27m ago•0 comments

A. J. Ayer – ‘What I Saw When I Was Dead’ (1988)

https://www.philosopher.eu/others-writings/a-j-ayer-what-i-saw-when-i-was-dead/
14•isomorphy•29m ago•1 comments

Show HN: Lmcli v0.5.0 – A useable tool for LLM minimalists

https://codeberg.org/mlow/lmcli
2•wolttam•36m ago•0 comments

A Long Elusive Lung Cancer Target May Be Yielding to New Drugs

https://www.wsj.com/health/pharma/a-long-elusive-lung-cancer-target-may-finally-be-yielding-to-ne...
1•marc__1•38m ago•0 comments

12 types of Submarines: A detailed guide to powerful underwater naval vessels

https://timesofindia.indiatimes.com/defence/news/12-types-of-submarines-a-detailed-guide-to-power...
1•rustoo•39m ago•0 comments

On the Cult of Meetings

https://yanmaani.net/on-the-cult-of-meetings/
1•yanmaani•42m ago•0 comments

What Claude Code Chooses

https://amplifying.ai/research/claude-code-picks/report
1•ville•48m ago•2 comments

Hand Paintings and Engravings in Rock Art

https://www.bradshawfoundation.com/hands/hand_paintings_world_rock_art/index.php
1•jruohonen•49m ago•0 comments

NSA using Anthropic's Mythos despite blacklist

https://www.axios.com/2026/04/19/nsa-anthropic-mythos-pentagon
3•jbegley•51m ago•1 comments

Show HN: NYC Guessr – GeoGuessr for NYC but with live video cam footage

https://nycguessr.vercel.app/
2•aldrinjenson•52m ago•0 comments

Blue Origin's rocket reuse achievement marred by upper stage failure

https://arstechnica.com/space/2026/04/errant-upper-stage-spoils-blue-origins-success-in-reusing-n...
13•rbanffy•52m ago•1 comments