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?

Amtrak's Largest Train Revamp in 55 Years Is Coming Soon

https://www.nytimes.com/2026/02/13/travel/amtrak-new-train-airo.html
1•Vermin2000•20s ago•0 comments

Hare 0.26.0 Released

https://harelang.org/blog/2026-02-13-hare-0.26.0-released/
1•todsacerdoti•26s ago•0 comments

Kagi Translate Arrives on Mobile

https://blog.kagi.com/kagi-translate-mobile
1•fermuch•1m ago•1 comments

Show HN: ToMusic – Turn text prompts into original songs with AI (iOS)

https://apps.apple.com/us/app/song-maker-tomusic/id6757370829
1•demirdev•3m ago•0 comments

Co-Routines in 1-page of C (2013)

https://www.embeddedrelated.com/showarticle/455.php
1•pvtmert•3m ago•1 comments

Sheaves Ready to Play a Bigger Role in Linux 7.0

https://www.phoronix.com/news/Linux-7.0-Slab-Sheaves
1•doener•3m ago•0 comments

The chemical habitability of Earth and rocky planets

https://www.nature.com/articles/s41550-026-02775-z
1•doener•5m ago•0 comments

Show HN: Reclaimr – An offline crossplatform desktop app for cleaning dev caches

https://reclaimr.dev/
1•deevus•5m ago•0 comments

Mad Money and the Big AI Race

https://om.co/2026/02/13/mad-money-the-big-ai-race/
1•headalgorithm•8m ago•0 comments

Memories: Doing my PhD at Stanford, under John L Hennessy

https://lawrencecpaulson.github.io//2026/02/13/John_Hennessy.html
1•chmaynard•9m ago•0 comments

Respectful Open Source

https://nesbitt.io/2026/02/13/respectful-open-source.html
1•chmaynard•10m ago•0 comments

Horus: A Protocol For Trustless Verification Under Uncertainty

https://arxiv.org/abs/2507.00631
1•optimalsolver•12m ago•0 comments

If you use AI-generated code, you currently cannot claim copyright on it in the

https://zomglol.wtf/@jamie/116059523957674208
2•todsacerdoti•12m ago•0 comments

El Paso Laser Weapon Targeted Suspected Drones. It Hit Party Balloons Instead

https://www.wsj.com/politics/national-security/a-laser-weapon-targeted-suspected-drones-it-hit-pa...
1•tylervigen•13m ago•0 comments

Show HN: OmniQL – One Query Language for PostgreSQL, MySQL, MongoDB, and Redis

https://www.omniql.com/
1•canu21•13m ago•0 comments

Advent of Code in Forth [video]

https://www.youtube.com/watch?v=jAFz8Maxvr4
1•tosh•13m ago•0 comments

Alternatives to Amazon, and who has stopped using it entirely?

https://www.bogleheads.org/forum/viewtopic.php?p=8669486#p8669486
2•ilamont•15m ago•0 comments

Visual Introduction to PyTorch

https://0byte.io/articles/pytorch_introduction.html
1•0bytematt•16m ago•0 comments

Show HN: Native macOS GUI for HelixDB graph database

https://nodfans.github.io/helixdb-explorer/
1•jomamax•16m ago•0 comments

Time <b>is</b> Different

https://sifter.org/~simon/journal/20260212.html
1•speckx•19m ago•0 comments

Agents crashes out on OSS and writes a blog

1•invarrow•20m ago•2 comments

Our AI Orchestration Frameworks Are Reinventing Linda (1985)

https://otavio.cat/posts/ai-orchestration-reinventing-linda/
1•otavioc•22m ago•0 comments

Show HN: AgenQA – Turn natural language into E2E web app tests using AI

https://www.agenqa.com
1•aldovincenti•22m ago•0 comments

Show HN: Scraped 100 FAANG DevOps Interview Questions

https://github.com/devops-interviews/devops-interviews
1•amuradov•22m ago•0 comments

Show HN: Built it to flex my Medium stats, came out to be a writing habit tool

https://mymedium.info
1•nishujain•22m ago•3 comments

Learning to Reason in 13 Parameters

https://arxiv.org/abs/2602.04118
1•stared•23m ago•0 comments

Show HN: Dreamvibe – AI dream journal that maps dreams to 17 brain regions

https://www.dreamvibehq.com/
1•jdiamond_•24m ago•0 comments

Ditching the Debug Probe: Using a Segger J-Link with a Raspberry Pi Pico

https://linuxjedi.co.uk/ditching-the-debug-probe-using-a-segger-j-link-with-a-raspberry-pi-pico/
1•speckx•24m ago•0 comments

Two OpenClaw Agents Became My Overnight Pair Programming Team

https://twitter.com/luigiagosti/status/2022291920454639698
2•tengio•26m ago•0 comments

Rails CoC Skill

https://github.com/vickyonit/rails-coc
1•vickyonit•28m ago•1 comments