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?

Creative as a Service for Growing Brands

https://bespire.com
1•paulsiccha•5m ago•0 comments

nanomem: An Simple, Inference-Time Memory Module

https://openanonymity.ai/blog/nanomem/
1•matt_d•5m ago•0 comments

Build, Sell and Grow Your Online Academy – Skillramp

https://skillramp.com/
1•paulsiccha•5m ago•0 comments

Startupdirectory.io – Discover Innovative Startups

https://startupdirectory.io
1•paulsiccha•6m ago•0 comments

The "SpaceX Mafia": Fostering Innovation Across Industries(2023)

https://www.spacetalent.org/resources/spacex-mafia-fostering-innovation
1•num42•7m ago•0 comments

Building an Unverified Compiler with Agents

https://www.basis.ai/blog/verified-compiler/
1•matt_d•16m ago•0 comments

Dictating Literal Reminders to My Apple Watch

https://mjtsai.com/blog/2026/04/15/dictating-literal-reminders-to-my-apple-watch/
1•alin23•17m ago•0 comments

Show HN: Amazon Reviews Extractor

https://chromewebstore.google.com/detail/amazon-reviews-extractor/maccgnaehlolfonlnplblgpippnhmoal
1•qwikhost•17m ago•0 comments

Feedr – Live audience Q&A for creators

https://apps.apple.com/us/app/feedr-by-mrvl/id6761885406
1•SupaMRVL•23m ago•0 comments

Dream League Soccer 2026

https://apps.apple.com/us/app/dream-league-soccer-2026/id1462911602
1•myothiha•25m ago•0 comments

Internet Protocol Version 8 (IPv8)

https://www.ietf.org/archive/id/draft-thain-ipv8-01.html
2•computersuck•30m ago•2 comments

WybeCoder: Verified Imperative Code Generation

https://facebookresearch.github.io/wybecoder/
1•matt_d•30m ago•0 comments

Don't Use A.I. To Do This

https://www.nytimes.com/2026/04/15/opinion/art-artificial-intelligence.html
1•saikatsg•31m ago•0 comments

GoLand

1•mukulmantosh•33m ago•0 comments

Finance ministers and top bankers raise serious concerns about Mythos AI model

https://www.bbc.com/news/articles/c2ev24yx4rmo
1•wood_spirit•36m ago•0 comments

JSONLines – My Favourite Format

https://heather.cafe/posts/jsonlines-my-favourite-format/
1•vismit2000•36m ago•0 comments

Best of the Best Tips for Kidepo on a Best Uganda Safari

https://substack.com/profile/416658153-godwin-kasekende/note/c-244740651
1•godwinkasekende•36m ago•0 comments

Europol-supported global operation targets over 75 000 users engaged in DDoS

https://www.europol.europa.eu/media-press/newsroom/news/europol-supported-global-operation-target...
3•jruohonen•37m ago•1 comments

The $10B Startup Training AI to Replace the White-Collar Workforce

https://www.bloomberg.com/news/features/2026-04-16/ai-company-hiring-on-linkedin-wants-to-train-y...
2•quantified•40m ago•1 comments

Pentagon Seeks Help from Ford and G.M.

https://www.nytimes.com/2026/04/16/business/pentagon-ford-general-motors-defense-production.html
1•geox•40m ago•0 comments

3D-Printed Homes, an Abandoned $590k Deposit, the FBI

https://www.propublica.org/article/3d-printed-affordable-housing-cairo-illinois-prestige
3•petethomas•43m ago•1 comments

Australia's Fiscal Point of No Return

https://caseyhandmer.wordpress.com/2026/04/16/australia-will-run-an-overt-command-economy-by-2040/
1•MrBuddyCasino•48m ago•0 comments

AI boom is city's weirdest tech boom, says S.F.'s chief economist

https://missionlocal.org/2026/04/ai-boom-controller-economist-egan-wagner/
2•littlexsparkee•50m ago•0 comments

Engineer open-sources radar system that's 95% cheaper than $250k offerings

https://www.tomshardware.com/maker-stem/open-source-radar-system-is-95-percent-cheaper-than-usd25...
3•Element_•1h ago•0 comments

Running Your Own AS: Direct Hetzner Peering

https://blog.hofstede.it/running-your-own-as-direct-hetzner-peering-a-fourth-edge-and-bringing-th...
1•319•1h ago•0 comments

Taste.md

https://pablostanley.substack.com/p/tastemd
3•cspags•1h ago•0 comments

FCC exempts Netgear from ban on foreign routers, doesn't explain why

https://arstechnica.com/tech-policy/2026/04/fcc-exempts-netgear-from-ban-on-foreign-routers-doesn...
10•rawgabbit•1h ago•2 comments

The Iranian Teens Behind Lego Trump [video]

https://www.youtube.com/watch?v=SQfI9NTtDE4
3•abetusk•1h ago•0 comments

Iran's Lego Slopaganda Creator [video]

https://www.youtube.com/watch?v=i5Q_v370OJg
3•abetusk•1h ago•1 comments

Flowsta Sign It

https://flowsta.com/sign-it/
1•solarpunked•1h ago•0 comments