frontpage.
newsnewestaskshowjobs

Open Source @Github

fp.

Open in hackernews

Ask HN: How can I load test PostgreSQL but avoid changing actual data?

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

Nvidia board urged to consider 'return of Jensen Huang' by two major investors

https://www.cnbc.com/2026/11/14/nvidia-investors-jensen-huang-return-board-letter.html
3•pretext•2m ago•0 comments

GCVE is a fresh, open approach to vulnerability identification and numbering

https://gcve.eu/
1•adulau•2m ago•0 comments

Fixing a WebKit bug to see if promises are made of train tracks

https://alistair.sh/thenables
1•dverlaeckt80•5m ago•0 comments

AI School Bus Cameras Cash in on Drivers Who Fail to Stop

https://www.techspot.com/news/114489-america-school-buses-becoming-ai-powered-ticket-machines.html
3•gnabgib•7m ago•0 comments

Show HN: AI Time Estimator – how long Claude Code will take, from your own logs

https://github.com/noambrand/ai-time-estimator
2•Noambbb•8m ago•0 comments

Part Time Monkey

https://www.parttimemonkey.com/jono/
1•bookofjoe•9m ago•0 comments

AI Company Employees Should Unionize

https://www.nature.com/articles/d41586-025-00649-4
1•JimmyBuckets•9m ago•2 comments

Where We'll Live in the Future

https://www.chrbutler.com/where-we-will-live-in-the-future
2•delaugust•13m ago•0 comments

The Ontological Divergence of Artificial Intelligence

https://medium.com/@smoking2man/the-ontological-divergence-of-artificial-intelligence-from-person...
1•Aldus551•13m ago•0 comments

A 27-byte telemetry response nobody reads freezes Claude Desktop every two days

https://blog.dfb.sh/blog/claude-desktop-freeze/
2•lladnar•13m ago•0 comments

An open letter to the Nvidia Board of Directors

https://standwithjensen.com/#letter
2•matco11•14m ago•1 comments

A simple website to test if your bot is detectable

https://botstop.io/
2•incolumitas•15m ago•1 comments

Big Tech's Left Turn

https://www.status.news/p/midterm-elections-big-tech-elon-musk-mark-zuckerberg-jeff-bezos
2•ibn_khaldun•18m ago•1 comments

Lirz Ads

https://www.lirz.com
1•DevElif•20m ago•0 comments

Taboos and Self-Censorship Among U.S. Psychology Professors (2025)

https://journals.sagepub.com/doi/10.1177/17456916241252085
1•mpweiher•21m ago•0 comments

Show HN: Flipbook Foundry – animated stick figures baked into a font

https://flipbook-foundry.pages.dev/
1•arbourtrary•21m ago•1 comments

Show HN: Blaris – Windowless Random-Access LZSS for Constrained Microcontrollers

https://github.com/lis05/blaris
1•lis05•22m ago•0 comments

PinNote – Pin notes to your iPhone Lock Screen

https://apps.apple.com/us/app/pinnote-lock-screen-notes/id6809535973
1•makerjun•24m ago•0 comments

Show HN: Coppice – A local desktop app for multi-agent coding

https://github.com/fertile-org/coppice
2•bahung1221•26m ago•0 comments

Ask HN: Is there a way to use Gemini API Keys with Antigravity?

2•_voidtrace•27m ago•0 comments

Jensen's Been Moving Lately

https://www.reddit.com/r/wallstreetbets/comments/1xw2xyu/how_jensens_been_moving_lately/
3•Betelbuddy•31m ago•0 comments

Show HN: In-browser object removal, 1s on WebGPU, photo never leaves your device

https://wipe.photos/
1•g58892881•31m ago•1 comments

Show HN: Model-share – see which Claude models used your weekly limit

https://github.com/shubhamverma8991/claude-model-share
1•shubhverma8991•33m ago•0 comments

Show HN: Chopper, a tiny edge model that keeps only useful text in 50 ms

https://github.com/wiiiktor/chopper_demo
1•wiiiktor•35m ago•0 comments

Nonna's ragù: AI skill files only get you started

https://andreaazzini.com/notes/nonnas-ragu
1•azzarcher•37m ago•0 comments

Caruana Hits 2800, Within 7.2 Points of Carlsen's World No. 1 Spot

https://www.chess.com/news/view/2026-total-chess-world-championship-tour-pilot-day-4
1•haunter•39m ago•0 comments

The VHDL standard's float package gets sqrt(2) wrong

https://github.com/lmtlssss/speedrunpapi/tree/main/hardware/audit/ieee-float-pkg
8•lmtlssss•42m ago•2 comments

Christophe Pettus: Stop Using AI to Report PostgreSQL Bugs

https://thebuild.com/blog/stop-using-ai-to-report-postgresql-bugs/
5•omegaSigma95•42m ago•1 comments

LLMs as Consensus Machines

https://hollisrobbinsanecdotal.substack.com/p/thinking-inside-the-box
1•HR01•43m ago•0 comments

Polo: A Wayland Mate Compositor

https://lwn.net/Articles/1107152/
5•bashhq_r•44m ago•1 comments