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?

I reverse-engineered AutoCAD's 3D format to convert DWG to STEP with Claude

https://cadyon.com/
1•petarcrncec•36s ago•1 comments

Better Questions. Better Decisions. Papa Jev's

https://mdelcaro.substack.com/p/better-questions-better-decisions
1•fathermarz•1m ago•0 comments

Looks promising for document editing with your agent

https://www.paperinstruments.com/blog/introducing-paper-office
1•nvmdbljstm•1m ago•0 comments

How the cocktail got its name

https://www.saveur.com/how-the-cocktail-got-its-name/
1•ta988•4m ago•0 comments

My Report on Time Travel Fictions

https://www.royalroad.com/fiction/103797/the-journals-of-noiruzi-sangsung/chapter/2027209/my-repo...
1•bryanrasmussen•7m ago•0 comments

Arturia KeyStep 37 firmware research project

https://github.com/rndpatch/keystep37-research
1•PsyDebug•7m ago•0 comments

AI has no intent and no motivation

https://www.i-programmer.info/news/245-view-point/19164-ai-has-no-motivation.html
1•aquastorm•8m ago•0 comments

Cutting the 'coordination tax': How agentic AI can reshape workflows

https://www.mckinsey.com/industries/industrials/our-insights/cutting-the-coordination-tax-how-age...
1•bob1029•9m ago•0 comments

Search – A small, fast WebKit browser for macOS, by Office Commun

https://github.com/driceroland/Search
1•metrofun•9m ago•0 comments

Microbial network could drive methane production in the seafloor

https://www.sdu.dk/en/om-sdu/fakulteterne/naturvidenskab/nyheder-2026/conductive-bacteria
1•bryanrasmussen•11m ago•0 comments

Scaleup Europe Fund – new, multi-billion late-stage and growth fund

https://eic.ec.europa.eu/eic-fund/scaleup-europe-fund_en
3•TechTechTech•18m ago•0 comments

Agents: The New, New Kingmakers

https://redmonk.com/sogrady/2026/09/16/new-new-kingmakers/
2•rmoff•18m ago•0 comments

AssBench is all You need to benchmark LLM Harness Intelligence /s

https://grigio.org/assbench-is-all-you-need-to-benchmark-llm-harness-intelligence-s/
1•grigio•19m ago•0 comments

YouTube introduces A/B testing for videos

https://blog.youtube/news-and-events/innovation-youtube-era-made-on-viewers-creators/
3•rbits•20m ago•0 comments

Proposed bill to ban artificial superintelligence and create Department of AI

https://apnews.com/article/ai-superintelligence-bernie-sanders-d6a6a2cd8e71d7c95bdc394595aa85d1
3•msaltz•22m ago•1 comments

Anthropic CEO Amodei Warns UN Security Council on AI Risks

https://www.youtube.com/watch?v=u-u8gOgNA9o
3•Betelbuddy•25m ago•0 comments

Show HN: Trader News – Hacker News for Finance

2•FailMore•26m ago•1 comments

Meta deletes this satirical video about its smart glasses from Instagram

https://www.youtube.com/watch?v=dHKhYL3is5o
4•HelloUsername•27m ago•0 comments

Show HN: Wl-pick – a live window picker for Sway

https://mil.ad/blog/2026/wl-pick.html
2•playnext•36m ago•0 comments

New facial recognition store checkout system piloted by Revolut

https://www.independent.co.uk/news/uk/home-news/revolut-facial-recognition-system-london-b3055475...
1•thm•38m ago•0 comments

Parsing JSON Objects Without Intermediate ASTs in Haskell

https://arthi-chaud.github.io/posts/json-ir/
2•fanf2•39m ago•0 comments

iOS 27 Trust Insights API [video]

https://developer.apple.com/videos/play/wwdc2026/379/
1•bfm•42m ago•1 comments

Don't we require emotions for doing research?

1•tesnorindian•42m ago•0 comments

The Lost Atomic Update on Loongson CPU

https://jia.je/hardware/2026/09/24/loongson-cpu-erratum-en/
1•jiegec•44m ago•0 comments

Kerberized MCP Server with Delegation

https://github.com/overpassconnect/mcp-krb-server
2•overpassconnect•45m ago•0 comments

We ported the original Doom to SQL

https://cedardb.com/blog/sqldoom/
2•kciter•52m ago•0 comments

Bring Back the Nokia Lifestyle

https://nokiaretrophone.mr-ahhk1412.chatgpt.site/
2•ahhk•55m ago•0 comments

Meta takes down a critical video about meta AI Glasses after filming at Meta

https://www.reddit.com/r/facebook/comments/1wotwrk/meta_takes_down_a_critical_video_about_meta_ai/
68•pieterr•58m ago•24 comments

Show HN: ListenIn – Mac dictation tuned for mixed Chinese-English speech

https://listenin.dev/
1•nomorefish•59m ago•0 comments

Show HN: Muro: Free Native Live Wallpapers for macOS

https://murowallpaper.com
2•rockyxsl•1h ago•0 comments