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?

BreakPoint: Local-first CI gate for LLM output changes (cost, PII, drift)

https://github.com/cholmess/breakpoint-ai
1•cholmess21•1m ago•1 comments

Amazon dethrones Walmart as the world's biggest company by sales

https://www.npr.org/2026/02/19/nx-s1-5719173/amazon-walmart-biggest-company-by-sales
1•geox•3m ago•0 comments

Tube passengers targeted in 'smishing' scam, court told

https://www.bbc.co.uk/news/articles/cg4gkzw971go
1•edward•6m ago•0 comments

Your Android phone has a desktop mode you're probably not using

https://www.makeuseof.com/android-phone-has-desktop-mode-youre-probably-not-using/
1•teleforce•12m ago•0 comments

Democratizing cryptographic silicon verification with Infra-Red imaging (2024)

https://www.bunniestudios.com/blog/2024/iris-infra-red-in-situ-project-updates/
2•transpute•12m ago•0 comments

Symplex Protocol – semantic intent vectors for AI agent communication (Go, v0.1)

https://github.com/olserra/symplex
1•olserra•13m ago•1 comments

The Rise of Invisible Unemployment in Tech: 2026 Will Be the Year It Changes

https://www.saastr.com/the-rise-of-invisible-unemployment-in-tech-2026-will-be-the-year-when-ever...
1•bentobean•16m ago•0 comments

Ask HN: How do you monitor and retry failed webhooks in production?

1•GoatPerfect•16m ago•0 comments

Write Perfect Emails in Seconds

3•vinayofc•16m ago•0 comments

The New Mexico cave expanding our search for alien life

https://www.bbc.com/future/article/20260130-how-deep-caves-are-transforming-our-search-for-extrat...
1•marc__1•16m ago•0 comments

Functionalized Coatings as Biohybrid UV-Sensors

https://advanced.onlinelibrary.wiley.com/doi/10.1002/admi.202500125
1•PaulHoule•16m ago•0 comments

Show HN: PrivateOS: An AI agent that runs on your phone

https://private-os.vercel.app
1•pruthvi77•17m ago•1 comments

CipherDrop

https://www.cipherdrop.app/
1•shablulman•18m ago•0 comments

Announcing Oracle Solaris 11.4 SRU90

https://blogs.oracle.com/solaris/announcing-oracle-solaris-11-4-sru90
3•pjmlp•19m ago•0 comments

Ask HN: My startup failed. How do I get back?

2•kflywheel•19m ago•0 comments

MacBook Tilt Sim Toy – One-Shot Experiment

https://github.com/NSEvent/tilt-sim-experiment
1•thekevintang•22m ago•0 comments

The Cuneiform Tablets of 2015 [pdf]

https://tinlizzie.org/VPRIPapers/tr2015004_cuneiform.pdf
1•tosh•24m ago•0 comments

Automated PR risk scoring with LLMs

https://github.com/KinanNasri/PRScope
1•KinanNasri•25m ago•1 comments

Show HN: Tapedeck – A 4-track cassette recorder in your terminal, built in Rust

https://github.com/manthan787/tapedeck
2•EmTekker•26m ago•1 comments

Mining metrics from unstructured logs (2022)

https://coroot.com/blog/engineering/mining-metrics-from-unstructured-logs/
1•hhthrowaway1230•27m ago•0 comments

Show HN: 149/year landing page and hosting and domain for small businesses

1•laci27•27m ago•0 comments

Evidence of the bouba-kiki effect in naïve baby chicks

https://www.science.org/doi/10.1126/science.adq7188
2•suddenlybananas•28m ago•0 comments

Postmortem: Clerk System Outage (February 19, 2026)

https://clerk.com/blog/2026-02-19-system-outage-postmortem
1•hisamafahri•29m ago•0 comments

Agent-First Software Development Lifecycle

https://github.com/podviaznikov/sdlc-bridge/blob/main/AGENT-FIRST-SDLC.md
4•podviaznikov•30m ago•2 comments

Gauss's Weekday Algorithm, Visualized

https://lukasmetzner.github.io/blog/gauss-weekday.html
1•lukasmetzner•30m ago•0 comments

One man's trail of alleged abuse through SF's private club scene

https://sfstandard.com/2026/02/13/mickey-gerold-amador-clubs-investigation/
2•randycupertino•31m ago•1 comments

Colorado Democrats suggest age verification on OS level

https://twitter.com/LundukeJournal/status/2025313056352600341
2•miohtama•32m ago•0 comments

End of Productivity Theater

http://muratbuffalo.blogspot.com/2026/02/end-of-productivity-theater.html
4•zdw•34m ago•0 comments

The future of AI is uncertain even for Anthropic and OpenAI

https://www.albertplaya.com/posts/future-of-ai-uncertain-anthropic-openai/
2•albertplaya•35m ago•1 comments

Show HN: Use plain English to make forms on WordPress

https://wp.forms.md
1•darkhorse13•35m ago•0 comments