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?

3D Printing Pneumatic Channels with Dual Materials for Soft Robots

https://hackaday.com/2026/02/13/3d-printing-pneumatic-channels-with-dual-materials-for-soft-robots/
1•HardwareLust•19s ago•0 comments

Moore and Mealy Model in System Verilog (2025)

https://medium.com/@jawadahmed2k3/moore-and-mealy-model-in-system-verilog-aba19be15b42
1•andsoitis•2m ago•0 comments

Show HN: Kai – A Telegram bot that turns Claude Code into a personal dev asst

https://github.com/dcellison/kai
1•dcellison•3m ago•0 comments

Atom – Hydrogen Quantum Orbital Visualizer

https://www.kavang.com/atom
1•samixg•5m ago•0 comments

Ask HN: What happens after the AI bubble bursts?

1•101008•6m ago•1 comments

The NotebookLM Tutorial

https://www.augmentedswe.com/p/notebooklm-tutorial
2•wordsaboutcode•7m ago•0 comments

The tiny corp – Nvidia is a Software Company

https://consensus-hongkong.coindesk.com/agenda/event/-open-source-ai-in-your-pocket-a-case-study-77
1•randomgermanguy•8m ago•0 comments

Twitter(X) Is Down

12•bakigul•8m ago•3 comments

Why "Skip the Code, Ship the Binary" Is a Category Error

https://engrlog.substack.com/p/why-skip-the-code-ship-the-binary
1•birdculture•9m ago•0 comments

Running My Own XMPP Server

https://blog.dmcc.io/journal/xmpp-turn-stun-coturn-prosody/
1•speckx•11m ago•0 comments

Show HN: Out Plane – Deploy any app in 60s with per-second pricing

https://outplane.com
1•receperdogan•12m ago•0 comments

Stages of Denial

https://nsl.com/papers/denial.html
2•tosh•14m ago•0 comments

The Break Is Over. Companies Are Jacking Up Prices Again

https://www.wsj.com/business/price-increases-consumers-businesses-b70e4542
3•belter•15m ago•1 comments

They're Made Out of Meat (1991)

https://www.mit.edu/people/dpolicar/writing/prose/text/thinkingMeat.html
1•erhuve•15m ago•0 comments

Show HN: 2d platformer game built with Codex (zero code)

3•armcat•16m ago•1 comments

The Promptware Kill Chain

https://www.schneier.com/blog/archives/2026/02/the-promptware-kill-chain.html
1•leephillips•17m ago•0 comments

Deterministic Core, Agentic Shell

https://blog.davemo.com/posts/2026-02-14-deterministic-core-agentic-shell.html
2•ingve•17m ago•0 comments

A DataFrame Library Which Runs on GPUs, Accelerators and More

https://github.com/ronfriedhaber/autark/blob/main/extra/notebooks/data_gov_ev_analysis_1.ipynb
1•ronfriedhaber•18m ago•0 comments

Ministry of Justice orders deletion of the UK's largest court reporting database

https://www.legalcheek.com/2026/02/ministry-of-justice-orders-deletion-of-the-uks-largest-court-r...
4•harel•20m ago•0 comments

2026 Barkley Marathon Results: No Finishers, Sébastien Raichon Completes Fun Run

https://www.irunfar.com/2026-barkley-marathon-results
2•lode•21m ago•0 comments

Developers speak out about bigotry on Steam

https://www.theguardian.com/games/2026/feb/16/bigotry-steam-pc-moderation-developers-speak-out
1•Archelaos•22m ago•0 comments

Show HN: A word game a friend and I built. How did we do?

https://www.subletters.fun/
3•fercircularbuf•24m ago•0 comments

Sourdine – open-source macOS app for meeting transcription with 100% local AI

https://angelo-lima.fr/en/sourdine-transcription-reunions-ia-locale-en/
1•llingelo•25m ago•1 comments

Show HN: Updated Maravel Micro-Framework and Maravelith Documentation Available

https://marius-ciclistu.medium.com/updated-maravel-micro-framework-and-maravelith-documentation-a...
1•marius-ciclistu•26m ago•0 comments

Show HN: SnkvDB – Single-header ACID KV store using SQLite's B-Tree engine

https://github.com/hash-anu/snkv
3•hashmakjsn•26m ago•1 comments

Traders Do Less Crime at Home (2023)

https://www.bloomberg.com/opinion/articles/2023-05-16/traders-do-less-crime-at-home
1•vismit2000•26m ago•0 comments

Leader Ladies Project

https://www.chicagofilmsociety.org/projects/leaderladies/
1•exvi•26m ago•0 comments

Leader Lady

https://www.sprocketschool.org/wiki/Leader_lady
1•exvi•26m ago•0 comments

China Girl (filmmaking)

https://en.wikipedia.org/wiki/China_Girl_(filmmaking)
1•exvi•27m ago•0 comments

Constant Sexual Aggression Drives Female Tortoises to Walk Off Cliffs

https://www.nytimes.com/2026/02/14/science/tortoises-island-sex-cliff.html
2•mistersquid•30m ago•0 comments