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

Beneath the Surface

https://press.stripe.com/beneath-the-surface
1•tosh•53s ago•0 comments

Show HN: Unfold – A paper folding puzzle game with worldwide rankings

https://www.dailyunfold.com/
1•astralasia•1m ago•0 comments

Richard Hamming: You and Your Research (1986)

https://paulgraham.com/hamming.html
1•tosh•3m ago•0 comments

OpenClaw vs. Hermes Agent: The race to build AI assistants that never forget

https://thenewstack.io/persistent-ai-agents-compared/
1•thunderbong•9m ago•0 comments

Palimpsest

https://en.wikipedia.org/wiki/Palimpsest
1•tosh•9m ago•0 comments

A catastrophic climate event is upon us. Here is why you've heard so little

https://www.theguardian.com/commentisfree/2026/apr/23/catastrophic-climate-event-scientists-atlan...
1•Michelangelo11•9m ago•0 comments

Residual Malicious Payloads on HackerOne After Vulnerability Fixes

https://hackerone.com/reports/3168691
1•nathan84•16m ago•0 comments

Show HN: NoonFlow – a macOS workspace I built for Claude Code and Codex

https://github.com/heyallencao/NoonFlow/releases
1•AllenCao•17m ago•5 comments

Political Discontent in China Is Associated with Isolating Personality Traits

https://www.journals.uchicago.edu/doi/abs/10.1086/719273
1•xnhbx•20m ago•0 comments

Apple's New CEO Must Launch 5 Product Ecosystems or Miss the Next iPhone Moment

https://greentic-ai.medium.com/apples-next-ceo-must-launch-these-5-product-ecosystems-or-miss-the...
1•mectors•20m ago•0 comments

Show HN: Playing music over movies causes them to sync

1•e1ghtSpace•20m ago•0 comments

Colorado citizens pay with rights, xAI pays nothing, long live democracy

https://aitwerp.com/signals/xai-colorado-discrimination-federal/
1•Inziu•26m ago•1 comments

Hire based on the conversation about code, not the code itself

https://dbarabashh.com/thoughts-and-experience/hire-for-the-conversation-not-the-code
1•birdculture•31m ago•0 comments

LogAct: Enabling agentic reliability via shared logs

https://arxiv.org/abs/2604.07988
1•pramodbiligiri•39m ago•0 comments

Show HN: A faithful offline recreation of the classic MS-DOS Editor

https://pascar.run
2•mysticmode•56m ago•0 comments

Managing the Unmanaged Switch

https://watchmysys.com/blog/2026/03/managing-the-unmanaged-switch/
2•luu•58m ago•0 comments

Show HN: I fixed sleep schedule by tracking solar time, so I built an app for it

https://sun.mikolajmocek.com/
1•mondonno•1h ago•0 comments

Richard Sutton – Father of RL thinks LLMs are a dead end [video]

https://www.youtube.com/watch?v=21EYKqUsPfg
3•mpweiher•1h ago•1 comments

Scaling Camera File Processing at Netflix

https://netflixtechblog.com/scaling-camera-file-processing-at-netflix-6dab2b1e80be
2•redblueflame•1h ago•0 comments

Show HN: Agent MCP Studio – build multi-agent MCP systems in a browser tab

https://www.agentmcp.studio
3•stealthtsdb•1h ago•0 comments

Testing GPT-5.5 in early access: what we are seeing so far

https://lovable.dev/blog/gpt-5-5-now-in-lovable
2•doener•1h ago•1 comments

Escrow Security for iCloud Keychain

https://support.apple.com/guide/security/escrow-security-for-icloud-keychain-sec3e341e75d/web
2•gurjeet•1h ago•0 comments

Tewart Brand on LSD, A.I. Black Boxes and the Beauty of Care [video]

https://www.youtube.com/watch?v=t8u24wvHeSE
1•born-jre•1h ago•0 comments

Code review advice for vibe coders

https://xata.io/blog/code-review-for-vibe-coders
2•tee-es-gee•1h ago•0 comments

Show HN: A CLI to use any model in your coding agent

https://getaivo.dev/
2•spirit23•1h ago•1 comments

What is Nostr? A simple guide to the protocol

https://usenostr.org/
3•vlugorilla•1h ago•0 comments

The Tiny Donut That Proved We Still Don't Understand Magnetism [video]

https://www.youtube.com/watch?v=XKSjCOKDtpk
2•mpweiher•1h ago•0 comments

List of personal sites that host Wander console, a tool to explore the small web

https://susam.codeberg.page/wander/wcn.html
2•susam•1h ago•0 comments

Naming Things Is Easy Now

https://notesbylex.com/naming-things-is-easy-now
3•lexandstuff•1h ago•0 comments

I left Vercel Pro ($20/mo) for a $10/mo VPS. 7-day Next.js migration report

https://gist.github.com/Samarth0211/b728534af45242b61b45a87a4ecdf155
1•samarth0211•1h ago•1 comments