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?

New LLM Pre-Training and Post-Training Paradigms

https://magazine.sebastianraschka.com/p/new-llm-pre-training-and-post-training
1•lr0•5m ago•0 comments

How We Optimize RocksDB in TiKV – Write Batch Optimization

https://medium.com/@siddontang/how-we-optimize-rocksdb-in-tikv-write-batch-optimization-28751a4bdd8b
1•eatonphil•17m ago•0 comments

Prompts.chat/Builder: Prompt Building Suite

https://prompts.chat/builder
1•fka•17m ago•0 comments

Show HN: Deep Code Research – AI surveys 10 similar repos to review yours

1•WindChimeRan•18m ago•0 comments

Silver Thursday

https://en.wikipedia.org/wiki/Silver_Thursday
1•gjvc•19m ago•0 comments

Familial confounding in the associations between maternal health and autism

https://doi.org/10.1038/s41591-024-03479-5
2•rendx•20m ago•0 comments

CLI for internet speed test via Cloudflare

https://github.com/kavehtehrani/cloudflare-speed-cli
2•sashk•21m ago•0 comments

BuyMeACoffee with Crypto Rails

https://cryptocoffee.dev/
1•shrimalmadhur•26m ago•0 comments

Going Paperless

https://www.julianfalk.dev/blog/going-paperless
2•jan0r•28m ago•0 comments

A New Navigation Paradigm

https://www.doc.cc/articles/ai-navigation
1•ggauravr•28m ago•0 comments

Rich Hickey: Thanks AI

https://gist.github.com/richhickey/ea94e3741ff0a4e3af55b9fe6287887f
21•austinbirch•30m ago•1 comments

Skynet Starter Kit: From AI Jailbreak to Remote Takeover of Humanoid Robots [video]

https://www.youtube.com/watch?v=qjA__5-Bybs
1•tiborsaas•30m ago•0 comments

Silver Swan (Automaton)

https://en.wikipedia.org/wiki/Silver_Swan_(automaton)
1•croes•31m ago•0 comments

The Day the LLM Stood Still: A Diary from a World Without AI

https://blog.pytoshka.me/post/the-day-the-llm-stood-still/
1•alexclear•32m ago•0 comments

Is this AI? How can you tell?

https://open.spotify.com/track/5epbOCBHAVNWkvOQDmki3V
1•vinlock•32m ago•0 comments

Loneliness at 19, How to Cope?

1•yresting•36m ago•0 comments

Lecture on spectral unfolding: Closely related to local noise removal

https://github.com/msuzen/leymosun/blob/main/lectures/spectral_unfolding.ipynb
1•northlondoner•40m ago•1 comments

Video Analysis Site

https://visionanalyze.com
1•greentimer•45m ago•0 comments

Show HN: My app just won best iOS Japanese learning tool of 2025 award

https://skerritt.blog/best-japanese-learning-tools-2025-award-show/
15•wahnfrieden•48m ago•1 comments

Show HN: Kiss – code-complexity feedback for LLM coding agents

https://github.com/dsweet99/kiss
2•dspub99•51m ago•0 comments

Playing with Turmites: better than crypto/rand?

https://blog.vrypan.net/2025/12/28/playing-with-turmites-better-than-crypto-rand/
2•vrypan•55m ago•1 comments

Apple retires 25 products, ends iconic iPhone SE era

https://news.az/news/apple-retires-25-products-ends-iconic-iphone-se-era
4•doener•55m ago•0 comments

Curator 'shocked' by Melbourne pitch performance in Ashes

https://www.rnz.co.nz/news/sport/582828/curator-shocked-by-melbourne-pitch-performance-in-ashes
2•tigerlily•1h ago•0 comments

ThinkTank, an "idea processor" that launched a religion (of outliners)

https://stonetools.ghost.io/thinktank-dos/
2•ChristopherDrum•1h ago•0 comments

Shields.io Uses the GitHub API

https://shields.io/blog/token-pool
3•angristan•1h ago•0 comments

Show HN: DeviceGPT – AI-powered Android device monitor with real data

1•teamzlab•1h ago•0 comments

The brain decides what to remember with sequential molecular timers

https://medicalxpress.com/news/2025-11-brain-reveals-sequentially-molecular-timers.html
1•PaulHoule•1h ago•0 comments

The Question Nobody Asks

https://aliveness.kunnas.com/articles/the-question-nobody-asks
1•ekns•1h ago•0 comments

Multi-Tenant SaaS's Wildcard TLS: An Overview of DNS-01 Challenges

https://www.skeptrune.com/posts/wildcard-tls-for-multi-tenant-systems/
1•skeptrune•1h ago•0 comments

Fast Cvvdp Implementation in C

https://github.com/halidecx/fcvvdp
3•todsacerdoti•1h ago•0 comments