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?

Visualize the entropy of a code base with a 3D force-directed graph

1•Piprim•39s ago•0 comments

Show HN: Binary is no longer safe

https://reorchestrate.com/posts/your-binary-is-no-longer-safe/
1•seddonm1•1m ago•0 comments

Claude 4 Sonnet: Conversation with Kai

https://docs.google.com/document/d/12woq_BpFbzLkH4zHvVRJLPyiZGoDVDxA/edit
1•doener•2m ago•0 comments

Show HN: Provisioner per-board sidecar for serial access, flashing, and bring-up

1•acarminati•2m ago•0 comments

A Pocket Guide to Surviving the Robot Apocalypse

https://corbt.com/posts/a-pocket-guide-to-surviving-the-robot-apocalypse/
1•kcorbitt•4m ago•0 comments

Virtual Width Networks (VWN)

https://arxiv.org/abs/2511.11238
1•tesserato•4m ago•1 comments

Kung Fu Robots Deliver 'Knockout' Performance at Spring Festival Gala [video]

https://www.youtube.com/watch?v=NVX6vq0RSnY
1•zaikunzhang•4m ago•0 comments

Show HN: Scrappy – Open-source browser scraper written in Go

https://github.com/sunergos-ro/scrappy
1•RaulOnRails•4m ago•0 comments

User "Claude" committing vulnerabilities at a rapid rate

https://cyberplace.social/@GossiTheDog/116080909947754833
1•not2b•5m ago•0 comments

Java has evolved. Your code can too

https://javaevolved.github.io
1•pjmlp•5m ago•0 comments

The left is missing out on AI

https://www.transformernews.ai/p/the-left-is-missing-out-on-ai-sanders-doctorow-bender-bores
1•themgt•5m ago•0 comments

UK government may 'age restrict or limit children's VPN use'

https://www.techradar.com/vpn/vpn-privacy-security/uk-government-says-it-may-age-restrict-or-limi...
1•iamnothere•8m ago•0 comments

AI Rot Management

https://jw.hn/ai-code-hygiene
1•jwpapi•13m ago•0 comments

Big tech stocks lose billions as AI spending fears hit valuations

https://www.reuters.com/business/retail-consumer/global-markets-marketcap-2026-02-16/
3•billybuckwheat•14m ago•0 comments

Robert Duvall, a Chameleon of an Actor Onscreen and Onstage, Dies at 95

https://www.nytimes.com/2026/02/16/movies/robert-duvall-dead.html
3•bookofjoe•14m ago•1 comments

Vulkan Easy => Reactor (Like React-App)

https://github.com/AndreeSalazar/REACTOR-Framework-for-Vulkan-
2•QDanteX•14m ago•0 comments

Anthropic got an 11% user boost from its OpenAI-bashing Super Bowl ad

https://www.cnbc.com/2026/02/13/anthropic-open-ai-super-bowl-ads.html
1•general_reveal•14m ago•0 comments

Anthropic Raised $30B. Where Does It Go?

https://fromtheprism.com/anthropic-30-billion
1•heavymemory•15m ago•0 comments

Show HN: VoteShip – Feature request platform built for AI agents

https://voteship.app/
1•madcash•16m ago•0 comments

Porous material uses green and blue light to repeatedly store and release CO₂

https://phys.org/news/2026-02-porous-material-green-blue.html
2•westurner•16m ago•0 comments

Jon Favreau Confirms Lucasfilm Exit Amid 'The Mandalorian and Grogu' Uncertainty

https://insidethemagic.net/2026/02/jon-favreau-lucasfilm-star-wars-mandalorian-grogu-exit-cj1/
2•iancmceachern•17m ago•1 comments

AI Slopageddon and the OSS Maintainers

https://redmonk.com/kholterhoff/2026/02/03/ai-slopageddon-and-the-oss-maintainers/
1•mooreds•17m ago•0 comments

Peon Training feature piggybacks on AI coding session

https://github.com/PeonPing/peon-ping
1•mthwsjc_•18m ago•0 comments

Governor: Extensible CLI for security-auditing AI-generated applications

https://github.com/ulsc/governor
1•ulsc•19m ago•0 comments

Suicide Linux (2009)

https://qntm.org/suicide
9•icwtyjj•20m ago•3 comments

Unreal Tournament 2004 is now available for free thanks to its fan community

https://www.pcgamer.com/games/fps/unreal-tournament-2004-is-now-available-for-free-thanks-to-its-...
1•donutshop•20m ago•0 comments

The Three Juggling Acts (Strategic, Lazy, and Survival)

https://cutlefish.substack.com/p/tbm-407-the-three-juggling-acts-strategic
1•mooreds•21m ago•0 comments

Discovering Domains via NS Correlation

https://interrupt.sh/blog/discovering-domains-via-ns-correlation/
1•arwt•21m ago•0 comments

App builder market trends and statistics

https://getmocha.com/blog/ai-app-builder-statistics/
3•nichochar•22m ago•0 comments

Glimpse – A Clean Architecture Pattern for Django and Coding Agents

https://medium.com/@radoslaw_jan/a-glimpse-of-cleaner-architecture-for-django-projects-c31295529eb5
1•novagalileo•28m ago•0 comments