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?

Your Own AI Developer on GitHub

https://rellfy.com/blog/your-own-ai-developer-on-github/
1•rellfy•5m ago•0 comments

ClipMind – Search your clipboard by meaning using local embeddings

https://github.com/arpitg1304/clipmind
1•agog13•6m ago•1 comments

Building a Year-Long Battery-Powered Wi-Fi Temperature Sensor

https://medium.com/@lee.harding/building-a-year-long-battery-powered-wifi-temperature-sensor-8b1d...
1•mlhpdx•6m ago•0 comments

Moltbook

https://www.moltbook.com/
2•teej•8m ago•1 comments

Medical journal publishes a letter on AI with a fake reference to itself

https://retractionwatch.com/2026/01/28/medical-journal-publishes-a-paper-on-ai-with-a-fake-refere...
1•leephillips•9m ago•0 comments

Ask HN: How do you force yourself to take breaks while coding?

1•glidea•10m ago•1 comments

Infostealers added Clawdbot to their target lists before security teams knew

https://venturebeat.com/security/clawdbot-exploits-48-hours-what-broke
1•vismit2000•10m ago•0 comments

MoltBot Guide – Open-source AI assistant I'm betting on

https://moltai.bot
2•CaptainJack_X•13m ago•1 comments

Strangerbench: A benchmark for AI forecasting after training cut-off dates

https://github.com/firasd/strangerbench
1•firasd•15m ago•0 comments

Can a Pendulum be a Battery? [video]

https://www.youtube.com/watch?v=uqmT1GzRXWI
1•chii•18m ago•0 comments

Clay, an A.I. Sales Startup, Lets Employees Cash Out. Again

https://www.nytimes.com/2026/01/28/business/dealbook/clay-start-up-tender-offers.html
1•AbstractH24•18m ago•1 comments

Learning Without Certainty

https://sharedphysics.com/no-lessons-to-be-learned/
1•goopthink•18m ago•0 comments

Learning new libraries feels pointless and has destroyed my love of programming

1•Jumba626•22m ago•1 comments

How Replacing Developers with AI Is Going Horribly Wrong [video]

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

Piooy

https://piooy.com
2•moxiaoman•30m ago•0 comments

PicTranslate

https://pictranslate.net
1•zhouhua•33m ago•1 comments

Show HN: MetalGraph – Visual node editor for SwiftUI Metal shaders

https://www.metal.graphics/app
2•v_baro•43m ago•0 comments

House Republicans propose voting changes as Trump administration eyes midterms

https://apnews.com/article/midterms-voting-laws-photo-id-citizenship-republicans-feecb51a6efa41cf...
2•petethomas•45m ago•2 comments

4x faster network file sync with rclone (vs rsync) (2025)

https://www.jeffgeerling.com/blog/2025/4x-faster-network-file-sync-rclone-vs-rsync/
1•indigodaddy•46m ago•0 comments

Clear skies and autonomous Waymo rides at SFO

https://waymo.com/blog/2026/01/waymo-rides-at-sfo
2•standardUser•48m ago•1 comments

Mourning Didier Spaier of the slint accessibility Linux distro

https://www.freelists.org/post/slint/Very-sad-news,41
1•pabs3•52m ago•1 comments

Stargaze: SpaceX's Space Situational Awareness System

https://starlink.com/updates/stargaze
3•hnburnsy•52m ago•0 comments

Generating Mandelbrot Set Images with Kotlin

https://www.lasantha.org/blog/generating-mandelbrot-set-images-with-kotlin/
1•kiriberty•53m ago•1 comments

Understanding the Monad Design Pattern in Kotlin

https://www.lasantha.org/blog/understanding-the-monad-design-pattern-in-kotlin/
1•kiriberty•53m ago•1 comments

Tuning Random Generators: Property-Based Testing as Probabilistic Programming [pdf]

https://web.cs.ucla.edu/~todd/research/oopsla25a.pdf
1•PaulHoule•56m ago•0 comments

IO_uring Zero-Copy Large Receive Buffer Support

https://www.phoronix.com/news/IO-uring-zcrx-Large-RX
1•saurabh•57m ago•0 comments

Moltworker: Running Personal AI Agents on Cloudflare Without Hardware

https://a2aprotocol.ai/blog/2026-moltworker-complete-guide
1•QingWu•59m ago•0 comments

Show HN: I Built a Multiplayer Game in 4 Days Without Writing Code

1•fcavalcantirj•1h ago•1 comments

Deploy OpenAgents on Zeabur

https://openagents.org/blog/posts/2026-01-14-tutorial-deploying-openagents-network-on-zeabur
1•snasan•1h ago•1 comments

Anatomy of a Data Product

https://psrikanthm.github.io//data-product/
1•oneseventwonine•1h ago•0 comments