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?

TorchTPU: Running PyTorch Natively on TPUs at Google Scale

https://developers.googleblog.com/torchtpu-running-pytorch-natively-on-tpus-at-google-scale/
1•mji•39s ago•0 comments

Our Companywide NanoClaw Setup

https://bitsafe.notion.site/Building-a-Company-Wide-AI-Assistant-Architecture-Security-and-Self-I...
1•akibalogh•1m ago•0 comments

Ask HN: Incoming Meta layoffs, what now?

1•psychanarch•1m ago•0 comments

Toxins from Great Salt Lake dust are absorbed by plants, soils and human bodies

https://phys.org/news/2026-04-toxins-great-salt-lake-absorbed.html
1•littlexsparkee•1m ago•0 comments

AI-Powered Tool Helps Computer Architects Boost Processor Performance

https://news.ncsu.edu/2026/04/cachemind-tool-computer-architecture/
1•rbanffy•2m ago•0 comments

For Enterprises, GPUs Need Virtualization as Much as CPUs Ever Did

https://www.nextplatform.com/control/2026/04/10/for-enterprises-gpus-need-virtualization-as-much-...
1•rbanffy•3m ago•0 comments

Four Years of GreptimeDB: Decisions, Detours, and What We Got Wrong

https://greptime.com/blogs/2026-04-21-greptimedb-four-years-retrospective
1•JeremyFeng•3m ago•0 comments

Why AI data centers might lower electricity prices – not raise them

https://bigthink.com/science-tech/why-ai-data-centers-might-lower-electricity-prices-not-raise-them/
1•lschueller•4m ago•0 comments

How the Tech World Turned Evil

https://newrepublic.com/article/208876/tech-world-evil-musk-bezos-thiel
3•thomasstephan•5m ago•0 comments

Show HN: Object Storage Vendors – Compared

https://storage.mixpeek.com
1•Beefin•8m ago•0 comments

GitHub Merge Queue Silently Reverted Code

https://www.githubstatus.com/incidents/zsg1lk7w13cf
5•matthewbauer•8m ago•1 comments

Personal Daily Briefing (PDB)

https://icbrief.org/
3•billybuckwheat•8m ago•0 comments

How to Be a Hugo Nominee and Come Out of It Happy About the Honor

https://bsky.app/profile/seananmcguire.bsky.social/post/3mjzp5gmipc2z
1•mooreds•9m ago•0 comments

Unauthorized Discord group gained access to Anthropic's Mythos model

https://techcrunch.com/2026/04/21/unauthorized-group-has-gained-access-to-anthropics-exclusive-cy...
2•thoughtpeddler•9m ago•1 comments

US turns to Ukrainian counter-drone tech after Iran attacks, sources say

https://www.reuters.com/business/aerospace-defense/us-turns-ukrainian-counter-drone-tech-after-ir...
1•Teever•11m ago•0 comments

Cryptographic right answers: post quantum and Rust edition

https://kerkour.com/post-quantum-cryptography-recommendations-rust
1•fanf2•12m ago•0 comments

Built something in a Replit buildathon → 45 users in 3 weeks

https://www.indiehackers.com/post/built-something-in-a-replit-buildathon-45-users-in-3-weeks-MCt2...
1•Fateh06khlch•12m ago•0 comments

Rejection and Competition

https://www.emberdione.com/on-rejection-and-competition/
1•sebg•13m ago•0 comments

Steve Ballmer was an underrated CEO

https://danluu.com/ballmer/
1•vkdelta•15m ago•0 comments

What's new for .NET in Ubuntu 26.04

https://devblogs.microsoft.com/dotnet/whats-new-for-dotnet-in-ubuntu-2604/
1•vyrotek•21m ago•0 comments

Amazon S3 now supports five additional checksum algorithms

https://aws.amazon.com/about-aws/whats-new/2026/04/s3-five-additional-checksum-algorithms/
1•gslin•21m ago•0 comments

A bit of XENIX history (2014)

http://seefigure1.com/2014/04/15/xenixtime.html
1•naves•22m ago•0 comments

Brain Regeneration Observatory – a real, long term use of ML and AI that matters

https://brain-regeneration.com/
1•rcarmo•23m ago•0 comments

ArXivLean: How Well Can LLMs Formally Prove Research Math?

https://matharena.ai/arxivlean/
1•OxfordCommand•23m ago•0 comments

Intel's soars 15% as results top estimates

https://www.cnbc.com/2026/04/23/intel-intc-q1-2026-earnings-report.html
2•nodesocket•25m ago•1 comments

LaGuardia firefighter heard 'stop' before crash but didn't know who it was for

https://apnews.com/article/laguardia-air-canada-ntsb-crash-fire-truck-8f59cffd6f8230ec0c0c0c4d6ef...
2•geox•25m ago•0 comments

The Living Lattice – Explorables of the intelligence theorem

https://lattice.project89.org/
1•sebg•26m ago•0 comments

Show HN: Tron Hilbert Curve Macro

https://github.com/EricNelson12/retrocycles-hilbert
2•i_am_a_squirrel•29m ago•0 comments

ChatGPT for Healthcare

https://help.openai.com/en/articles/20001046-chatgpt-for-healthcare
2•thimabi•30m ago•1 comments

AI Is Destroying the Junior Developer Pipeline. Fix: Preceptorships

https://newclawtimes.com/articles/microsoft-russinovich-hanselman-junior-developer-pipeline-crisi...
1•andrewstetsenko•33m ago•0 comments