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?

New kind of Microsoft GitHub spam?

1•jph•1m ago•0 comments

A Zipper Patent Sat in a Garage for 40 Years. Now It's Real.

https://www.yankodesign.com/2026/05/31/a-zipper-patent-sat-in-a-garage-for-40-years-now-its-real/
1•bookofjoe•1m ago•0 comments

Show HN: PoC to use the Chrome Prompt API on other people's machine

https://datm.nl/chat-together/
2•psyonity•1m ago•0 comments

Gabon's TLD .ga seems to be somewhat down

https://www.mon.ga/
1•elikoga•2m ago•0 comments

We think giant pterosaurs could fly (2018)

http://markwitton-com.blogspot.com/2018/05/why-we-think-giant-pterosaurs-could-fly.html
1•downbad_•8m ago•0 comments

Amazon molly fish species survived 100k years without males

https://www.bbc.com/future/article/20260601-amazon-molly-the-fish-thats-lived-for-100000-years-wi...
1•giuliomagnifico•11m ago•0 comments

Chasing Ghosts: On progress, memory, and its generations

https://msavina.substack.com/p/chasing-ghosts
1•archival_moth•14m ago•0 comments

HTML Deployer – Publish HTML from AI Chats to a Website

https://chromewebstore.google.com/detail/html-deployer-1-click-ai/gihmknkabkkghpiocgnoiejagngdegea
1•quysala1•17m ago•0 comments

1979: Will Word-Processors start a home revolution?

https://www.youtube.com/watch?v=b6URa-PTqfA
1•madradavid•17m ago•0 comments

Jellycat: a Rust CLI for Turning Jujutsu Changesets into GitHub PR Stacks

https://github.com/fanzeyi/jellycat
1•mos3abof•17m ago•1 comments

Reverse-Engineered Userspace Driver for Asus ZenVision Lid OLED on Linux"

https://github.com/tarpediem/zenvision-linux
3•berlianta•18m ago•0 comments

His Chatbot Nearly Ruined Him. To Recover, He Had to Destroy It

https://www.wsj.com/tech/personal-tech/chatgpt-addiction-chatbots-recovery-7977308e
1•Michelangelo11•18m ago•1 comments

A Review of QucsStudio

https://electroagenda.com/en/a-review-of-qucsstudio/
1•teleforce•19m ago•0 comments

Consolidated AI First Startup Guide

https://benemson.com/resources/ai-first-startup-guide
1•emson•19m ago•1 comments

Basil and fennel compound may build up dangerous DNA damage in vulnerable people

https://medicalxpress.com/news/2026-06-basil-fennel-compound-dangerous-dna.html
3•XzetaU8•19m ago•0 comments

Conspiracy theory was correct about Israel and big tech

https://twitter.com/john1rudio/status/2061567421148754032
1•juliusceasar•21m ago•0 comments

CSS-Native Parallax Effect

https://dan-webnotes.com/posts/2026-06-02-css-native-parallax-effect/
4•dandep•23m ago•0 comments

Without fanfare, China is making rural migrants' lives easier

https://www.economist.com/finance-and-economics/2026/05/28/without-fanfare-china-is-making-rural-...
2•rbanffy•24m ago•0 comments

Why AI Makes Us So Angry

https://medium.com/@livestock.dev/why-ai-makes-us-so-angry-55b4fcb08e3a
3•sushidev•31m ago•2 comments

Marches and Gnats – Fantastical game of programming challenges

https://mng.quest/
2•ColinWright•34m ago•0 comments

A cinematic landing-page hero for 80 cents (GPT Image 2 still and Veo 3.1)

https://johnkueh.com/articles/veo-cinematic-hero
1•johnkueh•34m ago•0 comments

How Cornish miners brought football to Mexico

https://www.bbc.com/sport/football/articles/cx21q453l4jo
2•rustoo•35m ago•0 comments

Michael Burry says neither SpaceX nor Anthropic is worth $1T

https://www.businessinsider.com/big-short-michael-burry-spacex-anthropic-ipo-ai-bubble-claude-2026-6
16•mgh2•37m ago•4 comments

This project is most certainly a violation of the original EPL of jqwik

https://github.com/dave-a-human/axiomcheck/issues/1
2•phoronixrly•38m ago•0 comments

Bug hunt: Why you only need Paris to beat Pizza Tycoon (1994)

https://pizzalegacy.nl/blog/bug-hunt-why-you-only-need-paris-to-beat-pizza-tycoon.html
1•cowomaly•40m ago•1 comments

Show HN: Synapse – 2.9MB Mac app with screenshot, clipboard, Keep Awake and more

https://www.synapsemac.com/
5•harshanacz•44m ago•5 comments

Lawsuit Against Amazon: 'Subscribe and Save' Program Can Cost You More

https://www.msn.com/en-us/money/companies/amazon-lured-customers-into-enrolling-in-subscribe-save...
2•thisislife2•44m ago•0 comments

Adafruit Receives Demand Letter from Fenwick Legal Counsel on Behalf of Flux.ai

https://blog.adafruit.com/
16•semanser•46m ago•3 comments

America's Corporate Protector

https://www.bloomberg.com/features/2026-trump-cfpb-enforcement
3•petethomas•47m ago•0 comments

MultiClip: A dead-simple clipboard manager that solves a real problem

https://github.com/jerfauvet-arch/MultiClip
1•jer_fau_chat•49m ago•0 comments