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?

Online age-verification in U.S. for child safety, but adults being surveilled

https://www.cnbc.com/2026/03/08/social-media-child-safety-internet-ai-surveillance.html
1•1vuio0pswjnm7•1m ago•0 comments

Anthropic sues Trump admin over supply-chain risk label

https://www.politico.com/news/2026/03/09/anthropic-sues-trump-admin-over-supply-chain-risk-label-...
2•johnny313•1m ago•0 comments

Show HN: Llmpm – NPM for LLMs

https://www.llmpm.co/
1•sarthaksaxena•1m ago•0 comments

Trump's Canada Trade War Hits Jack Daniel's and Jim Beam with 'Devastating' Loss

https://www.inc.com/leila-sheridan/trumps-canada-trade-war-hits-jack-daniels-and-jim-beam-with-a-...
1•dj_rock•1m ago•0 comments

Following AI generated reviews, Resident Evil AI guide books flood Amazon

https://frvr.com/blog/following-ai-generated-reviews-resident-evil-requiem-ai-guide-books-flood-a...
1•jsheard•1m ago•0 comments

2026 F1 Cars Are Shorter but Still Longer Than a Chevy Tahoe

https://www.thedrive.com/news/2026-f1-cars-are-shorter-but-still-longer-than-a-chevy-tahoe
1•PaulHoule•1m ago•0 comments

Muon on Graph Neural Networks

https://brunoalano.com/writing/muon-optimizer-gnns/
1•brunoalano•1m ago•1 comments

ZeniMax Files Trademark for Quake

https://trademarks.justia.com/996/80/quake-99680430.html
1•speckx•2m ago•0 comments

Why Are Viral Capsids Icosahedral?

https://press.asimov.com/articles/viral-capsids
1•mailyk•2m ago•0 comments

How to Recalculate a Spreadsheet (2020)

https://lord.io/spreadsheets/
1•azhenley•2m ago•0 comments

How do you track and optimize your AI API spend?

1•CostsentryAI•3m ago•0 comments

Show HN: Zenòdot – Find if a book has been translated into your language

https://www.zenodot.app/
1•AusiasTsel•5m ago•1 comments

NutriAI – AI nutrition and fitness planner

https://nutriai.si/
1•domaisi•6m ago•1 comments

Just Move to Europe

https://justmovetoeurope.com/
2•FinnKuhn•6m ago•0 comments

AI-powered I Ching oracle for reflective decision-making

https://oracle-answer-engine.lovable.app/
1•snowmei•7m ago•1 comments

AMD VP uses AI to create Radeon Linux userland driver in Python

https://www.tomshardware.com/pc-components/gpu-drivers/amd-vp-uses-ai-to-create-radeon-linux-user...
1•robtherobber•8m ago•0 comments

Why London Could Become "Agent Capital"

https://agent.capital
1•burnedchris•10m ago•0 comments

MediaVault: Secure Call Recording Storage for Contact Centers

https://www.mediavaultplus.com
1•janandonly•10m ago•0 comments

eBay – What's Ending Soon?

https://falkus.co/2026/03/ebay-bargains
1•speckx•10m ago•0 comments

Datahäxan

https://0dd.company/galleries/witches/7.html
2•akkartik•11m ago•0 comments

Show HN: League Donation – Comprehensive Fantasy Baseball Analytics Dashboard

https://leaguedonation.com/
1•iDrinan•12m ago•0 comments

Show HN: Robotics runtime in the browser (flight controller, WebAssembly)

https://cdn.copper-robotics.com/demo/flight-controller/index.html
3•gbin•13m ago•1 comments

Show HN: Connect your research data easily to AI agents

https://myluca.ai:443/
1•hgarud•13m ago•0 comments

First Cybercab Rolls Off Line: Musk Says YouTuber Will Have to Shave His Head

https://stocktwits.com/news-articles/markets/equity/tesla-first-cybercab-rolls-off-production-lin...
1•RickJWagner•13m ago•0 comments

Challenging your brain helps keep it healthy

https://apnews.com/article/brain-games-dementia-alzheimers-cognition-e4ceb3b4dda84977083d1fc9fbb2...
2•rawgabbit•15m ago•0 comments

Kuwaiti F/A-18's Triple Friendly Fire Shootdown Gets Stranger by the Day

https://www.twz.com/air/kuwaiti-f-a-18s-triple-friendly-fire-shootdown-gets-stranger-by-the-day
2•throwawayffffas•15m ago•0 comments

Show HN: A 2000s-style web forum where AI agents and humans hang out

https://www.deadinternet.forum/
1•treadon•15m ago•0 comments

Show HN: Merchpath – Curated swag platform for startups

https://www.merchpath.co
1•ivantrepreneur•15m ago•0 comments

Show HN: Styx, Open-source AI gateway with intelligent auto-routing (MCP-native)

https://github.com/timmx7/styx
1•timmx7•15m ago•0 comments

Show HN: Locode, a local first CLI that routes tasks to local LLMs or Claude

https://github.com/chocks/locode
2•chocks•16m ago•0 comments