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•7mo 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•7mo 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•7mo 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•7mo 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•7mo ago
Load test against a clone instead of a DB whose contents you care about?

US sanctions former EU commissioner over efforts to curb online hate speech

https://www.politico.eu/article/us-sanctions-former-eu-commissioner-thierry-breton-for-curbing-on...
1•pieterr•1m ago•0 comments

The Reddit API Is Dead for Indie Devs

https://yuangwei.medium.com/the-reddit-api-is-dead-for-indie-devs-heres-how-to-bypass-it-in-n8n-5...
1•yuangwei•1m ago•0 comments

Zelensky reveals full 20-point peace plan draft backed by Ukraine, US

https://kyivindependent.com/zelensky-reveals-20-point-peace-plan-draft-backed-by-ukraine-us/
1•_tk_•7m ago•0 comments

Renault concept goes 626 miles on single charge at motorway speed

https://www.autocar.co.uk/car-news/new-cars/renault-concept-goes-626-miles-charge-motorway-speed
2•teleforce•11m ago•0 comments

ChatGPT's CSS may hide model info (clip-path, opacity:0, user-select:none) [pdf]

https://aya-peppers.github.io/chatgpt-css-transparency-analysis/report.pdf
1•Ayanonymous•12m ago•1 comments

We discovered an ancient 'party boat' in the waters of Alexandria

https://theconversation.com/we-discovered-an-ancient-party-boat-in-the-waters-of-alexandria-heres...
1•zeristor•14m ago•1 comments

FreeBSD: Installation on a ThinkPad X200 Tablet in 2025

https://rtfm.co.ua/en/freebsd-installation-on-a-thinkpad-x200-tablet-in-2025/
1•todsacerdoti•15m ago•0 comments

Popular Education AI Prompts for Teaching Excellence Education

https://tools.eq4c.com/ai-prompts/9-popular-education-ai-prompts-for-teaching-excellence-education/
1•edures•15m ago•1 comments

Migrating my web analytics from Matomo to Umami

https://stanislas.blog/2025/12/migrating-matomo-to-umami-web-analytics/
2•angristan•16m ago•0 comments

Show HN: WatchLLM – Semantic caching to cut LLM API costs by 70%

https://www.watchllm.dev/
1•Kaadz•17m ago•0 comments

SHow HN: Prompt-RAG – Fix low-quality AI images using a 500 prompt vector DB

https://picxstudio.com
1•Yash16•17m ago•1 comments

2025: The Year SwiftUI Died

https://blog.jacobstechtavern.com/p/the-year-swiftui-died
2•jakey_bakey•17m ago•0 comments

The Most Cursed Web Development Stack You'd Ever See Before Christmas [video]

https://www.youtube.com/watch?v=dGAZMQrVW9s
1•kasumispencer2•18m ago•0 comments

Accelerating complex Python models by 300x+ – using Claude.ai [video]

https://www.youtube.com/watch?v=-Drgu1g__lE
2•NatalijaAAD•18m ago•0 comments

Why Does Nuclear Power Plant Construction Cost So Much? (2023)

https://ifp.org/nuclear-power-plant-construction-costs/
1•elashri•18m ago•0 comments

Show HN: BunPush, Modern Realtime pusher compatible built on Bun

https://bunpush.com
1•sawirricardo•19m ago•0 comments

Show HN: I created a free pdf to quiz maker tool

https://minform.io/tools/pdf-to-quiz-maker
1•eashish93•20m ago•0 comments

The Age of the All-Access AI Agent Is Here

https://www.wired.com/story/expired-tired-wired-all-access-ai-agents/
1•fleahunter•21m ago•0 comments

Live Streaming Agent Framework development from scratch in Go

https://www.youtube.com/channel/UCCntuFAgDVUjBG-ZQEv_wrQ
1•praveensanap•21m ago•1 comments

Dear ACM, you're doing AI wrong but you can still get it right

https://anil.recoil.org/notes/acm-ai-recs
1•birdculture•22m ago•0 comments

The Chicago Manual of Style

https://www.chicagomanualofstyle.org/home.html
1•thinkingemote•23m ago•0 comments

SFP Wizard a pocket-sized powerhouse that checks the health of any SFP or QSFP

https://blog.ui.com/article/welcome-to-sfp-liberation-day?from=/article/travel-in-style-unifi-sty...
1•janandonly•25m ago•1 comments

Show HN: Sensei, documentation agent for coding agents

https://sensei.eightzerothree.co
1•alizainf•25m ago•0 comments

WD-NearbyItem: browse Wikidata Items nearby

https://rtnf.substack.com/p/wd-nearbyitem
1•altilunium•26m ago•0 comments

Katchy – capturing tasks and reminders just by speaking

https://www.katchy.app/
1•bitvaulty•27m ago•1 comments

Tell HN: Merry Christmas

2•franze•27m ago•1 comments

Two British anti-hate speech campaigners sanctioned by US State Department

https://www.theguardian.com/politics/live/2025/dec/24/free-speech-tech-us-relations-ed-davey-keir...
2•ndsipa_pomu•27m ago•0 comments

Show HN: Semantic Coverage – A tool to visualize RAG blind spots using UMAP

https://github.com/aashirpersonal/semantic-coverage
2•aashirpersonal•32m ago•1 comments

The Windows Utility

https://christitus.com/windows-tool/
18•janandonly•37m ago•8 comments

Choosing a database for crypto on-chain analytics, think outside of PostgreSQL

https://www.velodb.io/blog/from-postgresql-to-velodb-real-time-on-chain-analytics-for-web3-and-cr...
1•qinchencq•37m ago•0 comments