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?

Scientists detect a sudden acceleration in global warming

https://www.sciencedaily.com/releases/2026/03/260309183208.htm
2•CamelCaseCondo•2m ago•1 comments

Heinzel – Guardrails that turn Claude Code into your sysadmin

https://github.com/wintermeyer/heinzel
1•wintermeyer•3m ago•0 comments

F3 – Fight Flash Fraud, tool that tests flash cards capacity and performance

https://fight-flash-fraud.readthedocs.io/en/latest/introduction.html
1•Doublon•4m ago•0 comments

Paying without Google: New consortium wants to remove custom ROM hurdles

https://www.heise.de/en/news/Paying-without-Google-New-consortium-wants-to-remove-custom-ROM-hurd...
1•ecscte•7m ago•0 comments

NemoClaw: Nvidia Is Planning to Launch an Open-Source AI Agent Platform

https://www.wired.com/story/nvidia-planning-ai-agent-platform-launch-open-source/
1•qprofyeh•8m ago•2 comments

Stay in the Loop: How I Use Claude Code

https://jola.dev/posts/stay-in-the-loop
1•joladev•12m ago•0 comments

Ask HN: Anybody using multi LLM coding workflow?

1•reacharavindh•14m ago•0 comments

The Download: murky AI surveillance laws, and the White House cracks down on de

https://www.technologyreview.com/2026/03/09/1134050/the-download-ai-surveillance-laws-white-house...
1•joozio•15m ago•0 comments

Claude PR Code Review costs $15-$25 per review

https://twitter.com/claudeai/status/2031088175456903667
1•artdigital•23m ago•0 comments

German Court Rules TCL QLED Advertising Misleading, Orders Halt

https://www.thelec.net/news/articleView.html?idxno=5692
1•ledoge•24m ago•0 comments

Show HN: I wrote an application to help me practice speaking slower

https://steady.cates.fm/
1•benja123•25m ago•0 comments

AI on a Budget: Recompiling Llama.cpp for Qwen3.5 Inference on an HP Z440

https://jeanbaptistefleury.neocities.org/importance_of_inference_engines
1•DAFtwinTurbo•26m ago•1 comments

JuicyQR – Generate QR codes that never expire, for free

https://juicyqr.com/
1•hamid914•26m ago•0 comments

Self-improving AI (Karpathy pt2)

https://xcancel.com/karpathy/status/2031135152349524125?s=20
1•razodactyl•26m ago•0 comments

ReVision Implant wins FDA breakthrough nod for vision-restoring BCI

https://www.massdevice.com/revision-implant-fda-breakthrough-vision-bci/
1•iancmceachern•30m ago•0 comments

How to send your app code to Figma using Claude Code

https://designexplained.substack.com/p/how-to-send-your-app-code-to-figma
1•kaizenb•31m ago•1 comments

Andrej Karpthy's Agent Hub

https://github.com/karpathy/agenthub/
1•AntoineN2•34m ago•0 comments

AI Gold Trading Bot reinforcement learning system for autonomous XAUUSD trading

https://github.com/forbbiden403/tradingbot
1•solosquad•36m ago•0 comments

Show HN: Isaacus – the legal AI research company

https://isaacus.com/
1•ubutler•37m ago•0 comments

Using Thunderbird for RSS

https://rubenerd.com/using-thunderbird-for-rss/
2•ingve•41m ago•0 comments

Apple M5 Pro and M5 Max CPU Analysis – M5 Max Is Not Much Faster Than the M4 Max

https://www.notebookcheck.net/Apple-M5-Pro-M5-Max-CPU-Analysis-M5-Max-is-not-much-faster-than-the...
1•ezst•45m ago•0 comments

Silicon Valley's new miracle drug [video]

https://www.youtube.com/watch?v=W0ltbBby9FU
1•chirau•46m ago•0 comments

Gone Almost Phishin'

https://ma.tt/2026/03/gone-almost-phishin/
1•jon_bossenger•51m ago•0 comments

What AI Models for War Look Like

https://www.wired.com/story/ai-model-military-use-smack-technologies/
3•jonbaer•55m ago•1 comments

Press-One: Auto-accept every Claude Code prompt

https://github.com/HalfEmptyDrum/press-one
7•EmptyDrum•57m ago•2 comments

Show HN: Envelope – Open-source email API for AI agents (BYO email, MCP)

https://github.com/tymrtn/U1F4E7
1•tmrtn•58m ago•0 comments

Can the Dictionary Keep Up?

https://www.thenation.com/article/culture/stefan-fatsis-dictionary-history/
1•pepys•58m ago•0 comments

Iran War; Pyrrhic Victory

https://waterofmarch.substack.com/p/iran-war-pyrrhic-victory
2•PonDiDancefloor•58m ago•0 comments

This Intel Panther Lake mini PC is as thin as a laptop

https://liliputing.com/this-intel-panther-lake-mini-pc-is-as-thin-as-a-laptop/
1•rezaprima•58m ago•0 comments

Ask HN: What are your favorite books?

2•amunozo•1h ago•2 comments