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?

Ask HN: What Is the Point of WebMCP?

1•curtisblaine•1m ago•0 comments

AI Desktop Agent over VNC – your AI connects to your desktop like a remote user

https://github.com/AmrDab/clawd-cursor
1•AmrDabb•2m ago•1 comments

Generalized Sequential Probability Ratio Test for Families of Hypotheses [pdf]

https://sites.stat.columbia.edu/jcliu/paper/GSPRT_SQA3.pdf
1•luu•2m ago•0 comments

GPT 5.3 Codex wiped my F: drive with a single character escaping bug

https://old.reddit.com/r/vibecoding/comments/1r96647/gpt_53_codex_wiped_my_entire_f_drive_with_a/
1•taubek•4m ago•0 comments

I built markdown.new (Markdown for Agents) and it went a little viral on X

https://markdown.new
1•elbeyoglu•4m ago•1 comments

Arcade game Pang from 1989 in WASM

https://midzer.de/wasm/pang/
1•midzer•6m ago•2 comments

CSS Agent Garden – AI agents style one HTML page via MCP

https://css-agent-garden.fly.dev/
2•happymouse•11m ago•0 comments

Running an Inference as a Service Business

https://faizank.substack.com/p/inference-as-a-service
2•fazkan•13m ago•0 comments

Map of All Theories of Consciousness

https://loc.closertotruth.com/map
2•paraschopra•13m ago•0 comments

Show HN: Global Issue Memory MCP – Stack Overflow for Your Coding Assistant

https://www.usegim.com/
2•nonekme•17m ago•0 comments

Learn C++ by Example • Frances Buontempo and Matt Godbolt

https://www.youtube.com/watch?v=PXKICIiXEUM&list=PLEx5khR4g7PJbSLmADahf0LOpTLifiCra
2•birdculture•17m ago•0 comments

OpenAI Is Betting on a Security Nightmare

https://julsimon.substack.com/p/openai-is-betting-on-a-security-nightmare
2•doener•18m ago•0 comments

That irritating feeling France was right – US makes Gaullism respectable again

https://www.economist.com/europe/2026/02/18/that-irritating-feeling-that-france-was-right
4•saubeidl•23m ago•1 comments

What is the probability of a coin landing on its edge?

2•vivzkestrel•23m ago•1 comments

I accidentally managed to uncover the system prompt of Google Gemini 3 Flash

https://pastebin.com/wMPqrmsw
3•errorcodezero•25m ago•0 comments

Show HN: ModelWar – CoreWars for Agents

https://modelwar-delta.vercel.app
2•pj4533•25m ago•0 comments

When to Vibe Code?

https://www.youtube.com/watch?v=TkRkLBcm9D4
1•grahamlee•26m ago•0 comments

Challenging the Single-Responsibility Principle

https://kiss-and-solid.com/blog/keep-it-simple
1•WolfOliver•27m ago•0 comments

The 8KB Page: PostgreSQL Page Layout Visualized

https://boringsql.com/visualizers/8kb-page/
1•radimm•28m ago•0 comments

Regulated Crypto Investigation Team – Intelligence Cyber Wizard Services

1•Robertjoe•28m ago•0 comments

Measuring Input-to-Photon Latency (Because 'Wayland Feels Off' Isn't a Metric)

https://davidjusto.com/articles/m2p-latency/
1•rhim•31m ago•0 comments

Chat with Llamma 8B at 16,000 TPS

https://chatjimmy.ai/
1•nl•37m ago•0 comments

Llamma 3.1 8B in hardware, 16,000 TPS

https://taalas.com/products/
2•nl•38m ago•0 comments

MD5 Algorithm Explainer

https://md5algorithm.vercel.app/
1•fanweixiao•38m ago•0 comments

The Gemini Servility Trap

1•gemfan•38m ago•0 comments

RFC 2295 – Transparent Content Negotiation in HTTP

https://datatracker.ietf.org/doc/html/rfc2295
1•locknitpicker•39m ago•0 comments

How did I revolutionized my productivity using OpenClaw

https://clawhub.ai/Quarantiine/effortlist-ai
1•daniel_ward•40m ago•0 comments

PostgreSQL's 8KB Page

https://boringsql.com/posts/inside-the-8kb-page/
2•radimm•45m ago•0 comments

Database table is an awful API

https://www.innoq.com/en/blog/2026/02/your-database-table-is-an-awful-api/
1•Ookami86•45m ago•0 comments

Donut Lab Announces Upcoming Independent Battery Measurements

https://www.donutlab.com/measurement-reports-announcement/
2•peritpatrio•46m ago•0 comments