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?

"Tyler Cowen's AI Campus"

https://marginalrevolution.com/marginalrevolution/2026/01/tyler-cowens-ai-campus.html
1•7777777phil•12s ago•0 comments

A minimal word swap online game for spending your time

https://www.quizforfun.com/game/word-swap-game-fix-the-letters/
1•yavona•1m ago•0 comments

Geometric Hallucination Detection via Directional Consistency in Embedding Space

https://cert-framework.com/docs/research/dc-paper
1•nchagnet•2m ago•0 comments

Show HN: TV updates in ur mail to save time and get to point for TV Enthusiasts

https://releasestv.substack.com/
1•karanveer•3m ago•0 comments

Next on Intrigue: Ransom Man

https://www.bbc.com/audio/brand/m0000nfh
1•jruohonen•5m ago•0 comments

/Rams

https://www.rams.ai/
1•handfuloflight•11m ago•0 comments

Ui.dev and Fireship Join Forces

https://fireship.dev/uidotdev-and-fireship-join-forces
1•tmvnty•13m ago•0 comments

Show HN: Goran AI – Turn every sales call into team intelligence and playbooks

https://www.meetgoran.com/
1•Mrakermo•15m ago•0 comments

$14.1T. Zero Votes. How America Lost Its Republic to an Unelected Empire

https://twitter.com/DefiyantlyFree/status/2012345557553996061
2•bilsbie•15m ago•0 comments

Why Rust solves a problem we no longer have

https://rochuskeller.substack.com/p/why-rust-solves-a-problem-we-no-longer
1•guenthert•17m ago•1 comments

Evidence That Musk Is the Chief Engineer of SpaceX

https://old.reddit.com/r/SpaceXLounge/comments/k1e0ta/evidence_that_musk_is_the_chief_engineer_of...
1•bilsbie•17m ago•0 comments

Automation Tools Are Overkill for 90% of People

https://traulmen.blogspot.com/2026/01/automation-ai-tools-why-most-beginners.html
1•Traumen•19m ago•2 comments

The Emperor of Ice-Cream

https://cog.cnrs.fr/emperor.html
1•agarttha•20m ago•1 comments

Whistleblower drops 'largest ever' ICE leak to unmask agents

https://vechron.com/2026/01/whistleblower-drops-largest-ever-ice-leak-to-unmask-agents/
2•GeorgeWoff25•23m ago•0 comments

The Risks of AI in Schools Outweigh the Benefits, Report Says

https://www.npr.org/2026/01/14/nx-s1-5674741/ai-schools-education
1•backpackerBMW•25m ago•0 comments

OpenAI brings advertising to ChatGPT in push for new revenue

https://www.ft.com/content/ec1656cd-e07b-48ed-92a8-26c7fe517899
2•1vuio0pswjnm7•29m ago•0 comments

Fast Pair, loose security: Bluetooth accessories open to silent hijack

https://www.theregister.com/2026/01/17/fast_pair_flaw/
2•Bender•30m ago•0 comments

NotiFilter: Silence Annoying Notifications

https://github.com/BURG3R5/NotiFilter
1•thunderbong•33m ago•0 comments

New 'StackWarp' Attack Threatens Confidential VMs on AMD Processors

https://www.securityweek.com/new-stackwarp-attack-threatens-confidential-vms-on-amd-processors/
2•Bender•34m ago•0 comments

Names for stone skipping around the world

https://en.wikipedia.org/wiki/Stone_skipping
1•ancillary•34m ago•0 comments

Joe Rogan Experience #2440 – Matt Damon and Ben Affleck [video]

https://www.youtube.com/watch?v=AVEZBy1uAk8
2•keepamovin•35m ago•0 comments

Is there an evolutionary reason for same-sex sexual behaviour?

https://www.newscientist.com/article/2511053-is-there-an-evolutionary-reason-for-same-sex-sexual-...
1•Anon84•36m ago•0 comments

Show HN: A lightweight, no-JS landscape photo album

https://ethan.dev/album
1•Beefin•36m ago•0 comments

For 99 Years It's Been Illegal to Mail a Handgun, That Soon Could Change

https://cowboystatedaily.com/2026/01/16/wyomingites-cheer-potential-reversal-of-ban-on-mailing-guns/
1•Bender•37m ago•0 comments

An archive of letters sent to Santa this year through USPS operation Santa

https://archive.org/details/usps2025
1•elfatnorthpole•38m ago•1 comments

Show HN: Intuitive Minecraft Skin Editor - Full FOSS Rewrite, try new mobile UX

https://needcoolershoes.com
2•moxvallix•40m ago•0 comments

ChatGPT could not apply the Law of the Excluded Middle

https://chatgpt.com/share/696b7f8a-9760-8006-a1b5-89ffd7c5d2d9
1•rafaelbeirigo•41m ago•0 comments

Matthew McConaughey trademarks iconic phrase to stop AI misuse

https://www.bbc.com/news/articles/cp87z6vexl3o
1•deegles•41m ago•1 comments

Tested 31 AI detection/humanization tools – $5/mo GPTs beat $300/mo

1•khadinakbar•42m ago•0 comments

Show HN: KissMotion – AI kiss video generator from a single photo

https://aikissvideo.app
1•Yreminder•42m ago•0 comments