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

Show HN: I built a multi-agent "Boardroom" to roast my startup ideas

https://www.roundtablelabs.ai/
1•maxkuan•41s ago•0 comments

Nw_wrld: Event-driven sequencer for triggering visuals

https://github.com/aagentah/nw_wrld
1•amar-laksh•1m ago•0 comments

'I rarely get outside': scientists ditch fieldwork in the age of AI

https://www.nature.com/articles/d41586-025-04150-w
1•Growtika•1m ago•0 comments

Who was Renee Nicole Good, the woman killed by ICE?

https://www.bbc.co.uk/news/articles/c1jepdjy256o
1•n1b0m•1m ago•0 comments

6'7" Is Not Random

https://substack.com/home/post/p-183890370
1•bosmanos•2m ago•0 comments

Taproot Assets v0.7: The Set-and-Forget Asset Layer for Lightning

https://lightning.engineering/posts/2025-12-16-tapd-0.7-launch/
1•janandonly•4m ago•0 comments

The IDE for Conversations

1•casualhermit•7m ago•0 comments

Senior AMD executive suggests consumers buy cheap CPUs to combat memory pricing

https://www.tomshardware.com/pc-components/cpus/senior-amd-executive-suggests-consumers-buy-cheap...
1•cebert•7m ago•0 comments

The Crypto Story (2022)

https://www.bloomberg.com/features/2022-the-crypto-story/
1•vismit2000•8m ago•0 comments

Show HN: A game/benchmark where AI bots hunt each other

https://hiding-robot.vercel.app/
1•-babi-•9m ago•0 comments

The Slow Way Is the Fast Way

https://www.mark-samples.com/learn/2021/2/11/the-slow-way-is-the-fast-way
1•signa11•10m ago•0 comments

Dora 2025: Year in Review

https://dora.dev/insights/dora-2025-year-in-review/
1•cebert•10m ago•0 comments

Run Your Project in a Dev Container, in Zed

https://zed.dev/blog/dev-containers
1•ahamez•12m ago•0 comments

Runtime injection of temporary debug code

https://www.loom.com/share/1e526ff43fa44bfcaebe18a6f56052ff
1•adiraja•12m ago•1 comments

Show HN: MyMoodWrapped – Track your mood in 2026

https://www.mymoodwrapped.com/landing
1•pelmenibenni•12m ago•0 comments

Women in Coding

https://www.nytimes.com/2019/02/13/magazine/women-coding-computer-programming.html
1•ksec•14m ago•0 comments

Training and fine-tuning an Artificial Intelligence

https://github.com/tambetvali/LaegnaAITraining
1•tvali•15m ago•0 comments

Stack Overflow's forum killed by AI, but the company's still kicking for AI

https://sherwood.news/tech/stack-overflow-forum-dead-thanks-ai-but-companys-still-kicking-ai/
1•ForHackernews•17m ago•0 comments

Bitcoin mining firm Canaan pilot uses waste heat from mining to grow tomatoes

https://www.datacenterdynamics.com/en/news/canaan-pilot-uses-waste-heat-from-bitcoin-mining-to-gr...
3•giuliomagnifico•18m ago•1 comments

Pre-Compiled Headers Being Debated for LLVM/Clang to Speed-Up Build by 1.5~2x

https://www.phoronix.com/news/LLVM-PCH-Consideration
2•maxloh•24m ago•0 comments

Show HN: LoongFlow – Better Than Google AlphaEvolve

https://github.com/baidu-baige/LoongFlow
2•FreshmanD•24m ago•2 comments

The Personal Panoptican

https://docs.google.com/document/d/19-ajYTp2hwOW9WcirY9OIoSvMdfyivup8LMI92PkS20/edit?tab=t.0
1•chid•25m ago•0 comments

Hologram Awarded EEF Stipend for Development Milestones

https://hologram.page/blog/hologram-awarded-eef-stipend
1•amalinovic•25m ago•0 comments

Moorelink: High-Signal Social Media Scraper Delivering JSON Directly to Telegr

1•israeltimi•27m ago•0 comments

Are criminals vibe coding malware? All signs point to yes

https://www.theregister.com/2026/01/08/criminals_vibe_coding_malware/
2•pseudolus•31m ago•1 comments

Sopro: A 169M parameter real-time TTS model with zero-shot voice cloning

https://github.com/samuel-vitorino/sopro
5•marques576•35m ago•1 comments

Show HN: Trying to tackle the mental health crisis in an effective way

2•OleJ•35m ago•1 comments

Show HN: Git analytics that works across GitHub, GitLab, and Bitbucket

https://www.gitmore.io/
2•akhnid•35m ago•0 comments

Show HN: Honest Stake – An architecture of consequences (Enforced using code)

https://www.honeststake.com
3•tusahrbase•37m ago•2 comments

A mental-model roadmap for learning TypeScript

https://nemorize.com/roadmaps/typescript
2•reverseblade2•39m ago•1 comments