frontpage.
newsnewestaskshowjobs

Open Source @Github

fp.

Open in hackernews

Ask HN: How can I load test PostgreSQL but avoid changing actual data?

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

We're living through an explainer epidemic

https://www.dazeddigital.com/life-culture/article/70929/1/thoughtfluencers-hot-takes-tiny-mics-ex...
1•iamben•13s ago•0 comments

Don't Hit Publish If You Miss This Rule

https://canro91.github.io/2026/09/11/Publish/
1•speckx•1m ago•0 comments

India's payments regulator rolls tap to pay outside Visa and Mastercard networks

https://twitter.com/npci_npci/status/2098072369973825677
1•villgax•2m ago•0 comments

Computer Use Agents Are Excellent QA Engineers

https://tristanrhodes.com/blog/Computer-Use-Agents-are-Excellent-QA-Engineers
1•partypete•2m ago•0 comments

LG Denies Accusations of Smart TVs Continuously Recording Its Users

https://www.engadget.com/2256728/lg-denies-accusations-of-smart-tvs-continuously-recording-its-us...
1•speckx•5m ago•0 comments

Can A.I. "Go Rogue"?

https://www.newyorker.com/culture/open-questions/can-ai-go-rogue
1•saikatsg•6m ago•0 comments

Dario Just Said Pump the Brakes on AI

https://captaincompliance.com/education/dario-just-proposed-slowing-ai-development-on-purpose/
1•richartruddie•6m ago•1 comments

I just made a Git platform hosted on the blockchain

https://infinigit.com/
1•cd-4•6m ago•0 comments

Lind-project: Run untrusted POSIX applications, safely, in one process

https://lind-project.github.io/
1•ryuuseijin•8m ago•0 comments

Our First 30 Mins with the Steam Frame (Leak)

https://archive.org/details/our-first-30-mins-with-the-steam-frame-u-8-r-bnz-1-mpu
1•himata4113•9m ago•0 comments

Tolkien Gateway Encyclopedia Dedicated to JRR Tolkien

https://tolkiengateway.net/wiki/Tolkien_Gateway
1•Bluestein•10m ago•0 comments

Diablo V Teaser – The Return [video]

https://www.youtube.com/watch?v=GxCN_AKYtts
1•HelloUsername•10m ago•0 comments

Adversarial Examples Are Not Bugs, They Are Features (2019)

https://gradientscience.org/adv/
1•Bluestein•12m ago•0 comments

We Built Drone-Bench

https://twitter.com/andonlabs/status/2098832876288749604
1•pretext•12m ago•0 comments

Show HN: Spellfort – voice-controlled games for the edge of sleep

https://spellfort.gg/
1•gajus•12m ago•0 comments

Open Source GRC Platform

https://github.com/getprobo/probo
1•gearnode•13m ago•0 comments

An interactive atlas of middle earth

https://atlas.bag-end.eu/
1•benny_s•14m ago•0 comments

Caroline Ellison has joined Manifund

https://forum.effectivealtruism.org/posts/pMpEKwY2ATJK5yrvG/caroline-ellison-has-joined-manifund
3•qlte•14m ago•1 comments

AI Bubble Crashing Its Way into AI Abundance?

2•hmichaelson24•16m ago•1 comments

Starcraft – Announce Cinematic – Dominion [video]

https://www.youtube.com/watch?v=9eQUtOQXYgQ
1•HelloUsername•16m ago•1 comments

Show HN: Stackray – Detect any website's tech stack

https://stackray.app
2•seelos•18m ago•0 comments

What the iPhone Neural Engine Does and Why It Matters

https://campaignmanagement.copcap.com/journal/what-the-iphone-neural-engine-does-and-why-it-matte...
1•alwillis•18m ago•0 comments

Show HN: Ember – a strategy game where everyone moves at once

https://playember.gg/
2•sundaypancakes•23m ago•0 comments

'We must slow the pace': CEO of Anthropic calls for an AI slowdown

https://www.theguardian.com/technology/2026/sep/12/we-must-slow-the-pace-ceo-of-anthropic-calls-f...
6•tzmlab•24m ago•1 comments

Scaling classical music concert crawlers with AI agents

https://classicalbot.com/blog/scaling-classical-music-concert-crawlers-with-ai-agents
1•druskacik•26m ago•0 comments

Anthropic CEO Says It's Time to Slow AI Model Advances

https://www.bloomberg.com/news/articles/2026-09-12/anthropic-ceo-says-it-s-time-to-slow-pace-of-i...
6•sbulaev•26m ago•1 comments

Trade war puts spotlight on Canada's relationship with U.S. big tech

https://www.cbc.ca/radio/justasking/canada-digital-sovereignty-just-asking-9.7337778
1•Teever•26m ago•0 comments

Show HN: Wlmoves - Move nested Wayland windows between TTYs automatically

https://github.com/skorotkiewicz/wlmoves
1•modinfo•27m ago•0 comments

From Neural Networks to Logical Theories

https://arxiv.org/abs/2509.23912
1•measurablefunc•28m ago•0 comments

Digital Research's GEM opens a new window on Linux

https://www.theregister.com/software/2026/09/11/digital-researchs-gem-opens-a-new-window-on-linux...
1•rbanffy•30m ago•0 comments