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?

CSG: Why the Largest Military IPO in European History Is Combusting

https://hntrbrk.com/csg/
1•yread•1m ago•0 comments

It's time to test all adults for lipoprotein(a)

https://www.lipidjournal.com/article/S1933-2874(26)00126-1/fulltext
1•brandonb•5m ago•0 comments

Claude Code wire trace reveals 13,000 words base prompt

https://twitter.com/dominiek/status/2052119211644760473
2•dominiek•5m ago•1 comments

Agile Is Dead. Long Live Agile

https://amoebaunlimited.substack.com/p/agile-is-dead-long-live-agile
2•bryanking•7m ago•0 comments

CrustAI – Private local AI assistant

https://github.com/DaveSimoes/CrustAI
1•DaveHN_2026•7m ago•0 comments

Over 3k Datacentres planned for 2026 global map

https://roboticforce.io/datacentermap
3•cdnsteve•8m ago•0 comments

Show HN: A website designed to be not readable by AI

http://eyes.onlytech.boo/
1•vednig•9m ago•0 comments

UI Hostility

1•morpheos137•10m ago•0 comments

Making Julia as Fast as C++

https://flow.byu.edu/posts/julia-c++
1•d_tr•14m ago•0 comments

Terminal coding agent for DeepSeek V4

https://github.com/Hmbown/DeepSeek-TUI
1•doener•15m ago•0 comments

Kestrel: Open-source sovereign AI agent framework

https://github.com/KestrelSovereignAI/kestrel-sovereign
1•Gabriela_OS_TX•15m ago•0 comments

Nvidia's Status as the Biggest Company Could Could End Soon

https://www.inc.com/moses-jeanfrancois/nvidia-alphabet-worlds-biggest-company/91341371
1•donsupreme•18m ago•0 comments

All the demons hiding in your AIs

https://drtompollak.substack.com/p/all-the-demons-hiding-in-your-ais
1•IvanLudvig•20m ago•0 comments

Connectors Now on Grok Web

https://x.ai/news/grok-connectors
1•surprisetalk•21m ago•0 comments

Show HN: I built an open source background agent inspired by Ramp Inspect

https://github.com/jvaill/Kill-The-Backlog
1•jvaill•22m ago•0 comments

All one-byte program names in Nixpkgs

https://gist.github.com/samestep/2365535dc9afd10458b918919d7c2383
2•sestep•23m ago•0 comments

Show HN: Naval Strike – simultaneous turn-based fleet combat in the browser

https://navalstrike.app
1•pinchydev•23m ago•0 comments

Ask HN: Terafab – Smart move or insane financial risk?

1•imheretolearn•23m ago•0 comments

Apple is enforcing an old App Store rule against a new kind of software

https://adaptivesoftware.substack.com/p/the-wrapper-and-the-code
6•iristenteije•24m ago•0 comments

Ukraine said it captured a Russian position using only ground robots and drones

https://www.businessinsider.com/ukraine-russia-position-taken-without-using-troops-just-robots-dr...
1•johnbarron•25m ago•0 comments

Origin Story

https://www.nature.com/articles/d41586-026-01077-8
1•jdkee•25m ago•0 comments

Judgment, Inquisitor: Medieval Spain. You Serve as an Inquisitor

https://store.steampowered.com/app/3953700/Your_Judgment_Inquisitor/
1•doener•26m ago•0 comments

Ford is in 'very advanced' talks to sell part of EU plant to China's Geely

https://electrek.co/2026/05/06/ford-in-advanced-talks-sell-eu-plant-geely/
2•breve•27m ago•0 comments

The SEC's Semi-Annual Reporting Proposal: A Solution in Search of a Problem

https://www.forbes.com/sites/shivaramrajgopal/2026/05/05/the-secs-semi-annual-reporting-proposal-...
2•malshe•28m ago•0 comments

Show HN: Gulugulu, an old-style client-side search engine for the old weird web

https://cbrincoveanu.github.io/gulugulu/
2•cbrincoveanu•28m ago•0 comments

Cyclists feel safer than they are on busy streets, study finds

https://techxplore.com/news/2026-04-cyclists-safer-busy-streets.html
1•PaulHoule•29m ago•0 comments

Boris Johnson sees a "blessing" in falling British births

https://www.governance.fyi/p/boris-johnson-sees-a-blessing-in
3•guardianbob•32m ago•1 comments

A mega-deal will transform the lift (elevator) industry

https://www.economist.com/business/2026/04/30/how-a-mega-deal-will-transform-the-lift-industry
1•pseudolus•35m ago•1 comments

Programmers Spend Their Time – Probably Dance

https://probablydance.com/2026/02/10/how-programmers-spend-their-time/
1•birdculture•36m ago•0 comments

Mickey Mouse is watching you: Disneyland deploys facial recognition

https://www.theguardian.com/us-news/2026/apr/28/disneyland-entrance-facial-recognition
7•Cider9986•37m ago•0 comments