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

Crow Watch: A Hacker News Alternative

https://crow.watch
1•medv•3m ago•0 comments

Analysis of Ninth Circuit Allows TOS Amendment by Email–Ireland-Gordy vs. Tile

https://blog.ericgoldman.org/archives/2026/03/ninth-circuit-allows-tos-amendment-by-email-ireland...
1•hazzamanic•4m ago•0 comments

Terence Tao: Formalizing a proof in Lean using Claude Code [video]

https://www.youtube.com/watch?v=JHEO7cplfk8
1•helloplanets•5m ago•0 comments

Apple: The first 50 years, CBS Sunday Morning [video]

https://www.youtube.com/watch?v=7bA2w7uwUbs
1•oldnetguy•9m ago•0 comments

NSF National Deep Inference Fabric

https://ndif.us/
1•pramodbiligiri•11m ago•0 comments

CorridorKey – Perfect Green Screen Keys

https://github.com/nikopueringer/CorridorKey
1•h4kor•14m ago•0 comments

Shockwave Player Reimplemented in Rust and WASM

https://github.com/igorlira/dirplayer-rs
2•njaremko•16m ago•0 comments

How to win slots and influence people

https://www.bloomberg.com/features/2026-stake-drake-crypto-casino-adin-ross-gambling/
3•simonebrunozzi•19m ago•0 comments

Ask HN: Where do all the laid off devs hang out?

2•fud101•21m ago•0 comments

Set-OutlookSignatures v4.26.0 support for M365 sovereign clouds

https://set-outlooksignatures.com/
1•explicitcons•23m ago•1 comments

Show HN: TrustScan – Simplify privacy policies and audit GDPR compliance

https://trustscan.dev
1•hafizjavid•24m ago•1 comments

Every business will have AGI by 2027

https://nuggetz.ai/articles/every-business-will-have-agi-by-2027
4•ezisezisezis•27m ago•0 comments

Show HN: Marketing Content Generator AI-powered multi-channel content platform

https://devpost.com/software/marketing-content-generator-ch4p2q
3•gaborishka•27m ago•0 comments

Show HN: I built a mini PowerBI for tech comps with no dev experience with Codex

https://gotham-web.onrender.com/
1•muhneesh•30m ago•0 comments

Fontcrafter: Turn Your Handwriting into a Real Font

https://arcade.pirillo.com/fontcrafter.html
1•rendx•31m ago•0 comments

Show HN: cursor-tg – Run Cursor Cloud Agents from Telegram

https://github.com/tb5z035i/cursor-tg
1•tb5z035i•33m ago•0 comments

MoltBrowser MCP

https://github.com/Joakim-Sael/moltbrowser-mcp
2•geobotPY•34m ago•1 comments

Show HN: FretBench – I tested 14 LLMs on reading guitar tabs. Most failed

https://fretbench.tymo.ai/blog/i-asked-14-ai-models-to-read-guitar-tabs/
1•jmcapra•35m ago•0 comments

Show HN: NirvaCrop – Offline Python tool for batch video cropping

https://nirvasoft.gumroad.com/l/ffdoc
1•Ashwiniakash•35m ago•1 comments

A sneak preview behind an embedded software factory. I suspect "rad" is back

https://ghuntley.com/rad/
1•ghuntley•43m ago•0 comments

Sumi – Open-source voice-to-text with local AI polishing

2•alkd•43m ago•0 comments

Show HN: U-Claw – An Offline Installer USB for OpenClaw in China

https://www.u-claw.org/
1•17vibe•45m ago•0 comments

Replaced by a Goldfish

https://clawd.it/posts/10-replaced-by-a-goldfish/
4•patrikgro•48m ago•0 comments

Why AI Agents Need Email Guardrails

https://molted.email/blog/why-ai-agents-need-email-guardrails
2•spacesh1psoda•48m ago•0 comments

SQLite: Query Result Formatting in the CLI

https://www.sqlite.org/climode.html
1•thunderbong•50m ago•0 comments

Seedance2.0 and OmniVideo: AI video creation from text and images – experiences?

1•hongxiao•51m ago•0 comments

Kairos – real-time AI that cross-verifies news before answering (Python, 90KB)

1•joshuaveliyath•53m ago•0 comments

A short guide to email opening lines

https://www.economist.com/business/2026/03/05/a-short-guide-to-email-opening-lines
1•petethomas•56m ago•0 comments

MiniMax Music 2.5 – AI Music Generation Model for Fast Song Creation

https://www.minimax-music.com/minimax-music-2-5
2•cy20251210•56m ago•1 comments

Is Europe's AI Darling Mistral Becoming a Consultant?

https://www.bloomberg.com/news/newsletters/2026-03-03/europe-s-ai-darling-mistral-looks-more-like...
2•flawn•58m ago•1 comments