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?

Notes on Skill.md vs. MCP

https://taoofmac.com/space/notes/2026/01/14/0830
1•rcarmo•50s ago•0 comments

Show HN: Claude CodePro – Professional Development Environment for Claude Code

https://github.com/maxritter/claude-codepro
1•rittermax•1m ago•0 comments

Reversing YouTube's "Most Replayed" Graph

https://priyavr.at/blog/reversing-most-replayed/
1•prvt•1m ago•1 comments

Show HN: MCP-add` a CLI to add your MCP server to various clients with ease

https://github.com/paoloricciuti/mcp-add
1•pablopang•2m ago•0 comments

UK Officials could face US entry ban over Twitter policy

https://parliamentnews.co.uk/uk-officials-could-face-us-entry-ban-over-x-policy
1•OgsyedIE•2m ago•0 comments

Peter Girnus: "Last quarter I rolled out Microsoft Copilot to 4k employees."

https://twitter.com/i/status/1999124665801880032
1•bthallplz•7m ago•0 comments

A post-American, enshittification-resistant internet [video]

https://www.youtube.com/watch?v=3C1Gnxhfok0
1•rcy•7m ago•0 comments

Show HN: Django Smart Ratelimit – Async, fault-tolerant rate limiting for Django

https://github.com/YasserShkeir/django-smart-ratelimit
1•yassershkeir•8m ago•0 comments

Show HN: Bytepad – a minimal, no-nonsense, open-source note-taking app

https://github.com/samitugal/bytepad
1•samitugal•9m ago•0 comments

Show HN: Sharpie, the C# Fantasy Console Disguised as an Emulator

https://github.com/ChristosMaragkos/Sharpie
1•NeverBugFree•11m ago•1 comments

Show HN: What shipped this week? now you can just ask

1•inferno22•14m ago•0 comments

Me and the Machine

https://mitsuhiko.github.io/talks/me-and-the-machine/#1
1•tosh•16m ago•0 comments

MCP Server that Manages IntelliJ [video]

https://www.youtube.com/watch?v=6ByedA15n8Q
2•jonnyzzz•18m ago•1 comments

The Japanese reading problem that made me build my own app

https://blog.kulman.sk/japanese-reading-problem/
1•ig0r0•18m ago•0 comments

The $200K Developer Dream Is Over – Here's the Reality in 2026

https://medium.com/@sovannaro/the-200k-developer-dream-is-over-heres-the-reality-in-2026-b8718dc8...
2•cumo•18m ago•0 comments

Free browser-based tools for CSV, JSON, and Excel files

https://www.formatlab.io/
1•darhl•19m ago•1 comments

Using Canonical Log Lines for Online Visibility (2016)

https://brandur.org/canonical-log-lines
1•tosh•24m ago•0 comments

Porting MiniJinja to Go with an Agent

https://lucumr.pocoo.org/2026/1/14/minijinja-go-port/
1•keybits•26m ago•0 comments

One for the Treble, Two for the Time

https://tigerbeetle.com/blog/2026-01-14-bitemporality/
6•jorangreef•28m ago•0 comments

UK secures record supply of offshore wind projects

https://www.bbc.co.uk/news/articles/cn9zyx150xdo
9•ljf•28m ago•8 comments

Implementing DistBelief (2018)

https://jcaip.github.io/Distbelief/
1•thomasjb•29m ago•0 comments

logfmt (2013)

https://brandur.org/logfmt
2•tosh•30m ago•0 comments

The Volkswagen ID. Buzz Won't Get a 2026 Model

https://insideevs.com/news/782418/vw-id-buzz-electric-bus-canceled-2026/
2•teleforce•32m ago•0 comments

The proposed design of the digital euro: A critical analysis

https://link.springer.com/article/10.1007/s42521-025-00171-2
3•gnufx•33m ago•0 comments

Daniel Dennett: Where am I? [pdf]

https://www.lehigh.edu/~mhb0/Dennett-WhereAmI.pdf
1•georgestrakhov•34m ago•1 comments

Show HN: Riemann Hypothesis Attempt (Academia Link) – Please Discuss

https://www.academia.edu/145999987/The_Spectral_Geometric_Proof_of_the_Riemann_Hypothesis_An_Isom...
1•MohskiBroskiAI•36m ago•0 comments

The Wall Looks Permanent Until It Falls

https://data4democracy.substack.com/p/the-wall-looks-permanent-until-it
1•maxerickson•37m ago•0 comments

Show HN: Simple time zone converter and world clock for everyone

https://www.usetizo.com/
2•yelston•39m ago•0 comments

Show HN: Tiny FOSS Compass and Navigation App (<2MB)

https://github.com/CompassMB/MBCompass
8•nativeforks•40m ago•2 comments

Show HN: I built a lightweight banner tool because existing ones felt overkill

https://www.usepomo.com/
2•yelston•40m ago•0 comments