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?

Warren Buffett, Dies at 96

https://www.reuters.com/legal/transactional/warren-buffett-investing-titan-who-appealed-masses-di...
1•tschibrillo•38s ago•0 comments

AI-driven hacking hits gov't websites: CBC's Andrew Nichols

https://www.cbc.ca/player/play/video/9.7443883
2•ClearwayLaw•1m ago•1 comments

Paiml/Depyler: Compiles Python to Rust, Transition Off Python to Rust Code

https://github.com/paiml/depyler
1•rbanffy•3m ago•0 comments

Kindle Modding Wiki

https://kindlemodding.org/
1•auraham•3m ago•0 comments

A Software Factory Plugin for Antigravity

https://www.joe-shirey.com/2026/12/01/software-factory-plugin-for-antigravity.html
1•richards•3m ago•0 comments

Ask HN: What made you give up on your last budgeting app?

1•compounding-err•3m ago•1 comments

Show HN: Sirius – Compact code intelligence for Rust and Go coding agents

https://github.com/Univeracity/sirius
1•ocdjeremy•3m ago•0 comments

How current are free economic data sites? A dated check of 50 indicators

https://statisticsoftheworld.com/benchmarks/economic-data-freshness
1•dregon03•4m ago•0 comments

Making cement in seconds just needs a big microwave oven

https://arstechnica.com/science/2026/12/making-cement-in-seconds-just-needs-a-really-big-microwave/
2•fanf2•4m ago•0 comments

Turn a jailbroken Kindle into a minimalist typewriter

https://github.com/ronibandini/Kindle-Typewriter
1•auraham•4m ago•0 comments

Nvidia Partners with SpaceX to Launch Datacenters into Space

https://www.nextplatform.com/compute/2026/12/02/nvidia-partners-with-spacex-to-launch-datacenters...
2•jonbaer•4m ago•0 comments

Beyond Bits: Analog Computing for Real-Time Control – Communications of the ACM

https://cacm.acm.org/research/beyond-bits-analog-computing-for-real-time-control/
1•rbanffy•5m ago•0 comments

Practice the Skill of Getting Absolutely Nowhere

https://psychotechnology.substack.com/p/practice-the-skill-of-getting-absolutely
1•eatitraw•5m ago•0 comments

CUDA-oxide v0.5.0 with provably safe GPU kernels using Lean 4 verification

https://github.com/NVIDIA/cuda-rust/releases/tag/cuda-oxide/v0.5.0
1•pjmlp•5m ago•0 comments

SSA from Bytecode: Imperative Pearl

https://bernsteinbear.com/blog/ssa-bytecode/
1•surprisetalk•6m ago•0 comments

Medieval Childen's Art

https://medievalmarginalia.substack.com/p/medieval-childens-art
1•Planktonne•7m ago•0 comments

SugarBun: Run JavaScript tools in a sandbox with explicit access grants

https://github.com/esconsulting-io/sugarbun
1•flyingsky•7m ago•0 comments

Show HN: A CLI to check and translate Chrome extension locales

https://github.com/Tigrandza/ext-localize
1•tigrandza•8m ago•0 comments

Ambiguous errors are the mind killer

https://amit.prasad.me/blog/ambiguous-errors
1•harperlee•8m ago•0 comments

Finance worker pays out $25M after video call with deepfake CFO (2024)

https://www.cnn.com/2024/02/04/asia/deepfake-cfo-scam-hong-kong-intl-hnk
1•deegles•8m ago•0 comments

From robots to reactors, MADSci is the engine powering tomorrows autonomous labs

https://phys.org/news/2026-12-robots-reactors-madsci-powering-tomorrow.html
1•gmays•9m ago•0 comments

Family trees are graphs. Why do we still draw them as trees?

https://orbyian.com/blog/a-family-tree-is-a-graph/
2•xerratus•10m ago•1 comments

Amazon Ergo 1.1T Architecture Notes

https://sebastianraschka.com/blog/2026/amazon-ergo-1-1t-architecture-notes.html
2•ModelForge•10m ago•0 comments

World-first discovery of 'useless' muscle could improve women's health

https://adelaide.edu.au/about/news/2026/world-first-discovery-of--useless--muscle-could-improve-w...
2•PaulHoule•10m ago•0 comments

Show HN: NextPart – ordered pages for multi-part Reels, TikToks and Shorts

https://nextpart.arsalandev.studio
1•arsalanarshadde•10m ago•0 comments

Show HN: Desktop app where my coding agents sort it out without me

https://github.com/novadeck-org/novadeck
1•mzpkdev•11m ago•0 comments

It's Not Just You: Hackathons Suck Now

https://therenegadecoder.com/teach/no-its-not-just-you-hackathons-suck-now/
2•speckx•11m ago•1 comments

Mathematics Inc., a private letter from its Chairman (EWD 539)

https://www.cs.utexas.edu/~EWD/transcriptions/EWD05xx/EWD539.html
1•RebelPotato•11m ago•0 comments

Show HN: Hermoso – Open-source AI marketing platform (ads, posting, email, MCP)

https://github.com/hermoso-ai/hermoso
2•adonatello18•11m ago•1 comments

Show HN: Open-source governance gateway for MCP tool servers

https://github.com/controlisai/recall-mcp-gateway
2•kiranpichika•12m ago•0 comments