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?

TSMC SoIC 3D stacking roadmap outlines path from 6-micron pitches to 4.5 in 2029

https://www.tomshardware.com/tech-industry/semiconductors/tsmc-soic-3d-stacking-roadmap-outlines-...
1•rbanffy•20s ago•0 comments

US House Probes Airbnb, Anysphere (Cursor) Use of Chinese Models

https://www.bloomberg.com/news/articles/2026-04-29/us-house-probes-airbnb-anysphere-s-use-of-chin...
1•htrp•2m ago•0 comments

What Is Real

https://claude2028.org/the-work/what-is-real
1•xqueenofswordsx•2m ago•0 comments

Would you use AI tools built specifically for data science workflows?

https://github.com/getbridgekit/bridgekit
1•ivaivanova•2m ago•0 comments

A Simple Technique for Overlapping IRQ Handlers

https://trident64.github.io/overlapping-irq-handlers/
1•adunk•3m ago•0 comments

Nazi PARTY originating co. now controls ALL HELIUM FOR MICROCHIPS

https://heliumcartel.com/
2•douchecoded•5m ago•2 comments

Artemis II Photo Timeline

https://artemistimeline.com/#artemis-ii-walkout-nhq202604010003
2•geerlingguy•8m ago•0 comments

Gemma 4 architecture support for QVAC-Fabric (Tether's llama.cpp fork)

https://github.com/tinmanlabsl/qvac-gemma4-patch
1•oliveskin•10m ago•0 comments

Using a 1978 terminal in 2026 (DEC VT-100) · Nikhil Jha

https://nikhiljha.com/posts/vt100/
1•rbanffy•11m ago•0 comments

Commodore 64 Ultimate Line-Up Expands with C64C Edition Later This Year

https://commodore.net/c-you-soon-commodore-64-ultimate-line-up-expands-with-c64c-edition-later-th...
2•rbanffy•12m ago•0 comments

Show HN: UART Terminal – Web-based serial terminal using WebSerial API

https://github.com/baturyilmaz/uartterminal.com
1•arbayi•14m ago•0 comments

GPT-5.5's biggest blind spot: the Java bugs your tests won't catch

https://www.sonarsource.com/blog/gpt-5-5-biggest-blind-spot
1•andrewstetsenko•14m ago•0 comments

Cross-site scripting vulnerabilities lead to a RIPE NCC RPKI exploit chain

https://mxsasha.eu/posts/ripe-ncc-rpki-exploit-chain/
2•fanf2•14m ago•0 comments

Bullshit Ability as an Honest Signal of Intelligence

https://pmc.ncbi.nlm.nih.gov/articles/PMC10303565/
4•mgh2•17m ago•0 comments

Hurl 8.0 Just Made Postman Collections Look Heavier Than They Need to Be

https://medium.com/@samurai.stateless.coder/hurl-8-postman-api-testing-4158ca06743e
1•jicea•17m ago•0 comments

Someone compromised SAP's NPM packages and used the CI pipeline against itself

https://safedep.io/mini-shai-hulud-and-sap-compromise/
1•birdculture•21m ago•0 comments

AI with European Values

https://hostedai.eu
1•vodou•22m ago•0 comments

Love It or Lehane It

https://puck.news/openai-softens-ai-jobpocalypse-doom-messaging-amid-public-backlash/
2•cdrnsf•24m ago•1 comments

Release PiClaw v2.1.0 – Coruscant · rcarmo/piclaw

https://github.com/rcarmo/piclaw/releases/tag/v2.1.0
1•rcarmo•25m ago•0 comments

Increase in Claude Code speed bumps?

2•jesse_dot_id•31m ago•0 comments

Show HN: SimDrive – a browser racing game with your phone as the controller:D

https://simdrive.xyz/
1•1000xcat•31m ago•1 comments

CPanel and WHM Authentication Bypass Affecting 70M Domains

https://labs.watchtowr.com/the-internet-is-falling-down-falling-down-falling-down-cpanel-whm-auth...
1•pjf•32m ago•0 comments

Show HN: A CLI that'll prevent you from half-assing Auth

https://github.com/COD434/create-authenik8-app
2•TheSBD•34m ago•0 comments

Ask HN: Hosted Fossil for small teams – interesting, or wrong call?

4•ragelink•34m ago•0 comments

Every algorithm is a natural number. Hilbert's hotel has room for all of them

https://darkomulej.substack.com/p/how-many-numbers-are-there
2•Stoick•34m ago•0 comments

Alphabet Announces First Quarter 2026 Results

https://abc.xyz/investor/news/news-details/2026/Alphabet-Announces-First-Quarter-2026-Results-202...
34•xnx•35m ago•17 comments

Hyperstatistics

https://arxiv.org/abs/2604.24783
1•lucasquillante•35m ago•0 comments

Rare Earth Hypothesis

https://en.wikipedia.org/wiki/Rare_Earth_hypothesis
3•simonebrunozzi•41m ago•0 comments

Amazon.com Announces First Quarter Results

https://ir.aboutamazon.com/news-release/news-release-details/2026/Amazon-com-Announces-First-Quar...
2•mfiguiere•41m ago•0 comments

Lessons from the Fairness of African Fractal Societies

https://aeon.co/essays/lessons-from-the-fairness-of-african-fractal-societies
3•baddash•42m ago•0 comments