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

Sel – short film lauren flinner

https://www.youtube.com/watch?v=rhCn9DgOSiI
1•marysminefnuf•3m ago•0 comments

Kee – Key combination matching on the modern web

https://github.com/juzerzarif/kee
1•juzerzarif•8m ago•1 comments

Show HN: PeriodicTableOfElements.org

https://periodictableofelements.org/?lang=en
1•nadermx•25m ago•0 comments

Social media is populist and polarising; AI may be the opposite

https://www.ft.com/content/3880176e-d3ac-4311-9052-fdfeaed56a0e
1•malloryerik•25m ago•1 comments

Show HN: Anamnesis – Open-source 4D strategic memory engine for AI agents

https://github.com/gayawellness/anamnesis
1•gayawellness•26m ago•0 comments

Pretext Demos

https://chenglou.me/pretext/
1•vinhnx•27m ago•0 comments

Alzheimer's disease mortality among taxi and ambulance drivers (2024)

https://www.bmj.com/content/387/bmj-2024-082194
2•bookofjoe•31m ago•0 comments

pbix-mcp — create and modify Power BI PBIX files in pure Python

https://github.com/d0nk3yhm/pbix-mcp
2•d0nk3yhm•35m ago•0 comments

Translating non-trivial codebases with Claude

https://blog.danieljanus.pl/2026/03/26/claude-nlp/
1•vinhnx•38m ago•0 comments

Catching crumbs from the table by Ted Chiang (2000) [pdf]

https://gwern.net/doc/fiction/science-fiction/2000-chiang.pdf
2•sendes•40m ago•1 comments

The Opt Out Project

https://www.optoutproject.net/
3•billybuckwheat•42m ago•0 comments

BubbleWrap your dev env and agents

https://dpc.pw/posts/bubblewrap-your-dev-env-and-agents/
1•vinhnx•44m ago•0 comments

A simple explanation of the key idea behind TurboQuant

https://old.reddit.com/r/LocalLLaMA/comments/1s62g5v/a_simple_explanation_of_the_key_idea_behind/
1•thunderbong•48m ago•0 comments

IN Event of Moon Disaster [pdf]

https://www.archives.gov/files/presidential-libraries/events/centennials/nixon/images/exhibit/rn1...
1•interweb•52m ago•0 comments

Anthropic's Mythos leak: 3k files in a public CMS, and what the docs revealed

https://medium.com/ai-advances/anthropic-claude-mythos-leak-analysis-b77c1b304eb8
4•Aedelon•56m ago•0 comments

Git City – Your GitHub as a 3D City

https://www.thegitcity.com
2•fcoury•59m ago•0 comments

Seattle opens first light rail across floating bridge

https://www.fox13seattle.com/news/seattle-train-floating-bridge
2•whiskey-one•1h ago•0 comments

Ask HN: How are you keeping AI coding agents from burning money?

2•bhaviav100•1h ago•2 comments

What's Banned on Your Block?

https://www.strongtownschicago.org/whats-banned-on-your-block
1•animal_spirits•1h ago•0 comments

Motorola 88000

https://en.wikipedia.org/wiki/Motorola_88000
3•doener•1h ago•1 comments

We spent 2 hours working in the future

https://metr.org/notes/2026-03-19-org-uplift-game/
2•gmays•1h ago•0 comments

Dashboards Are Already Dead

https://joshsymonds.com/blog/dashboards-are-already-dead/
2•Veraticus•1h ago•1 comments

Liberate Your OpenClaw

https://huggingface.co/blog/liberate-your-openclaw
1•cezarvil•1h ago•0 comments

Milawa on Jitawa, a Verified Theorem Prover

http://lambda-the-ultimate.org/node/4464
1•poppingtonic•1h ago•0 comments

Codex Use Cases

https://developers.openai.com/codex/use-cases
1•AnhTho_FR•1h ago•0 comments

How Japan's Shiitake mushrooms fuel a $740M global Shiitake industry [video]

https://www.youtube.com/watch?v=XuJ5HsV8mlQ
1•teleforce•1h ago•0 comments

OpenClaw Is LangChain 2.0

https://justinflick.com/2026/03/28/openclaw-is-langchain-2.html
2•pamplemeese•1h ago•0 comments

Linux 7.0-Rc6 Bringing a Lot of Audio Quirks / Fixes

https://www.phoronix.com/news/Linux-7.0-rc6-Many-Audio-Fixes
2•Bender•1h ago•0 comments

Saudi Pipeline to Bypass Hormuz Hits 7M Barrel Goal

https://www.bloomberg.com/news/articles/2026-03-28/saudi-pipeline-that-bypasses-hormuz-hits-7-mil...
6•geox•1h ago•0 comments

Ghst – an experimental, full-featured CLI for managing Ghost CMS sites

https://github.com/TryGhost/ghst
1•Curiositry•1h ago•0 comments