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

1964 New York World's Fair

https://en.wikipedia.org/wiki/1964_New_York_World%27s_Fair
1•teleforce•4m ago•0 comments

Show HN: Black Box QA testing system to automate QA process

https://www.rocksmith.ai/
1•orangeAvocad0•5m ago•0 comments

KGGen: Extracting Knowledge Graphs from Plain Text with Language Models

https://arxiv.org/abs/2502.09956
1•delichon•10m ago•0 comments

Show HN: Endless, a easily deployable and scalable social media

https://github.com/XS-Xspert-Software/Social-Media
1•thegoodduck•10m ago•0 comments

Breakfast menu prices are likely to see the biggest increase from food inflation

https://londonlovesbusiness.com/breakfast-menu-prices-are-likely-to-see-the-biggest-increase-from...
1•teleforce•11m ago•0 comments

The Force Is with Cristal Beer

https://en.wikipedia.org/wiki/The_Force_is_with_Cristal_Beer
1•handfuloflight•14m ago•0 comments

"Without searching, what's the likelihood of Maduro being kidnapped by US"

https://chatgpt.com/share/695b0f8b-8c20-8004-b17a-6a90adc8a646
1•softwaredoug•15m ago•0 comments

Tech Startups Are Handing Out Free Nicotine Pouches to Boost Productivity

https://www.wsj.com/tech/tech-startups-are-handing-out-free-nicotine-pouches-to-boost-productivit...
1•croes•16m ago•1 comments

Show HN: Shipping Without Judgment

https://dantelex.com/blog/shipping-judgement
2•lexokoh•20m ago•0 comments

ADF Opus: open, browse, and manage Amiga .ADF disk-images natively

https://github.com/chironb/ADFOpus2025
1•doener•22m ago•0 comments

Minimig RTG Magic [video]

https://www.youtube.com/watch?v=DBO9sD6EYS4
1•doener•25m ago•0 comments

GNU Ddrescue 1.30 Orders of Magnitude Better Working on Drives with a Dead Head

https://www.phoronix.com/news/GNU-ddrescue-1.30
3•Qem•26m ago•0 comments

Riot Games's League of Legends login issues due to expired SSL certificate

https://old.reddit.com/r/leagueoflegends/comments/1q40aen/comment/nxpij3c/
2•dossy•29m ago•1 comments

Voting for Mayor Who Promised to Blow Up City Doesn't Mean I Approve of It

https://www.mcsweeneys.net/articles/voting-for-the-mayor-who-promised-to-blow-up-the-city-doesnt-...
3•Geekette•31m ago•0 comments

How the sugar industry bought out scientists for decades

https://www.extremetech.com/extreme/235472-how-the-sugar-industry-bought-out-scientists-for-decad...
2•aldarion•35m ago•0 comments

Show HN: Airgapped Android Setup with a Makefile

https://blog.thisago.com/announcement/20260104-phoneSetup1.html
1•thisago•38m ago•0 comments

NeXTSTEP on Pa-RISC

https://www.openpa.net/nextstep_pa-risc.html
1•andsoitis•38m ago•0 comments

Alexa+ at Your Fingertips

https://alexa.amazon.com/about
1•qainsights•41m ago•1 comments

2026: The year of Not-invented-here syndrome

https://system32.ai/blogs/nih-on-steroids
3•bitlad•44m ago•0 comments

Warren Buffett emails Microsoft exec

https://www.techemails.com/p/warren-buffett-emails-microsoft-exec-jeff-raikes
4•cinaboniver•49m ago•1 comments

Show HN: Turn meetings into summaries, presentations, and an AI to ask questions

https://notefy.pro/
1•jimmydin7•51m ago•0 comments

Ask HN: What AI systems have you adopted across your work and personal life?

1•alexjray•56m ago•2 comments

Chromosome region linked to neurodev disorders influences locomotor behavior

https://www.nature.com/articles/s41467-025-68047-y
4•bookofjoe•1h ago•1 comments

Wallpaper Symmetry

https://math.hws.edu/eck/js/symmetry/wallpaper.html
4•xnx•1h ago•0 comments

The most impressive 15min tech demo you've never seen [video]

https://www.youtube.com/watch?v=72y2EC5fkcE
2•thundergolfer•1h ago•4 comments

"HP-UX hits end-of-life today, and I'm sad"

https://www.osnews.com/story/144094/hp-ux-hits-end-of-life-today-and-im-sad/
11•SanjayMehta•1h ago•1 comments

The Napoleon Technique: Postponing Things to Increase Productivity

https://effectiviology.com/napoleon/
2•Khaine•1h ago•0 comments

Waymo wants to be Big Tech's nice guy. Will San Francisco buy it?

https://www.sfchronicle.com/sf/article/waymo-car-san-francisco-21270363.php
1•mikhael•1h ago•0 comments

Show HN: OBTF-2, simple notes with screenshots

https://vgkids.github.io/obtf-2/
1•james_marks•1h ago•0 comments

'Moral injury' officially recognized as mental health condition

https://hsph.harvard.edu/news/moral-injury-officially-recognized-as-mental-health-condition/
2•rendx•1h ago•0 comments