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?

Inflated AI claims are under fire–and the regulatory reckoning is coming

https://fortune.com/2026/04/23/ai-washing-securities-litigation-regulatory-era-baker-mckenzie/
1•Brajeshwar•19s ago•0 comments

User-side software, and adversarial marketplaces

https://faingezicht.com/articles/2026/04/22/adversarial-marketplaces/
1•speckx•58s ago•0 comments

GitHub CLI begins collecting client-side user telemetry

https://www.theregister.com/2026/04/22/github_opts_all_cli_users/
1•LaSombra•1m ago•0 comments

The end of oil? As fuel shocks cascade, 53 nations plan a fossil fuel phaseout

https://theconversation.com/the-end-of-oil-as-fuel-shocks-cascade-53-nations-gather-to-plan-a-fos...
1•smurda•2m ago•0 comments

GitHub Having Issues (Again)

https://www.githubstatus.com/incidents/3f30ycplyr7l
1•connorbrinton•2m ago•1 comments

Flat Data

https://githubnext.com/projects/flat-data
1•themaxdavitt•3m ago•0 comments

Show HN: Buffer zoom, adds OS-native scrollback, copy, and find to any tmux pane

https://docs.hmx.dev/features/buffer-zoom/
1•aarcamp•3m ago•0 comments

What if you didn't need to write back end code for your app?

https://linkedrecords.com/getting-started/
1•WolfOliver•3m ago•0 comments

Mysterious rings around Uranus point to hidden moons orbiting the ice giant

https://www.space.com/astronomy/uranus/mysterious-rings-around-uranus-point-to-hidden-moons-orbit...
1•e145bc455f1•3m ago•0 comments

Common questions and support documentation for Eurosky account holders

https://eurosky.tech/help/
1•doener•4m ago•0 comments

Dow Contracting for Startups 101

https://www.a16z.news/p/dow-contracting-for-startups-101
1•7777777phil•4m ago•0 comments

Welsh castle's hidden cave was once home to ancient hippo

https://www.independent.co.uk/news/science/archaeology/wogan-cavern-pembroke-castle-hippo-b295906...
1•gmays•5m ago•0 comments

CheerpJ 4.3 – WebAssembly-based JVM for the browser

https://bytecode.news/posts/2026/04/cheerpj-4-3-webassembly-based-jvm-for-the-browser
1•jeffreportmill1•5m ago•0 comments

Malware via monitor cables a matter of national security? The gadget for you

https://www.theregister.com/2026/04/23/ncscs_first_foray_into_commercial/
1•noja•6m ago•0 comments

Elon Musk admits that Tesla vehicles won't get unsupervised FSD

https://www.theverge.com/transportation/917167/elon-musk-tesla-hw3-fsd
2•LaSombra•6m ago•1 comments

Germ Is a (Protocol-Native, End-to-End Encrypted) Social Media Messenger

https://www.germnetwork.com/blog/germ-is-a-social-media-messenger
1•eustoria•9m ago•0 comments

The Tao of Unix Programming

https://github.com/globalcitizen/taoup
1•dtj1123•10m ago•0 comments

Building agents that reach production systems with MCP

https://claude.com/blog/building-agents-that-reach-production-systems-with-mcp
1•imgyuri•10m ago•0 comments

Inside Garry Tan's Claude Code Setup

https://www.youtube.com/watch?v=wkv2ifxPpF8
1•doppp•10m ago•0 comments

UUP Dump: Download UUP Files from Windows Update Servers

https://uupdump.net/
2•eustoria•11m ago•0 comments

The "AI Vulnerability Storm": Building a "Mythos-Ready" Security Program

https://labs.cloudsecurityalliance.org/mythos-ciso/
1•nuke-web3•12m ago•0 comments

I checked 506 citations from ChatGPT,Claude, Gemini Deep Research- 36% are wrong

https://spineframe.xyz/blog
2•ratnaditya•13m ago•0 comments

Auth0 Certified Developer Exam Study Guide

https://certification.okta.com/page/developer-auth0-exam-study-guide
1•mooreds•13m ago•0 comments

World's Largest Holstein Cow

https://www.ndtourism.com/new-salem/attractions-entertainment/family-fun/salem-sue
1•mooreds•13m ago•0 comments

The User-Tailored Newsroom

https://werd.io/the-user-centered-newsroom/
1•benwerd•13m ago•0 comments

Sbtimbti – SBTI and MBTI Personality Test

https://www.sbtimbti.online
1•endmund•14m ago•1 comments

Bye, Doom

https://houseofkyle.com/2026/03/08/bye-doom/
1•eustoria•14m ago•1 comments

Show HN: Typed Natural Language – A better plan mode with workflow for coding

https://github.com/janaraj/tnl
1•janaraj•14m ago•0 comments

SPV Syndicate League Tables

https://fundadminleaguetable.com/
1•lemonlym•14m ago•0 comments

A Powerful New 'QR Code' Untangles Math's Knottiest Knots

https://www.quantamagazine.org/a-powerful-new-qr-code-untangles-maths-knottiest-knots-20260422/
1•Brajeshwar•16m ago•0 comments