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•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?

Google ordered to put clearer links in AI search and let UK publishers opt out

https://arstechnica.com/tech-policy/2026/06/google-ordered-to-put-clearer-links-in-ai-search-and-...
1•alexcason•52s ago•0 comments

Show HN: Switch skills between agents, locally manage multiple configs

https://github.com/tilework-tech/nori-skillsets
1•theahura•1m ago•0 comments

Casual experiment hint that models seem to search for different stuff

https://spock.is/writing/reverse-mullet
1•BenediktHolm•2m ago•0 comments

Big Tech's big flop on primary night

https://www.politico.com/news/2026/06/03/tech-favored-candidates-fell-short-on-californias-primar...
1•cdrnsf•3m ago•0 comments

In first, California city overwhelmingly votes to permanently ban datacenters

https://www.theguardian.com/us-news/2026/jun/03/california-monterey-park-datacenters-ban
1•cdrnsf•3m ago•0 comments

Ask HN: What are all the ways to punch through NAT?

1•jupr•4m ago•0 comments

BQN: Primitive Overloading

https://mlochbaum.github.io/BQN/commentary/overload.html
1•tosh•5m ago•0 comments

VoidZero Is Joining Cloudflare

https://voidzero.dev/posts/voidzero-cloudflare
6•patrikcsak•5m ago•0 comments

The Worst-Case Future for White-Collar Workers

https://www.theatlantic.com/ideas/2026/02/ai-white-collar-jobs/686031/
2•Michelangelo11•5m ago•0 comments

The Fullers of Ancient Rome

https://www.worldhistory.org/article/46/the-fullers-of-ancient-rome/
1•thunderbong•7m ago•0 comments

Show HN: Hydron – Hardware-aware coding agent

https://www.hydron.sh/
2•prashantsengar•8m ago•0 comments

'Bots have now passed human traffic online,' Cloudflare boss laments

https://www.tomshardware.com/tech-industry/artificial-intelligence/bots-have-now-passed-human-tra...
2•pseudolus•8m ago•0 comments

Nemotron 3 Ultra: Open Moe Hybrid Mamba-Transformer for Agentic Reasoning [pdf]

https://research.nvidia.com/labs/nemotron/files/NVIDIA-Nemotron-3-Ultra-Technical-Report.pdf
2•victormustar•8m ago•0 comments

Data Science Weekly – Issue 654

https://datascienceweekly.substack.com/p/data-science-weekly-issue-654
1•sebg•8m ago•0 comments

An Interview with Brian Daugherty (Of Google)

https://ciamweekly.substack.com/p/an-interview-with-brian-daugherty
1•mooreds•9m ago•0 comments

Enforcing the First as in BGP AS_PATHs

https://blog.cloudflare.com/enforce-first-as-bgp/
2•berlianta•9m ago•0 comments

Entanglement Builds Space-Time. Now "Magic" Gives It Gravity

https://www.quantamagazine.org/entanglement-builds-space-time-now-magic-gives-it-gravity-20260603/
1•pseudolus•9m ago•0 comments

The Miracle on Mount Everest – Hillary Dawa Sperpa Found Alive

https://mttv.substack.com/p/miracle-on-mount-everest
1•GDNews503AD•9m ago•0 comments

Truncated Photon

https://journals.aps.org/prl/accepted/10.1103/94pm-hp34
1•bookofjoe•9m ago•0 comments

Docs AI that routes context with a nano model instead of a vector DB

https://linkshift.app/docs
1•p-zielinski•9m ago•0 comments

Being a Human Engineer in the AI Era

https://jeanhsu.substack.com/p/being-a-human-engineer-in-the-ai
2•mooreds•10m ago•0 comments

Everything You Need to Know about the Tickler File

https://facilethings.com/blog/en/the-tickler-file
1•ankitg12•10m ago•0 comments

Bitcoin Has Longest Losing Streak Since August in Bruising Week

https://www.bloomberg.com/news/articles/2026-06-04/bitcoin-btc-falls-to-pre-iran-conflict-low-as-...
3•1vuio0pswjnm7•11m ago•0 comments

Researchers show how AI-powered worms could wreak havoc on the internet

https://www.engadget.com/2186363/researchers-show-how-ai-powered-worms-could-wreak-havoc-on-the-i...
1•mooreds•11m ago•0 comments

AI Info Remover for Images

https://wype.online/
1•minhazkhaled•11m ago•0 comments

PostgreSQL 19 Beta 1 Released

https://www.postgresql.org/about/news/postgresql-19-beta-1-released-3313/
3•jkatz05•12m ago•0 comments

Cadillac – a coding agent that runs the app and tests user flows b4 shipping

https://github.com/mtecnic/cadillac
1•mtecnic•13m ago•0 comments

Design from the Inside

https://mattstromawn.com/writing/design-from-the-inside/
1•speckx•13m ago•0 comments

VoidZero Is Joining Cloudflare

https://blog.cloudflare.com/voidzero-joins-cloudflare/
8•coloneltcb•13m ago•1 comments

It Was Never About Coding. It Was Always About Design Thinking

https://saigaddam.medium.com/it-was-never-about-coding-it-was-always-about-design-thinking-afb609...
1•ChaitanyaSai•13m ago•0 comments