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?

How can we make asking easier?

https://www.beyondwritingcode.com/2026/01/21/how-can-we-make-asking-easier.html
1•mooreds•51s ago•0 comments

Remotely unlocking an encrypted hard disk

https://jyn.dev/remotely-unlocking-an-encrypted-hard-disk/
1•Klaster_1•1m ago•0 comments

Should the United States Authorize Privateers; Historical Case of Privateering [video]

https://www.youtube.com/watch?v=SaBf9z3vg0k
1•sbuttgereit•1m ago•0 comments

Show HN: Swish Finance – a zero-click way to watch your portfolio

https://www.swishfinance.app/
1•trympet•2m ago•0 comments

US set to quit World Health Organization

https://www.reuters.com/business/healthcare-pharmaceuticals/us-set-quit-world-health-organization...
1•geox•3m ago•0 comments

Show HN: A Node Based Editor for Three.js Shading Language (TSL)

https://www.tsl-graph.xyz/
2•bhushanwtf•4m ago•0 comments

You're in a computer literacy filter bubble

https://www.autodidacts.io/computer-literacy-filter-bubble/
2•Curiositry•5m ago•0 comments

Launch HN: Constellation Space (YC W26) – AI for satellite mission assurance

https://constellation-io.com/
3•kmajid•6m ago•0 comments

Carapace

https://carapace.sh/
1•thayne•6m ago•1 comments

Conductivity of warm dense matter via ThZ spectroscopy and electron diffraction

https://www.nature.com/articles/s41467-025-65559-5
1•PaulHoule•6m ago•0 comments

Unbiased world news on a map – just facts, no editorial spin

https://apps.apple.com/fr/app/azimut-newsbreak-app-map/id6757921409
2•angel_gfroy•7m ago•1 comments

PDX Phở

https://pho.curtisbarnard.com/
1•oregoncurtis•7m ago•1 comments

Why Your Voice Cloning Sounds Fake (and How to Fix It)

https://gradium.ai/blog/voice-cloning-sounds-fake
2•pain_perdu•8m ago•0 comments

The Simplest Advice I Ever Got About Loneliness

https://soonly.com/simplest-advice-about-loneliness/
1•stroz•8m ago•0 comments

Commodore 64 Ultimate Review [video]

https://www.youtube.com/watch?v=UtLR4nXAm4w
1•skibz•8m ago•0 comments

Show HN: A registry for curated, high quality Claude skills and skillsets

https://noriskillsets.dev/
4•ritammehta•9m ago•0 comments

We built a museum exhibit about a 1990s game hint line, with a physical binder

https://yarnspinner.dev/blog/hint-line-93/
1•parisidau•12m ago•0 comments

Primary Emotional Systems and Personality: An Evolutionary Perspective (2017)

https://www.frontiersin.org/journals/psychology/articles/10.3389/fpsyg.2017.00464/full
1•bfoks•15m ago•0 comments

Paul Bertorelli on the Future of Aviation Journalism: It's Challenging

https://avbrief.com/paul-bertorelli-on-the-future-of-aviation-journalism-its-challenging/
1•Stevvo•16m ago•0 comments

Ask HN: Do you have side income as a software engineer?

5•andrewstetsenko•16m ago•1 comments

Show HN: isometric.nyc – giant isometric pixel art map of NYC

https://cannoneyed.com/isometric-nyc/
9•cannoneyed•17m ago•1 comments

Show HN: Brickify – Webapp to convert 3D models into Lego brick assemblies

https://brickify.ad-si.com
2•adius•17m ago•0 comments

GitHub "Files Changed" Tab Change?

1•nonethewiser•18m ago•0 comments

Show HN: Desktop‑2FA – offline open‑source TOTP authenticator for desktop

https://desktop-2fa.lukasz-perek.workers.dev/
1•wrogistefan•19m ago•0 comments

Show HN: I'm tired of my LLM bullshitting. So I fixed it

2•BobbyLLM•19m ago•0 comments

My friend built a tool to detect when to post on socials starting with this one

https://hadaa.app/hn_dashboard
2•muriithiKabogo•19m ago•1 comments

STL Editing with FreeCAD

https://hackaday.com/2026/01/22/stl-editing-with-freecad/
1•rbanffy•21m ago•0 comments

Iran has now been under a national internet blackout for two full weeks

https://twitter.com/netblocks/status/2014375236674675147
1•beejiu•22m ago•0 comments

Easy Measures Doing, Simple Measures Understanding

https://blog.jim-nielsen.com/2026/easy-vs-simple/
1•sibeliuss•23m ago•0 comments

Notebook.link: The Future of Notebook Sharing

https://medium.com/@QuantStack/introducing-notebook-link-the-future-of-notebook-sharing-5de900a97b4a
7•SylvainCorlay•23m ago•2 comments