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?

Why Databricks can't match ClickHouse Cloud for real-time analytics

https://clickhouse.com/blog/clickhouse-vs-databricks-real-time-performance-per-dollar
1•ilreb•23s ago•0 comments

Former German spy chief arrested, suspected of trading state secrets and treason

https://text.npr.org/g-s1-146630
1•firefax•58s ago•0 comments

The methane mega-leaks from UN climate summit host Turkey

https://www.theguardian.com/environment/2026/oct/05/methane-mega-leaks-from-un-climate-summit-hos...
1•littlexsparkee•1m ago•0 comments

Teenager rescued from B.C. 'Widowmaker' after getting stranded following Claude

https://www.ctvnews.ca/vancouver/article/teenager-rescued-from-bcs-widowmaker-after-getting-stran...
1•AlexeyBrin•1m ago•0 comments

AI training of copyrighted material not fair use: Third Circuit

https://www.courthousenews.com/ai-training-of-copyrighted-material-not-fair-use-third-circuit/
2•donohoe•2m ago•0 comments

Why the Future Doesn't Need Us – Bill Joy (2000)

https://www.wired.com/2000/04/joy-2/
1•bikeshaving•4m ago•1 comments

Subquadratic 3SUM and Subcubic APSP

https://arxiv.org/abs/2610.06783
1•mauriziocalo•5m ago•0 comments

VMPal – Virtual Machines for Apple Silicon and AI Agents

https://vmpal.com/
1•surrTurr•6m ago•0 comments

Show HN: Five Nines – learn cloud design patterns by surviving traffic spikes

https://github.avestura.dev/five-nines/
2•avestura•7m ago•0 comments

Do you pay for failed-payment recovery on Stripe, or is Smart Retries enough?

https://failed-payment-recovery-waitlist.pages.dev/
1•matheuspvaneli•9m ago•0 comments

Software developers are not okay

https://www.baldurbjarnason.com/2026/05-software-developers-are-not-okay/
1•speckx•9m ago•0 comments

SAP to Acquire TechWolf

https://news.sap.com/2026/10/sap-to-acquire-techwolf-evidence-based-work-age-of-ai/
1•yogananda•9m ago•0 comments

DGX Station GB300 Cluster: Two Towers over 400G DACs

https://www.storagereview.com/review/dgx-station-gb300-cluster-two-towers-two-400g-dacs
1•rbanffy•10m ago•0 comments

Hermes Agent on Kubernetes: no Helm chart, and the image needs root at init

https://www.revos.ai/blog/hermes-agent-kubernetes
1•zubairov•10m ago•0 comments

Lightsaber-like plasma antenna uses laser-ionized air to transmit radio waves

https://phys.org/news/2026-10-lightsaber-plasma-antenna-laser-ionized.html
1•bilsbie•11m ago•0 comments

Eating Alone

https://longreads.com/2026/09/15/convenience-friction-eating-alone/
1•mooreds•11m ago•0 comments

Horn of Africa fears spillover effect of renewed fighting

https://www.france24.com/en/tv-shows/the-debate/20260930-ethiopia-back-to-civil-war-horn-of-afric...
1•mooreds•12m ago•0 comments

Tennessee Emergency Alerts Redirect to a Facebook Page

https://sk500.online/tech/tennessee-emergency-alerts-redirect-to-a-facebook-page/
1•airhangerf15•12m ago•0 comments

Show HN: MailAccess – the true Email OSINT framework

https://mailaccess.pro
13•coding-maniac•12m ago•0 comments

With parallel parking turning competitive, one producer gets a lesson

https://text.npr.org/nx-s1-5991667
1•mooreds•14m ago•0 comments

Bordeaux Is Burning – Why?

https://www.medieval.eu/bordeaux-is-burning-why/
1•speckx•14m ago•0 comments

Liberty AI Project One

https://github.com/julialennonofficial-art/LIBERTY-AI-PROJECT-ONE
1•JuliaLennon•16m ago•0 comments

A minimal kernel in Swift, running in QEMU

https://carette.xyz/posts/minimal_swift_kernel_on_qemu/
1•surprisetalk•17m ago•0 comments

Show HN: ApolloShell, a Caelestia-style desktop shell for macOS

https://github.com/Silvertree2010/ApolloShell
1•NetterSilver•17m ago•0 comments

Faster Software Linking with Mold

https://twitter.com/lemire/status/2107439648238669900
2•tosh•21m ago•0 comments

After the Bishyari

https://www.lrb.co.uk/blog/2026/september/after-the-bishyari
1•speckx•22m ago•0 comments

Hofstadter's butterfly turns 50: a fractal hiding in quantum matter

https://physicsworld.com/a/hofstadters-butterfly-turns-50-a-fractal-hiding-in-quantum-matter/
1•sohkamyung•23m ago•0 comments

Show HN: Bridglet – a managed SFTP with a web UI for file sharing

https://bridglet.com
1•vectorfrog•24m ago•1 comments

Show HN: Data Observability for Supabase

https://sodabase.io/
1•santiviquez•25m ago•0 comments

Show HN: Paganel – Data migration with a receipt you can verify later

https://github.com/stanstork/paganel
1•stan_stork•25m ago•0 comments