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

What Happens When Strangers Can Confess Anything – Anonymous?

https://www.indiehackers.com/post/what-happens-when-strangers-can-confess-anything-completely-ano...
1•killshotroxs•2m ago•0 comments

Rv 0.5: Windows support, rv run, rvx

https://spinel.coop/blog/rv-0.5-cli-tools-windows/
1•adamch•5m ago•0 comments

Is it AI slop, or AI soup?

https://skillsoup.dev/concept
1•softwareiseasy•5m ago•0 comments

How to Recover Cryptocurrency

1•Mirgova8•6m ago•0 comments

The $100M bet that Columbus can become America's startup capital

https://www.ohiotechnews.com/the-100-million-bet-that-columbus-can-become-americas-startup-capital/
1•jbredeche•7m ago•0 comments

Joseph Gordon-Levitt Goes to Washington DC, Gets Section 230 Backwards

https://www.techdirt.com/2026/02/12/joseph-gordon-levitt-goes-to-washington-dc-gets-section-230-c...
3•hn_acker•8m ago•1 comments

What Won't Change

https://www.praf.me/what-wont-change
2•_praf•8m ago•1 comments

Ask HN: How do you audit LLM code in programming languages you don't know?

3•syx•8m ago•0 comments

Validate dental scheduling semantics in 5 minutes

https://www.loom.com/share/e541491c076c4003b61528b052e3c96f
2•lake22traillady•9m ago•1 comments

T-Mobile will live translate regular phone calls without an app

https://www.theverge.com/tech/877008/t-mobile-live-translation-languages-ai-network
2•m-hodges•9m ago•0 comments

charm_ We make the command line glamorous

https://charm.land/
2•weinzierl•9m ago•0 comments

DevGuess – Guess the programming technology from ecosystem clues

https://devguess.com/
1•hylkuba•11m ago•0 comments

SlimeVR Butterfly Tracker,full-body VR trackers offer up to 48h battery life

https://www.cnx-software.com/2026/02/12/slimevr-butterfly-trackers-nrf52833-based-ultra-slim-full...
1•homarp•11m ago•0 comments

Show HN: Sargam Notebook – an interactive notebook for Indian classical music

https://sargam.speede.site
2•vivasvan100•12m ago•0 comments

Polis: Open-source platform to find common ground at scale

https://pol.is/home2
5•mefengl•12m ago•0 comments

Workledger – An offline first engineering notebook

https://about.workledger.org/
1•todsacerdoti•13m ago•0 comments

The Effect of Gas on a Marriage

https://tomclancy.info/marriage-and-gas.html
1•tclancy•15m ago•2 comments

The Alzheimer's Equation

https://metamagic.substack.com/p/the-alzheimers-equation
1•r0ze-at-hn•16m ago•0 comments

A numerical investigation of H-air lifted flames in swirling fuel injectors

https://www.sciencedirect.com/science/article/pii/S0010218025004985
1•PaulHoule•18m ago•0 comments

When Human Activity Dropped During Covid-19 Methane Emissions Spiked

https://www.smithsonianmag.com/smart-news/when-human-activity-dropped-during-covid-19-methane-emi...
1•stevenjgarner•19m ago•0 comments

GPT-5.3-Codex-Spark is now in research preview

https://twitter.com/OpenAI/status/2022009582210715925
4•tosh•20m ago•1 comments

Hylo: A Systems Programming Language Focused on Value Semantics and Generics

https://hylo-lang.org/
1•birdculture•20m ago•0 comments

Show HN: DB Pro Studio – A self-hosted, collaborative database client

https://www.dbpro.app/studio
1•upmostly•20m ago•0 comments

We're in an Exponential

https://www.augmentcode.com/blog/we-re-in-an-exponential
2•thesleepypanda•22m ago•0 comments

Show HN: A deterministic adversarial puzzle system

https://hashclue.com/paper
1•cartographus•24m ago•0 comments

How a Pencil-Purchasing U.S. Bureaucrat Ended Up Shaking Hands with Putin

https://www.wsj.com/politics/national-security/how-a-pencil-purchasing-u-s-bureaucrat-ended-up-sh...
1•impish9208•25m ago•1 comments

Show HN: Hybrid Semantic Grep for Claude Code

https://github.com/lightonai/next-plaid
1•raphaelty•25m ago•0 comments

Voice-controlled AI OpenClaw agent manipulating 3D game engine in real-time

https://twitter.com/PlayingInCanvas/status/2022008924950700510
1•astressence•25m ago•0 comments

Analysis: China's CO2 emissions have now been 'flat or falling' for 21 months

https://www.carbonbrief.org/analysis-chinas-co2-emissions-have-now-been-flat-or-falling-for-21-mo...
3•ceejayoz•26m ago•0 comments

Border Officials Caused El Paso Closure by Firing Anti-Drone Laser

https://www.nytimes.com/2026/02/11/us/trump-administration-el-paso-airspace-closure-questions.html
1•ripe•26m ago•1 comments