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?

Google claims to have all the answers for enterprise AI agent sprawl

https://www.theregister.com/2026/04/22/google_enterprise/
1•Brajeshwar•21s ago•0 comments

The SPLC indictment, the Klan history behind it, and ignominy of Todd Blanche

https://www.lawdork.com/p/splc-indictment-united-klans-of-america
1•bryanrasmussen•2m ago•0 comments

A $440k Breast Reduction: How Doctors Cashed in on a Consumer Protection Law

https://www.nytimes.com/2026/04/22/us/politics/doctors-insurers-arbitration.html
1•kevinwang•4m ago•0 comments

Ask HN: Find a Claude skill is so hard

1•chunpaiyang•5m ago•1 comments

Proofs Are Programs: A Few Examples of the Curry-Howard Correspondence

https://adueck.github.io/blog/curry-howard-proofs-are-programs/
1•birdculture•6m ago•0 comments

Tailwind CSS v4: A Complete Migration Guide

https://news.ycombinator.com/submit
1•Craftly•11m ago•1 comments

Jeffrey Epstein's name appears twice on a 2015 Silicon Valley dinner invite

https://hebrewhorror.substack.com/p/the-eternal-jew-the-eternal-jeff
1•meandthemajor•13m ago•0 comments

My extension got crickets here, but just got Google's Featured badge

https://chromewebstore.google.com/detail/nexopad-expansor-de-texto/jjjmhgbdbepmledkcoalkfhnnnoignca
1•rychzx•13m ago•1 comments

New Gas-Powered Data Centers Could Emit More Greenhouse Gas Than Nations

https://www.wired.com/story/new-gas-powered-data-centers-could-emit-more-greenhouse-gases-than-en...
3•voxadam•17m ago•0 comments

Ask iFixit: How Do I Fix Sticky Plastics?

https://www.ifixit.com/News/93833/ask-ifixit-how-do-i-fix-sticky-plastics
2•yladiz•17m ago•0 comments

France's 'Secure' ID agency probes breach as crooks claim 19M records

https://www.theregister.com/2026/04/22/frances_secure_id_agency_probes/
2•Brajeshwar•17m ago•0 comments

Tesla lithium refinery discharge contains toxic metals, district demands halt

https://electrek.co/2026/04/21/tesla-lithium-refinery-toxic-metals-wastewater-texas/
3•breve•20m ago•0 comments

Show HN: Sift – save AI tokens in Codex/Claude by summarizing command output

https://github.com/panpeter/sift-skill
1•piotrwilczek•21m ago•1 comments

Alby AI Transport

https://ably.com/ai-transport
1•handfuloflight•22m ago•0 comments

Chat-py: A Python port of Vercel's chat SDK

https://github.com/desplega-ai/chat-py
1•tarasyarema•22m ago•1 comments

Scientists build 'gas battery' that turns noxious pollutants into electricity

https://www.the-independent.com/tech/battery-breakthrough-current-air-pollution-b2961684.html
1•giuliomagnifico•24m ago•0 comments

Show HN: Galen – a structured layer between humans and AI

https://galenvoice.com/
1•drgeorgealex•24m ago•0 comments

Spaced Repetition: Beginner Guide/FAQ

https://entropicthoughts.com/spaced-repetition-beginner-guide-faq
2•ibobev•24m ago•0 comments

A WebGPU Implementation of Surfel-Based Global Illumination

https://juretriglav.si/surfel-based-global-illumination-on-the-web/
3•juretriglav•25m ago•0 comments

X402-Powered X API

https://twit.sh/
2•mempirate•25m ago•1 comments

Symposium: Community-Oriented Agentic Development

https://smallcultfollowing.com/babysteps/blog/2026/04/21/symposium/
1•ibobev•25m ago•0 comments

Columnar Storage Is Normalization

https://buttondown.com/jaffray/archive/columnar-storage-is-normalization/
1•ibobev•25m ago•0 comments

Show HN: Postchi, An ide like api client, clean and local

https://getpostchi.com
1•hamedmonji30•25m ago•0 comments

Spectrum-Ts

https://github.com/photon-hq/spectrum-ts
1•handfuloflight•27m ago•0 comments

The eighth-generation TPU: An architecture deep dive

https://cloud.google.com/blog/products/compute/tpu-8t-and-tpu-8i-technical-deep-dive
2•meetpateltech•28m ago•0 comments

Show HN: Every 4s, Familiar OCRs my screen into Markdown (open source, local)

https://github.com/familiar-software/familiar
1•talsraviv•28m ago•3 comments

Gecko: A fast GLR parser with automatic syntax error recovery

https://vnmakarov.github.io/parsing/compilers/c/open-source/2026/04/22/gecko-glr.html
1•compilersfun•28m ago•0 comments

Russia's funeral industry booms amid record losses in Ukraine

https://finance.yahoo.com/economy/articles/russias-funeral-industry-booms-amid-102400132.html
2•jonnybgood•29m ago•0 comments

Ask HN: Why don’t laptops beep loudly like cars when locking and unlocking?

1•amichail•30m ago•3 comments

Show HN: Rapunzel – a tree-style terminal for AI agents

https://github.com/salmanjavaid/rapunzel/tree/main
1•WasimBhai•31m ago•1 comments