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?

Subtyping, Subclassing, and Trouble with OOP

https://okmij.org/ftp/Computation/Subtyping/
1•signa11•3m ago•0 comments

Malicious Packages Don't Fit the Vulnerability Intelligence Model

https://www.first.org/blog/20260420-Malicious-Packages-Dont-Fit
1•jruohonen•4m ago•0 comments

An information operating system powered by local files

https://galaxybrain.com
1•marcinignac•4m ago•1 comments

Foundations of Computer Science: C edition (1994) [pdf]

https://blough.ece.gatech.edu/3020/focs.pdf
1•nill0•5m ago•0 comments

Social media content creator boost

https://www.qten.ai/
1•bandishankar•5m ago•1 comments

Aiguard-scan – Find secrets and vulnerabilities in AI-generated code

https://github.com/Hephaestus-byte/agent-guard
1•Hephaestus-byte•10m ago•0 comments

Making the most pickproof lock yet [video]

https://www.youtube.com/watch?v=-qUu8kIliy8
1•zdw•13m ago•0 comments

The Beauty of Bonsai Styles

https://longwoodgardens.org/blog/2023-05-17/beauty-bonsai-styles
3•lagniappe•22m ago•0 comments

SSA without Dominance for Higher-Order Programs

https://arxiv.org/abs/2604.09961
1•matt_d•25m ago•0 comments

Show HN: Kachilu Browser – a local browser automation CLI for AI agents

https://github.com/kachilu-inc/kachilu-browser
1•tmatsuzaki•37m ago•3 comments

A Roblox cheat and one AI tool brought down Vercel's platform

https://webmatrices.com/post/how-a-roblox-cheat-and-one-ai-tool-brought-down-vercel-s-entire-plat...
10•bishwasbh•42m ago•0 comments

Advancing BDD Software Testing: Dynamic Scenario Re-Usability and Step Auto-Comp

https://arxiv.org/abs/2402.15928
2•alihassaanmug•49m ago•0 comments

Show HN: A fake small claims court for petty complaints

https://benlirio.com/petty-small-claims/
1•blirio•50m ago•0 comments

Spotting Specification Gaps with Small Proof-Oriented Tests

https://risemsr.github.io/blog/2026-04-16-spotting-specs/
3•matt_d•51m ago•0 comments

Ancient Mughal tradition of pigeon-rearing thrives in India's capital

https://www.reuters.com/world/india/ancient-mughal-tradition-pigeon-rearing-thrives-indias-capita...
1•petethomas•51m ago•0 comments

"Capital Punishment" Trivia Game

https://games-by-will.com/capital-punishment/
2•wjuseck•53m ago•0 comments

Is AI a Bubble

1•Robelkidin•53m ago•2 comments

Sonnet 4.6 model could mistakenly use wrong model for OpenAI

https://github.com/anthropics/claude-code/issues/51417
1•keytalker•54m ago•0 comments

What Is Multi-Cloud Security? Challenges and Best Practices

https://spacelift.io/blog/multi-cloud-security
1•kat-w•55m ago•0 comments

Mac OS X 10.6 Snow Leopard – Now Available (2009)

https://news.ycombinator.com/item?id=781964
2•thomassmith65•57m ago•0 comments

RLMs are the new reasoning models

https://raw.works/rlms-are-the-new-reasoning-models/
1•dnw•1h ago•0 comments

Gell-Mann AImnesia

https://huonw.github.io/blog/2026/04/gell-mann-aimnesia/
1•dbaupp•1h ago•1 comments

Mall Code

https://mall.merkoba.com
1•madprops•1h ago•0 comments

Anthropic says OpenClaw-style Claude CLI usage is allowed again

https://docs.openclaw.ai/providers/anthropic
2•jmsflknr•1h ago•0 comments

No Naked Singularity, Whatever the Physical Collapse

https://zenodo.org/records/16181570
2•jruohonen•1h ago•0 comments

Svelte-check-native: Blazing fast svelte-check built with Rust

https://github.com/harshmandan/svelte-check-native
2•thunderbong•1h ago•0 comments

US Utilities Plan $1.4T for AI Data Centers

https://tech-insider.org/us-utility-1-4-trillion-ai-data-center-energy-2026/
2•jackyli02•1h ago•0 comments

Theseus, a Static Windows Emulator

https://neugierig.org/software/blog/2026/04/theseus.html
1•matt_d•1h ago•0 comments

PageGuard – scan a URL, get compliance docs from the actual tech detected

https://www.getpageguard.com
1•Dhicks_builds•1h ago•0 comments

Smart Home for Beginners: Where to Start

https://aigadgetexpert.com/best-smart-home-beginners-2026
2•amghal•1h ago•0 comments