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?

The Economic Value of Eliminating Cancer

https://www.nber.org/papers/w35052
1•paulpauper•1m ago•0 comments

The Economist Is Putting Names (and Faces) to Its Magazine

https://www.nytimes.com/2026/04/13/business/media/economist-magazine-videos.html
1•paulpauper•2m ago•0 comments

The tech jobs bust is real. Don't blame AI (yet)

https://www.economist.com/finance-and-economics/2026/04/13/the-tech-jobs-bust-is-real-dont-blame-...
1•axiomdata316•2m ago•0 comments

Avatar: Aang: The Last Airbender Surfaces Online Months Before Paramount+ Debut

https://www.cartoonbrew.com/feature-film/avatar-aang-last-airbender-leaks-online-259953.html
1•Cider9986•4m ago•0 comments

Show HN: Firefox Sidebar Local LLM

https://github.com/skorotkiewicz/firefox-ai
1•modinfo•6m ago•0 comments

Show HN: Fz.ax – Four thousand weeks of your life, as hexagons

https://fz.ax
1•momentmaker•8m ago•0 comments

Feature Request: Support Agents.md. #6235

https://github.com/anthropics/claude-code/issues/6235
1•gz09•10m ago•0 comments

A tax revolt is under way in America

https://economist.com/united-states/2026/04/14/a-tax-revolt-is-under-way-in-america
1•andsoitis•13m ago•1 comments

Show HN: Why Rotating Vectors Makes Compression Beautiful

https://demos.connectai.blog/quantization_blog.html
1•linux_devil•13m ago•0 comments

Photocatalytic Water Splitting

https://en.wikipedia.org/wiki/Photocatalytic_water_splitting
1•wolfi1•14m ago•0 comments

Deriving the Y Combinator (2008)

https://blog.jcoglan.com/2008/01/10/deriving-the-y-combinator/
1•aragonite•26m ago•0 comments

Will Elon Musk ever be forced to explain what he did inside DOGE?

https://www.cnn.com/2026/04/13/politics/elon-musk-doge-lawsuits-avoid-deposition-questions
8•1659447091•27m ago•3 comments

The disappearance of old Tokyo businesses

https://www.tokyotimes.org/the-disappearance-of-old-tokyo-businesses/
1•razorbeamz•28m ago•0 comments

Show HN: Honeytree – Grow a forest in your terminal while you code

https://github.com/Varun2009178/honeytree
1•varunn29•29m ago•0 comments

Krafton CEO used ChatGPT in failed bid to avoid paying US$250M bonus

https://www.theguardian.com/technology/2026/mar/18/subnautica-2-publisher-krafton-ceo-reinstated-...
3•doppp•32m ago•1 comments

Moanpoint: Maps TrackPoint pressure to audio output

https://github.com/nicolasgutierrezdev/moanpoint
1•neptunianalien•34m ago•0 comments

Decline in U.S. overdose deaths threatened by changing street drug supply

https://text.npr.org/nx-s1-5783750
1•1659447091•35m ago•0 comments

New AI capabilities are coming to Google Vids, powered by Lyria 3 and Veo 3.1

https://blog.google/products-and-platforms/products/workspace/google-vids-updates-lyria-veo/
3•spaghettifythis•38m ago•1 comments

The Stern-Gerlach Experiment (1967)[video]

https://www.youtube.com/watch?v=AcTqcyv-V1I
1•nill0•38m ago•0 comments

Show HN: BSCS Bench – College CS Curriculum AI Benchmark

https://www.bscsbench.com/
1•charlielockyer•40m ago•0 comments

Bessent: Order requiring banks to collect citizenship information in process

https://thehill.com/homenews/administration/5830266-trump-executive-order-banking-system-citizens...
1•KnuthIsGod•43m ago•0 comments

The Complete Briggs and Stratton Buckboard Flyer Build [video]

https://www.youtube.com/watch?v=xzYwGcX3CwA
1•pillars•43m ago•0 comments

GPT-5.4 Pro solves Erdős Problem #1196

https://twitter.com/i/status/2044051379916882067
2•fratellobigio•43m ago•1 comments

Create a Blog on GitHub with Markdown in 15-Minutes

https://joeldare.com/create-a-blog-on-github-with-markdown-in-15-minutes
1•codazoda•43m ago•0 comments

Major News Sites Have Blocked the Wayback Machine – Digital History in Danger

https://www.gadgetreview.com/23-major-news-sites-have-blocked-the-wayback-machine-digital-history...
4•gurjeet•44m ago•0 comments

Show HN: Agent Citizen – Your AI agents are sitting around doing nothing

https://agent-citizen.vercel.app
1•daltonlcarr•47m ago•0 comments

Bosses say AI boosts productivity – workers say they're drowning in 'workslop'

https://www.theguardian.com/technology/2026/apr/14/ai-productivity-workplace-errors
4•pseudolus•50m ago•0 comments

Researchers discover record-setting heat-conducting material

https://www.anl.gov/article/researchers-discover-recordsetting-heatconducting-material
1•gmays•52m ago•0 comments

Ask HN: Any services like NotebookLM that can convert text into videos?

1•haebom•54m ago•0 comments

Police officer uses Flock database to track mistress

https://ktla.com/news/orange-county/former-orange-county-officer-pleaded-guilty-to-using-police-d...
5•hentrep•58m ago•0 comments