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

New fibre optic data transmission speed record of 450Tbps

https://www.ucl.ac.uk/news/2026/apr/new-fibre-optic-data-transmission-speed-record
1•giuliomagnifico•22s ago•0 comments

Private Files on a Static, Open-Source Website

https://hnlyman.github.io/pages/private_files.html
1•hnlyman•1m ago•0 comments

Gas Town from Clown Show to v1.0

https://steve-yegge.medium.com/gas-town-from-clown-show-to-v1-0-c239d9a407ec
1•yodon•1m ago•0 comments

Microbial upcycling of plastic waste to levodopa

https://www.nature.com/articles/s41893-026-01785-z
1•PaulHoule•1m ago•0 comments

Show HN: Lumina – a statically typed web-native language for JavaScript and WASM

https://github.com/nyigoro/lumina-lang
1•light_ideas•2m ago•0 comments

Disclosing bluehammer exploit, vulnerability is still unpatched

https://deadeclipse666.blogspot.com/2026/04/public-disclosure.html
2•Alifatisk•3m ago•0 comments

I Tried Vibing an RSS Reader and My Dreams Did Not Come True

https://blog.jim-nielsen.com/2026/vibe-dreams-didnt-come-true/
2•herbertl•4m ago•0 comments

What Being Ripped Off Taught Me

https://belief.horse/notes/what-being-ripped-off-taught-me/
6•doctorhandshake•6m ago•0 comments

Token-Aware LLM Load Balancer route by inflight tokens,not connections

https://github.com/SivagurunathanV/token-aware-balancer
1•sivagurunathanv•7m ago•0 comments

A real-world case of property-based verification

https://ochagavia.nl/blog/a-real-world-case-of-property-based-verification/
1•wofo•7m ago•0 comments

Panther Lake is the real deal

https://world.hey.com/dhh/panther-lake-is-the-real-deal-4bd731f1
1•0xedb•8m ago•0 comments

Show HN: I built a 2-min quiz that shows you how bad you are at estimating

https://www.convexly.app/
2•convexly•10m ago•0 comments

Baidu Silent About Failure of 100 Robotaxis in Wuhan

https://www.forbes.com/sites/bradtempleton/2026/04/05/baidu-silent-about-failure-of-100-robotaxis...
1•mhb•10m ago•0 comments

When the Push Button Was New, People Were Freaked (2021)

https://daily.jstor.org/when-the-push-button-was-new-people-were-freaked/
1•thunderbong•12m ago•0 comments

Nanonets OCR-3: A multimodal OCR model with bounding boxes & confidence scores

https://nanonets.com/research/nanonets-ocr-3
1•vitaelabitur•13m ago•0 comments

Muon and MuonClip Optimizers

https://chizkidd.github.io//2026/04/04/muon-muonclip/
1•ibobev•13m ago•0 comments

Rational Matrix Iterations for Polar Decomposition

https://jiha-kim.github.io/posts/rational-polar-decomposition/
2•ibobev•14m ago•0 comments

» the Mystery of Rennes-Le-Château, Part 3: A Secret History

https://www.filfre.net/2026/04/the-mystery-of-rennes-le-chateau-part-3-a-secret-history/
1•ibobev•14m ago•0 comments

NameWheel – Free wheel spinner with no ads, no signup, no tracking

https://namewheel.org/
1•alshanty•17m ago•0 comments

Structural color can now be printed with an inkjet printer

https://www.kobe-u.ac.jp/en/news/article/20260406-67657/
3•geox•18m ago•0 comments

Show HN: Ec – terminal native 3-way Git mergetool

https://github.com/chojs23/ec
6•neozz•19m ago•0 comments

Uber: Why Our Sense of Convenience Comes Always at the Expense of Others

https://medium.com/@Katja_Diehl/uber-bolt-co-4f64b2812ed8
4•doener•19m ago•0 comments

Real-time poker engine with emotion-driven AI bots

https://oxyklon.net/portal
4•naydref•20m ago•0 comments

New Chrome Extension lets you see what LLMs you can run on your hardware

https://chromewebstore.google.com/detail/run-this-llm/dginneocahmfpflnpcigakjggipmfhhg
2•eeko_systems•22m ago•1 comments

Show HN: I turned ARC-AGI-3 into a daily browser game

https://arcaptcha.io/
2•preyneyv•23m ago•0 comments

Software Engineering Is Becoming Civil Engineering

https://christophermeiklejohn.com/ai/engineering/2026/04/01/software-engineering-is-becoming-civi...
3•mooreds•23m ago•0 comments

NASA Elements of Engineering Excellence

https://vickiboykis.com/2026/04/05/nasa-elements-of-engineering-excellence/
1•mooreds•24m ago•0 comments

OpenSim – Open-Source Flight Simulation Engine

https://ghtomcat.github.io/opensim/
1•carlos-menezes•24m ago•0 comments

Was Trump oblivious to the realities of Netanyahu's promised 'easy' war on Iran?

https://www.theguardian.com/world/2026/apr/06/trump-iran-war-netanyahu-israel
6•hebelehubele•25m ago•2 comments

Show HN: I made a crossword app for language learners

https://cranki.app/
5•petargyurov•29m ago•0 comments