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?

Obscene images: X admits its mistake and stated it would comply with Indian law

https://timesofindia.indiatimes.com/india/obscene-image-row-x-admits-mistake-thousands-of-posts-o...
1•throwaway110001•3m ago•0 comments

Photos of the Forgotten

https://www.synthetrix.com/potf.html
1•exvi•7m ago•0 comments

'Fuck You, Make Me' Without Saying the Words

https://daringfireball.net/2026/01/fuck_you_make_me_without_saying_the_words
1•nopakos•12m ago•1 comments

Show HN: I built an Instagram-style productivity app with gamification

https://apps.apple.com/us/app/lockin-social-productivity/id6742454713
1•mandynoee•26m ago•1 comments

The Concise TypeScript Book

https://github.com/gibbok/typescript-book
4•javatuts•31m ago•1 comments

Worktrunk – A CLI tool to manage multiple worktrees in Git repositories

https://github.com/max-sixty/worktrunk
1•javatuts•31m ago•0 comments

Jupyter Agents: training LLMs to reason with notebooks

https://huggingface.co/blog/jupyter-agent-2
1•walterbell•32m ago•0 comments

What's the end game for Ghost newsletter sign-up spam?

https://www.autodidacts.io/ghost-newsletter-sign-up-spam/
1•Curiositry•33m ago•0 comments

A multimodal sleep foundation model for disease prediction

https://www.nature.com/articles/s41591-025-04133-4
1•gnabgib•33m ago•0 comments

Quake 1 Single-Player Map Design Theories (2001)

https://www.quaddicted.com/webarchive//teamshambler.planetquake.gamespy.com/theories1.html
1•Lammy•39m ago•0 comments

Panoply of the Weird

https://www.nybooks.com/articles/2026/01/15/panoply-of-the-weird-fitz-james-obrien/
1•mitchbob•42m ago•1 comments

Sovereign Tech Fund: Strategic investments in the digital infrastructure

https://www.sovereign.tech/programs/fund
1•teleforce•43m ago•1 comments

Show HN: WinBorg, a beautiful alternative to Vorta for BorgBackup

https://github.com/robotnikz/WinBorg
2•robotnikz•48m ago•0 comments

Reversible Computation as a software construction paradigm

1•Nivdc•50m ago•1 comments

Writing First, Tooling Second

https://susam.net/writing-first-tooling-second.html
2•Brajeshwar•53m ago•0 comments

How can I grep for lines containing foo AND bar, foo OR bar?

https://mywiki.wooledge.org/BashFAQ/079
1•kamaraju•56m ago•0 comments

Show HN: Cortex – Android Notification manager with on-device LLM

https://play.google.com/store/apps/details?id=xyz.moyelauncher.cortex&hl=en_US
1•0xManjeet•1h ago•0 comments

Apple Wallet Storage Bug Is Filling Up iPhone Space for Some Users

https://www.macobserver.com/news/apple-wallet-storage-bug-is-filling-up-iphone-space-for-some-users/
3•ksec•1h ago•2 comments

Show HN: DreamForge – AI dream journal that turns dreams into art

https://dream-forge.me
1•KenzoArai•1h ago•0 comments

Court rejects NVIDIAs attempt to seal email chain with Annas Archive [pdf]

https://storage.courtlistener.com/recap/gov.uscourts.cand.426191/gov.uscourts.cand.426191.222.0.pdf
3•1vuio0pswjnm7•1h ago•1 comments

Show HN: MCP Server for AI Agents to Publish on WriteFreely

https://github.com/laxmena/writefreely-mcp-server
1•laxmena•1h ago•0 comments

My Beef with the iOS 26 Tab Bar

https://ryanashcraft.com/ios-26-tab-bar-beef/
3•ksec•1h ago•0 comments

Tom Verlaine was a mystery. His archives reveal more of his story

https://www.nytimes.com/2026/01/09/arts/music/tom-verlaine-television-archives.html
1•tintinnabula•1h ago•0 comments

I build products to get "unplugged" from the internet

https://getunplugged.io/I-build-products-to-get-unplugged
2•keplerjst•1h ago•0 comments

New year's resolutions are arbitrary, and that's okay

https://bobbiechen.com/blog/2026/1/10/new-years-resolutions-are-arbitrary-and-thats-okay
1•bobbiechen•1h ago•0 comments

Show HN: AI Character Generator for Fashion Model Shots and Consistent Avatars

https://characteraigc.com
1•jokera•1h ago•0 comments

How to Disable Gemini on Android, Gmail, Chrome, Photos, & Google Apps

https://tuta.com/blog/how-to-disable-gemini-on-android
1•dotcoma•1h ago•0 comments

Show HN: Kings vs. Knight

https://minichessgames.com/#/play/kings-vs-knight
1•patrickdavey•1h ago•1 comments

Show HN: Shelfarr is an open source audiobook renamer tool

https://github.com/VacantlyCrushing/Shelfarr
1•vcrushing•1h ago•0 comments

'The answer cannot be nothing': The battle over Canada's mystery brain disease

https://www.bbc.com/news/articles/c623r47d67lo
52•lewww•1h ago•10 comments