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•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?

I Eavesdrop on Frog Conversations

https://www.nature.com/articles/d41586-026-01621-6
1•Brajeshwar•55s ago•0 comments

Icon Network shuts down on December 31, 2026

https://www.icon.foundation/blog/2026/final-date-set-for-sodax-migration-icon-network-to-shut-dow...
1•matonias•1m ago•1 comments

Lessons I Learned from Creating Searx

https://hister.org/posts/lessons-i-learned-from-creating-searx
2•theanonymousone•2m ago•0 comments

I was likely targeted by DPRK in a sophisticated developer malware campaign

https://blog.denv.it/posts/i-was-likely-targeted-by-dprk-in-a-sophisticated-developer-malware-cam...
1•denysvitali•2m ago•0 comments

Is AI flattening your team's creativity?

https://www.atlassian.com/blog/ai-at-work/is-ai-flattening-your-teams-creativity-heres-how-to-tell
1•ilalex•3m ago•0 comments

Show HN: Feynman AI research Assistant plugin for Obsidian

https://community.obsidian.md/plugins/feynman-research-agent
1•arogers17•5m ago•0 comments

Show HN: SynapCores – AI-native database (vector, graph, SQL, AutoML, LLM)

https://synapcores.com
1•SQLv2•8m ago•0 comments

Dimensions of the Geiger-Muller Tube Holder on the GGreg20_V3 Geiger Counter PCB

https://iot-devices.com.ua/en/ggreg20-v3-j305-tube-mounting-dimensions/
1•iotdevicesdev•8m ago•0 comments

Show HN: Complete Family Tree Viewer

https://github.com/erikshelley/complete-family-tree-viewer
2•shellerik•9m ago•0 comments

Persistent multiplayer state without chaos

https://packagemain.tech/p/persistent-multiplayer-state-without
1•der_gopher•12m ago•0 comments

Free Quick Developer Online Tools

https://quickfix.tools/developer/
1•mlongo•14m ago•1 comments

Founder of 7/11 Japan, Toshifumi Suzuki, has died at age 93

https://www.referenceforbusiness.com/biography/S-Z/Suzuki-Toshifumi-1932.html
3•L_Rahman•16m ago•1 comments

How the engineer behind Claude Cowork uses Claude

https://www.lennysnewsletter.com/p/how-i-ai-how-the-engineer-behind
1•simonebrunozzi•16m ago•1 comments

Evaluating Large Language Models in a Complex Hidden Role Game

https://arxiv.org/abs/2605.22826
1•Brajeshwar•17m ago•0 comments

Ask HN: How are you managing cloud cost?

https://getnable.com/
1•chaandannn•20m ago•0 comments

David Blackwells Enduring Legacy

https://simons.berkeley.edu/news/david-blackwells-enduring-legacy
1•nothrowaways•20m ago•0 comments

Nordtheme/Nord: An Arctic, north-bluish color palette

https://github.com/nordtheme/nord
1•ankitg12•20m ago•0 comments

Show HN: AutoMaxFix – controlled AI repair loop that won't eat your migrations

https://github.com/Noumenon-ai/AutoMaxFix
1•Noumenon_AI•21m ago•0 comments

I'm the CEO of Goldman Sachs. The AI Job Apocalypse Is Overblown

https://www.nytimes.com/2026/05/22/opinion/ai-job-crisis-goldman-sachs.html
7•ent101•22m ago•1 comments

After automation: what if the work of tasking LLMs stays?

https://every.to/p/after-automation
1•ersiees•22m ago•0 comments

Local USA Small Business AEO / Geo / SEO

https://localpicks.ai
2•lior_mechlovich•24m ago•1 comments

Show HN: Plonk – Spotlight Search style Python interpreter

https://github.com/JosephRedfern/plonk
1•JosephRedfern•27m ago•0 comments

Possession (1981 Film)

https://en.wikipedia.org/wiki/Possession_(1981_film)
3•mooreds•28m ago•0 comments

Modern passport systems leave little room for bureaucratic heroism

https://reason.com/2026/05/20/the-modern-passport-has-eliminated-fraud-forgery-and-heroes-who-can...
2•leephillips•28m ago•0 comments

Blind Waymo Users Revel in the Joy of Riding Alone

https://www.nytimes.com/2026/05/24/us/waymo-robot-taxis-blind.html
1•bookofjoe•29m ago•1 comments

Ask HN: Who uses Aurora Store here?

2•g-b-r•29m ago•1 comments

So, Where Does Next-Token Prediction Leave Us?

https://pop.rdi.sh/where-does-next-token-prediction-leave-us/
2•0x5FC3•31m ago•0 comments

Pope Leo XIV's Magnifica Humanitas, Markdown Version

https://github.com/cucho/magnifica-humanitas/blob/master/markdown/en.md
3•cucho•33m ago•0 comments

Show HN: Open Satchel – local-first PDF editor (early)

https://opensatchel.dev/
1•jqmccleary•33m ago•0 comments

Show HN: Hackobar – One feed for AI news

https://hackobar.com/
4•rahu_•33m ago•1 comments