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•6mo 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•6mo 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•6mo 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•6mo 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•6mo ago
Load test against a clone instead of a DB whose contents you care about?

Dodge City, Kansas History – Ford County Historical Society

https://fordcountyhistory.org/dodge-city-kansas-history/
1•pkaeding•3m ago•0 comments

Scaling Socket from Zero to 10k Organizations

https://socket.dev/blog/scaling-socket-from-zero-to-10000-organizations
1•feross•4m ago•0 comments

A Defense Against Alzheimer's Disease

https://www.rutgers.edu/news/inspired-familys-struggle-scientist-helps-uncover-defense-against-al...
1•gmays•6m ago•0 comments

Google Antigravity vibe-codes user's drive out of existence

https://www.theregister.com/2025/12/01/google_antigravity_wipes_d_drive/
1•smnthermes•6m ago•0 comments

Ask HN: Can drones document a house for insurance claims

1•kaihongye4•9m ago•0 comments

Show HN: NeurIPS 2025 Poster Navigator

https://neurips2025.tiptreesystems.com/
1•martincsweiss•12m ago•0 comments

Universal Constants Derived from Pure Geometry

https://github.com/Cosmolalia/akataletos-geodesic-constants-2025/blob/main/
1•obius_prime•12m ago•4 comments

Galaxy Z TriFold

https://news.samsung.com/global/introducing-galaxy-z-trifold-the-shape-of-whats-next-in-mobile-in...
3•perryizgr8•15m ago•0 comments

Show HN: WizWhisp – Offline, Whisper Transcription GUI for Windows

https://apps.microsoft.com/detail/9pgq3h6jxl4c?hl=en-US&gl=US
1•logicflux•16m ago•0 comments

Computer Vision in 512 Bytes

https://www.hackster.io/news/computer-vision-in-512-bytes-e36b481762f3
1•xou•18m ago•0 comments

Band of brothers: how the war crushed a cohort of young Ukrainians

https://www.reuters.com/investigations/band-brothers-how-war-crushed-cohort-young-ukrainians-2025...
1•petethomas•19m ago•0 comments

Solutions for Building an Online Store

1•ed0522•23m ago•0 comments

Show HN: SupportInfo.. A scratch my own itch project

https://supportinfo.io/
1•launchaddict•24m ago•1 comments

Ask HN: Others seeing agents do remarkable things when given their own logs?

3•jMyles•35m ago•0 comments

EU investigates Google over 'demoting' commercial content from news media

https://www.theguardian.com/technology/2025/nov/13/eu-investigates-google-search-over-demoting-co...
1•PaulHoule•41m ago•0 comments

Ngrok in the macOS menu bar with just 45 lines of code using SwiftBar

https://github.com/PaulMcInnis/ngrok-desktop
1•paulm7242•44m ago•1 comments

Show HN: Net RazorConsole – Build Interactive TUI with Razor and Spectre.Console

https://razorconsole.github.io/RazorConsole/
3•BigBigMiao•47m ago•0 comments

Supreme Court hears case that could trigger big crackdown on Internet piracy

https://arstechnica.com/tech-policy/2025/12/supreme-court-debates-whether-isps-must-kick-pirates-...
1•fizl•47m ago•0 comments

No, AI hasn't just "learned to lie"

https://iacgm.com/articles/lying/
1•iacgm•50m ago•0 comments

Would love feedback on our new 'Lazy Loading' architecture for PII redaction

https://github.com/rom-mvp/vigil
1•desadas•54m ago•1 comments

Steam on Linux Use Easily Hits an All-Time High in November

https://store.steampowered.com/hwsurvey/Steam-Hardware-Software-Survey-Welcome-to-Steam
4•systematizeD•59m ago•0 comments

Mathematics Without Numbers (1959)

https://www.jstor.org/stable/20026529?seq=1
2•measurablefunc•59m ago•0 comments

The Waterloo map that Wellington had to know Napoleon would die for

https://ageofrevolution.org/200-object/waterloo-map/
1•gsf_emergency_6•1h ago•0 comments

Prevent a page from scrolling while a dialog is open

https://css-tricks.com/prevent-a-page-from-scrolling-while-a-dialog-is-open/
2•soheilpro•1h ago•0 comments

Claude 4.5 Opus Soul Document, which has now been confirmed by Anthropic

https://gist.github.com/Richard-Weiss/efe157692991535403bd7e7fb20b6695
3•simonw•1h ago•1 comments

MKBHD's wallpaper app Panels is shutting down

https://techcrunch.com/2025/12/01/mkbhds-wallpaper-app-panels-is-shutting-down/
4•coloneltcb•1h ago•2 comments

At the Cottage

https://objects.fun/blog/2025-08-04-cottagecore/
1•adamfuhrer•1h ago•0 comments

Can Messaging Apps Implement SIM Binding Without OS Provider Support?

https://www.medianama.com/2025/12/223-sim-binding-guidelines-os-providers-messaging-apps-impact-u...
1•pabs3•1h ago•0 comments

Why the Sanchar Saathi App Pre-Installation on Smartphones Is a Privacy Concern?

https://www.medianama.com/2025/12/223-govt-sanchar-saathi-app-pre-installation-smartphones-privacy/
1•pabs3•1h ago•0 comments

ProofQR – a blockchain-based QR code verification system

https://www.proofqr.xyz
1•TomatoProgram•1h ago•1 comments