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

Explore the Stratosphere with a DIY Pico Balloon

https://spectrum.ieee.org/explore-stratosphere-diy-pico-balloon
1•Brajeshwar•20s ago•0 comments

Want more ads on your web pages? Try the AdBoost extension

https://www.theregister.com/2026/02/02/ads_web_pages_adboost_extension/
1•Brajeshwar•28s ago•0 comments

Culture-free diagnosis of pathogens via microfluidic-Raman micro-spectroscopy

https://www.nature.com/articles/s41467-025-66996-y
1•PaulHoule•1m ago•0 comments

Show HN: Post-Conversation Layer (Primeorbit)

https://hoster.primeorbit.ai/
1•alladipo•1m ago•0 comments

Techie's one ring brought darkness by shorting a server

https://www.theregister.com/2026/02/02/who_me/
1•Brajeshwar•2m ago•0 comments

Show HN: We built Migrate Wizard to make email migrations simpler

https://migratewizard.com/
1•techstuff123•2m ago•0 comments

Show HN: An open-source engine in Golang to run Classic ASP on Linux

1•lucasguimaraes•3m ago•0 comments

Confession from Your Newest User

https://public.3.basecamp.com/p/njmKUBfBAJkfKuB8NHqV1qJ7
1•tosh•3m ago•0 comments

An articulated archer automaton [video]

https://www.youtube.com/watch?v=Bc0bIpDVEa8
1•Teever•3m ago•0 comments

LoopFrog: In-Core Hint-Based Loop Parallelization

https://danglingpointers.substack.com/p/loopfrog-in-core-hint-based-loop
1•blakepelton•3m ago•0 comments

The Bitsavers Main Page

http://www.bitsavers.org/
1•surprisetalk•4m ago•0 comments

Understanding Neural Network, Visually

https://visualrambling.space/neural-network/
1•surprisetalk•4m ago•0 comments

'Work is what you're doing when you'd rather be doing something else'

https://bookofjoe2.blogspot.com/2025/11/work-is-what-youre-doing-when-youd.html
1•surprisetalk•4m ago•0 comments

China unveils flying aircraft carrier

https://www.telegraph.co.uk/world-news/2026/02/03/china-unveils-star-wars-space-carrier-luanniao/
1•CGMthrowaway•4m ago•0 comments

I tried a Claude Code alternative that's local, open source, and free

https://www.zdnet.com/article/claude-code-alternative-free-local-open-source-goose-getting-started/
1•janandonly•4m ago•0 comments

Django security releases issued: 6.0.2, 5.2.11, and 4.2.28

https://www.djangoproject.com/weblog/2026/feb/03/security-releases/
1•pauloxnet•5m ago•0 comments

Dataguessr

https://dataguessr.com/
1•surprisetalk•5m ago•0 comments

Apple Seemingly Avoiding Latest Chip Tech for New iPhones and Macs

https://www.macrumors.com/2026/02/03/apple-seemingly-avoiding-latest-chip-tech/
1•virgildotcodes•5m ago•0 comments

Elliott Wave Principle

https://en.wikipedia.org/wiki/Elliott_wave_principle
1•rzk•6m ago•0 comments

Revisiting ChatGPT's financial advice, 15 months later

https://thomasvilhena.com/2026/02/revisiting-chatgpt-financial-advice
2•tcgv•8m ago•1 comments

Show HN: Piou – CLI tool, now with built-in TUI

https://andarius.github.io/piou/tui/
2•Orelus•8m ago•0 comments

GitHub Actions is broken again

1•Fizzadar•8m ago•0 comments

I don't read code anymore - creator of Superpowers

https://www.claudecodecamp.com/p/why-jesse-doesn-t-read-code-anymore
1•aray07•9m ago•0 comments

Persistent, Sandboxed, Single-Site Browser (Firejail and Proxychains)

https://tech.michaelaltfield.net/2026/02/03/single-site-browser-firejail-proxychains/
1•speckx•9m ago•0 comments

VC-Backed Startups Are Low Status

https://mhdempsey.substack.com/p/vc-backed-startups-are-low-status
1•chaseadam17•9m ago•1 comments

If Apple is richer than ever, why does it feel so broke?

https://www.macworld.com/article/3050158/winter-of-our-apple-discontent.html
2•latexr•10m ago•0 comments

Show HN: Made a customisable img to ICO converter with Chrome/Google preview

https://png-to-ico.com
1•Kristjan_Retter•10m ago•0 comments

Show HN: Plasma stability limits from geometric first principles in 39ms

https://gdbs.getvaultsync.com
2•garrjo•12m ago•2 comments

Show HN: Redress – failure policy for Python services

https://github.com/aponysus/redress
1•aponysus•12m ago•0 comments

Show HN: Realtime 13Fs and track live institutional ownership for any ticker

https://www.signalbloom.ai/13f/
1•GodelNumbering•13m ago•0 comments