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?

Spanish company releases free compressed AI model

https://techcrunch.com/2026/02/24/spanish-soonicorn-multiverse-computing-releases-free-compressed...
1•mastazi•1m ago•0 comments

Gleam is straightforward, predictable and stable

https://builders.perk.com/gleam-is-boring-so-i-went-to-a-conference-about-it-8f08a52c3de3
2•crowdhailer•2m ago•0 comments

A Round Up and Comparison of 10 Open-Weight LLM Releases in Spring 2026

https://magazine.sebastianraschka.com/p/a-dream-of-spring-for-open-weight
1•MindGods•2m ago•0 comments

Show HN: Seite static site generator with MCP server and Claude Code integration

https://seite.sh/
1•sanchezomar•5m ago•0 comments

Mitochondria May Be the Key to Longevity

https://www.nytimes.com/2026/02/19/well/mitochondria-longevity-health.html
2•bookofjoe•5m ago•1 comments

Language Models will be Scaffolds

https://alexzhang13.github.io/blog/2026/scaffold/
1•vinhnx•6m ago•0 comments

Raijin – coding agent harness written in Go [MIT license]

https://github.com/francescoalemanno/raijin-mono
1•frankzig•6m ago•0 comments

Show HN: First native zeroclaw build on Android/Termux (aarch64, no proot)

1•bleaknarratives•9m ago•0 comments

Electrical control of magnetism in 2D materials promises to advance spintronics

https://phys.org/news/2026-02-electrical-magnetism-2d-materials-advance.html
1•bilsbie•9m ago•0 comments

A Curious Trig Identity

https://www.johndcook.com/blog/2026/02/24/a-curious-trig-identity/
1•ibobev•10m ago•0 comments

Trig of Inverse Trig

https://www.johndcook.com/blog/2026/02/25/trig-of-inverse-trig/
1•ibobev•10m ago•0 comments

Python Type Checker Comparison: Empty Container Inference

https://pyrefly.org/blog/container-inference-comparison/
1•ocamoss•11m ago•0 comments

Jjq, a local merge queue for jj

https://pauladamsmith.com/blog/2026/02/introducing-jjq-a-local-merge-queue-for-jj.html
1•ibobev•11m ago•0 comments

Tech legend Stewart Brand on Musk, Bezos and his extraordinary life

https://www.theguardian.com/technology/2026/feb/25/tech-legend-stewart-brand-on-musk-bezos-and-hi...
1•rwmj•11m ago•0 comments

The new Design for Stack Overflow is now live [beta]

https://beta.stackoverflow.com/
2•gortok•12m ago•1 comments

Show HN: I scanned 35 SaaS products across ChatGPT, Claude, Perplexity, Gemini

https://www.bersyn.com/
1•gissurthor•13m ago•0 comments

Illusion and Well-Being: A Perspective on Mental Health [pdf]

https://faculty.washington.edu/jdb/articles/Illusion%20and%20Well-Being.pdf
1•RickJWagner•13m ago•1 comments

UAA – A spec for AI and Human coding collaboration

1•alexandretrotel•13m ago•0 comments

AI-Driven Smart Contract Vulnerability Research

https://github.com/CoinFabrik/scout-audit-ai/blob/master/docs/State-Of-The-Art%20Survey%20Documen...
1•wslh•13m ago•0 comments

Show HN: Me.txt – A personal identity file for AI agents

https://www.metxt.org/
1•morochroyce•13m ago•1 comments

Kyoto University develops AI monk robot equipped with Buddhist scriptures

https://english.kyodonews.net/articles/-/71123
1•itmitica•14m ago•0 comments

OpenPencil: Open-source vector design tool controlled by AI Agents

https://github.com/ZSeven-W/openpencil
1•finiking•14m ago•2 comments

Why backups aren't a recovery strategy (and what is)

https://controlplane.com/blog/post/beyond-backups-designing-systems-that-survive-the-inevitable
2•mrlightning•15m ago•0 comments

Show HN: ContextVM – Running MCP over Nostr

1•gzuuus•16m ago•0 comments

Silicon, not oil: Why the U.S. needs the Gulf for AI

https://restofworld.org/2026/pax-silica-qatar-uae/
1•ericyd•17m ago•0 comments

Show HN: A live Python REPL with an agentic LLM that edits and evaluates code

2•andreabergia•18m ago•1 comments

Vital Cat Update: An Update to the Update

https://terribleminds.com/ramble/2026/02/19/vital-cat-update-an-update-to-the-update/
1•iamnothere•18m ago•1 comments

Show HN: Echos – Self-hosted AI knowledge base for things you forget

https://github.com/albinotonnina/echos
1•dupp•19m ago•0 comments

Show HN: PageDuel – A/B testing from $9/mo, no code required

https://pageduel.com
1•bokman123•22m ago•1 comments

Valve is a bigger threat to PlayStation than Xbox ever was

https://jamie.bearblog.dev/console-market-thesis-valve-bigger-threat-to-playstation-than-xbox-eve...
1•jamieskella•24m ago•0 comments