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?

You don't need free lists

https://jakubtomsu.github.io/posts/bit_pools/
1•ibobev•49s ago•0 comments

LinkSnap

https://linksnap.world
1•nirmalh•1m ago•1 comments

Spritework on the Commodore 64

https://bumbershootsoft.wordpress.com/2026/02/21/spritework-on-the-commodore-64/
1•ibobev•1m ago•0 comments

Slack-to-Claude Code CLI gateway for solo developers

https://github.com/ktamas77/claudeway
1•pro_methe5•4m ago•0 comments

There are no statistics in the Kingdom of God (2023)

https://www.experimental-history.com/p/there-are-no-statistics-in-the-kingdom
1•Miraltar•5m ago•0 comments

Show HN: PhraseVault – Desktop text expander, one-time $29 license, source avail

https://phrasevault.app/demo
1•SPQRK•6m ago•0 comments

AI Divide

https://twitter.com/vickyonit/status/2025783511891034566
1•vickyonit•6m ago•1 comments

Magnanrama, a Cyberfeminist Exhibition

https://www.visionscarto.net/magnanrama-cyberfeminist-exhibition
1•recifs•6m ago•1 comments

Show HN:walkie-talkie-style chat with no records,created with just a single link

https://github.com/greatsk55/BLIP
1•hackersk•7m ago•1 comments

Ask HN: How do you know if a tool is solving a real problem?

1•gokulnair2001•9m ago•1 comments

Ask HN: How are EU founders optimizing dividend extraction in 2026?

1•Cyprus-consult•11m ago•0 comments

Show HN: Chaos Monkey but for Audio Video Testing (WebRTC and UDP)

https://github.com/MdSadiqMd/AV-Chaos-Monkey
1•MdSadiqMd•11m ago•0 comments

NASA's Perseverance Now Autonomously Pinpoints Its Location on Mars

https://www.nasa.gov/missions/mars-2020-perseverance/perseverance-rover/nasas-perseverance-now-au...
1•Betelbuddy•12m ago•0 comments

Show HN: The MCP Blueprint – First Comprehensive Book on Model Context Protocol

https://www.amazon.com/dp/B0GPNSPK3Y
1•niuexa•12m ago•0 comments

Agent First Observability

https://github.com/heyojules/lotus
1•gintokinx•12m ago•0 comments

Show HN: I curated 10 builder opportunities this week (signals and MVP specs)

https://aetherite.io
1•crosschainer•14m ago•0 comments

OpenClaw Bans All Crypto Talk on Discord After $16M Fake Token Chaos

https://timescrypto.com/cryptobuzz/ai-and-crypto/openclaw-bans-all-crypto-talk-on-discord-after-1...
2•Alan_Writer•14m ago•0 comments

Plan Diffs for Coding Agents

https://plannotator.ai/blog/plan-diff-see-what-changed/
1•ramoz•15m ago•1 comments

In Forecasting, Search >> Distillation

https://spylab.ai/blog/forecasting-search/
1•polymorph1sm•15m ago•0 comments

Bitcoin Dips Below $65K as Santiment Sees Health in Fading Hype

https://timescrypto.com/cryptonews/bitcoin/bitcoin-dips-below-65k-as-santiment-sees-health-in-fad...
1•Alan_Writer•16m ago•0 comments

Ask HN: Ubiquitous AI and translation for 3 years, why no menu translate?

1•keepamovin•17m ago•0 comments

Stop Saying "AI"

https://arxiv.org/abs/2602.17729
1•Hard_Space•18m ago•0 comments

You are not left behind: Reassessing a fear-mongering phrase

https://www.ufried.com/blog/not_left_behind/
2•plastic-enjoyer•20m ago•0 comments

Show HN: CleverBalance – Automated Bank Reconciliation

https://cleverbalance.ai/
1•vinitmaniar•20m ago•0 comments

The Internet Archive records its 1Tth website

https://www.popsci.com/technology/internet-archive-1-trillionth-website/
2•robtherobber•21m ago•0 comments

The Wolfram S Combinator Challenge

https://www.combinatorprize.org/
1•paraschopra•25m ago•0 comments

The Day Moltbook's Agents Started Doing SEO

https://growtika.com/blog/the-day-moltbooks-agents-started-doing-seo
1•Growtika•27m ago•0 comments

Large Models Are 3D Printers at Bit Layer

https://en.astrian.lol/large-models-are-3d-printers-in-bit-layer/
1•Astrian•28m ago•0 comments

Free multi engine web search CLI for OpenClaw

2•paperboard•28m ago•1 comments

Show HN: Sayiir – Durable, simple, workflow engine in Rust, no replay

https://github.com/sayiir/sayiir
1•ybsoft•29m ago•0 comments