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?

Show HN: Modern Philosophy Course

https://readphilosophy.org/?w=course%2Fmilesians%2Fthales%2Fthales
1•bridelamb•22s ago•0 comments

Universal Commerce Protocol (UCP)

https://developers.google.com/merchant/ucp
2•jcfrei•7m ago•0 comments

35 Theses on the WASPs

https://scholarstage.substack.com/p/35-theses-on-the-wasps
1•barry-cotter•11m ago•0 comments

U.S. Attacked Boat With Aircraft That Looked Like a Civilian Plane

https://www.nytimes.com/2026/01/12/us/politics/us-boat-attacks-law.html
5•jbegley•12m ago•2 comments

Controlling local web servers using xbar

https://blog.gingerbeardman.com/2026/01/12/xbar-local-web-server-controller/
1•msephton•13m ago•0 comments

The will to win is nothing without the will to sleep

https://therundownbytherunningeffect.substack.com/p/the-2025-run-down-recap
2•RalphHavensPT•15m ago•0 comments

Raid on the Medway

https://en.wikipedia.org/wiki/Raid_on_the_Medway
1•vinnyglennon•17m ago•0 comments

Even Linus Torvalds is trying his hand at vibe coding (but just a little)

https://arstechnica.com/ai/2026/01/hobby-github-repo-shows-linus-torvalds-vibe-codes-sometimes/
1•fleahunter•18m ago•0 comments

Veritensor – open-source tool to scan AI models for malware and license issues

https://github.com/ArseniiBrazhnyk/Veritensor
1•arseniibr•20m ago•1 comments

Minnesota sues Trump administration to block surge of federal immigration agents

https://www.reuters.com/world/minnesota-sues-trump-administration-block-surge-federal-immigration...
5•mickle00•20m ago•0 comments

Show HN: AI Elements Vue – A Port of Vercel's AI Elements UI Library

https://github.com/vuepont/ai-elements-vue
1•peoray•22m ago•0 comments

Discord dataset of 78M messages, voice sessions, actions and servers

https://twitter.com/H4ckmanac/status/2010691804132454708
1•circularfoyers•22m ago•0 comments

Generative AI and the end of permanent car paint

https://realizeai.substack.com/p/the-evolution-of-personalization
1•rafaelmdec•22m ago•0 comments

Ask HN: DevOps Learning Resources

1•jack_pp•23m ago•0 comments

PauseOS: Distraction-Free Phone OS

https://pauseos.com/
2•MinimalAction•25m ago•1 comments

You can now reserve a hotel room on the Moon for $250k

https://arstechnica.com/space/2026/01/you-can-now-reserve-a-hotel-room-on-the-moon-for-250000/
2•dangle1•26m ago•0 comments

Great Green Wall 2.0: China is geoengineering deserts with blue-green algae

https://www.scmp.com/news/china/science/article/3338326/great-green-wall-20-china-geoengineering-...
3•jnord•26m ago•1 comments

Who told you you couldn't do that?

https://theaiunderwriter.substack.com/p/who-told-you-you-couldnt-do-that
1•participant26•29m ago•0 comments

Wireless Power Beamed from Moving Aircraft

https://spectrum.ieee.org/wireless-power-movin-airplane
1•WaitWaitWha•32m ago•0 comments

Queen bumblebees are poor foragers thanks to sparse tongue hair

https://www.sciencenews.org/article/queen-bumblebees-tongue-hair-foraging
1•WaitWaitWha•33m ago•0 comments

Nintendo Switch 2 sales stumble over Christmas

https://www.thegamebusiness.com/p/nintendo-switch-2-sales-stumble-over
1•comebhack•33m ago•0 comments

Phind Is Shutting Down

2•MekaiGS•34m ago•1 comments

Interview Coder Just Leaked Full Names and Companies of All SWEs Who Cheated [video]

https://www.youtube.com/watch?v=8T1vW85xFiQ
10•mickle00•42m ago•0 comments

Bill Ackman Funds ICE Agent GoFundMe Run by Nazi Imagery Poster

https://theintercept.com/2026/01/12/ice-gofundme-bill-ackman-jonathan-ross/
16•cdrnsf•43m ago•3 comments

Micro SD Card Extender – 68cm (26 inch) long flex cable

https://www.adafruit.com/product/3688
2•striking•45m ago•0 comments

XMPP Integration with N8n – ProcessOne

https://www.process-one.net/blog/xmpp-integration-with-n8n/
1•neustradamus•46m ago•0 comments

Clipboard Images in Claude Code CLI

https://www.woodcp.com/2026/01/clipboard-images-in-claude-code-cli/
2•tawman•48m ago•1 comments

Whatever happened to Trump Mobile's promise of a golden phone?

https://www.pbs.org/newshour/economy/whatever-happened-to-trump-mobiles-promise-of-a-golden-phone
12•type0•50m ago•0 comments

RVAA: Recursive Vision-Action Agent for Long Video Understanding

https://github.com/mohammed840/RLM-implementation
1•tmzt•52m ago•0 comments

AI's Memorization Crisis

https://www.theatlantic.com/technology/2026/01/ai-memorization-research/685552/
1•twalichiewicz•53m ago•2 comments