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?

Show HN: Doom MCP – ChatGPT plays games incl. in Voice Mode

https://github.com/ionut85/doom-mcp-app
1•cionut•39s ago•0 comments

20Q for the Game Boy

https://github.com/TylerHartman/20Q-DMG
1•LaserDiscMan•1m ago•0 comments

Regulating, Fast and Slow

https://pluralistic.net/2026/12/04/quick-fixes/
1•hn_acker•1m ago•0 comments

AI Agents Enable Mass Profiling [pdf]

https://arxiv.org/abs/2612.02638
1•thunderbong•4m ago•0 comments

Show HN: Ace PQC Toolkit – A 30-min Migration Tool for Chrome's P-256 cutoff

https://github.com/acechain-io/ace-pqc-toolkit
1•jyeah•5m ago•0 comments

SuperTuxKart Online has gone dark

https://blog.supertuxkart.net/2026/10/supertuxkart-online-has-gone-dark.html
1•bariumbitmap•7m ago•1 comments

PURL and VERS in Practice

https://nesbitt.io/2026/12/03/purl-and-vers-in-practice.html
1•titusblair•7m ago•0 comments

NASA HyTEC: hybrid jet engine core tech predicted to cut fuel burn 6.23%

https://www.nasa.gov/general/first-portion-nasa-hybrid-jet-engine-project/
1•titusblair•7m ago•0 comments

BetterSPICE: An open-source circuit simulator that runs microcontroller code

https://github.com/arwidcool/BetterSPICE
1•titusblair•7m ago•0 comments

Show HN: AI News Daily – What shipped in AI today. Every morning, 6am Pacific

https://ai.bl0ggers.com
1•Panoramic3610•8m ago•0 comments

Ovobrowser: A free forever open-source antidetect browser

https://github.com/ovobrowsersupport/ovobrowser
1•ovobrowser•8m ago•0 comments

AI Wrapped: Your Year with Claude Code, Codex, Cursor and ChatGPT

https://orchestrahq.app/wrapped
1•eashvagish•8m ago•0 comments

Agentic Memory Is Not Recall, It Is Recovery

https://coralhub.dev/blog/agentic-memory-is-not-recall-it-is-recovery.html
1•cdknorow•9m ago•1 comments

OpenCode Go models by intelligence and tasks per month

https://tolstikh.github.io/opencode-go-pareto/
1•these•9m ago•1 comments

We should be talking more about biosecurity and AI

https://twitter.com/kesvelt/status/2100238200207716488
2•tectonic•10m ago•0 comments

Japan set to raise income requirements for 'Highly Skilled Professional' visa

https://www.japantimes.co.jp/news/2026/12/04/japan/society/foreign-professional-visa-tighten/
2•mikhael•11m ago•0 comments

Crypto Analysis Toolkit – So which crypto algorithms are you using?

https://github.com/snyk/agentic-cbom-toolkit/tree/main
1•lbeurerkellner•11m ago•0 comments

Show HN: QED Codex – index of human and AI informalizations of Lean proofs

https://qedcodex.org/
1•dial481•11m ago•0 comments

Todd's Breakdowns

https://www.andy-gallagher.com/blog/todd-edwards-breakdowns/
1•AirMax98•11m ago•0 comments

Arneb Distributed SQL Query Engine

https://arneb.io/
1•Bluestein•13m ago•0 comments

What kind of engineer is your coding agent?

https://www.withbeaker.ai/blog/comparing-reflection-agents
3•thomasinovic•13m ago•1 comments

ArXiv Blocks AI Survey Papers After 'Flood' of Trashy Submissions (2025)

https://decrypt.co/347196/arxiv-blocks-ai-generated-survey-papers-flood-trashy-submissions
1•Bluestein•14m ago•0 comments

Floppy Emu Reboot and Brainstorming

https://www.bigmessowires.com/2026/12/01/floppy-emu-reboot-and-brainstorming/
2•fortran77•15m ago•0 comments

Why Use Jakarta EE in 2027: The Technical Case

https://foojay.io/today/why-jakartaee-2027/
1•henk53•16m ago•0 comments

How to enable post-quantum cryptography and TLS termination with haproxy

https://www.haproxy.com/blog/how-to-enable-post-quantum-cryptography-and-tls-termination-with-hap...
1•pcthrowaway•16m ago•0 comments

Acute Effects of Fasting on Cognitive Performance: A Systematic Review

https://psycnet.apa.org/fulltext/2026-76741-001.html
4•bpierre•16m ago•0 comments

How Do Octopus and Squid Brains Get So Big?

https://www.nytimes.com/2026/12/03/science/octopus-big-brain-cephalopod.html
2•marojejian•16m ago•1 comments

Updated cipher suites for inbound TLS for Heroku apps

https://devcenter.heroku.com/changelog-items/3976
1•josephwegner•17m ago•0 comments

Is Testosterone Plummeting? In US Men, Levels Were Higher Than 10 Years Ago

https://www.iflscience.com/is-testosterone-plummeting-in-us-men-average-levels-were-slightly-high...
1•PaulHoule•18m ago•0 comments

The Merge

https://new.life.com/stories-details/neuralink-noland-arbaugh-cover-story
1•cobbzilla•21m ago•0 comments