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

Show HN: FFmpeg API Cloud – Run FFmpeg over HTTP

https://ffmpeg-api.cloud
1•gregzeng95•1m ago•0 comments

Apache Cloudberry 2.1.0

https://www.postgresql.org/about/news/apache-cloudberry-210-released-postgresql-based-mpp-databas...
1•salkahfi•1m ago•0 comments

A glimpse of the new software engineering

https://adlrocha.substack.com/p/adlrocha-a-glimpse-of-the-new-software
1•adlrocha•2m ago•0 comments

How much do sandboxes cost?

https://sandboxprices.swerdlow.dev/
2•benswerd•3m ago•1 comments

RAG as Similarity Engine

https://necromant2005.github.io/dev/rag-as-similarity-engine/
2•rmykhajliw•5m ago•2 comments

Token usage: Vanity metrics are back

https://jasperinsweden.substack.com/p/vanity-metrics-are-back
2•imartin2k•5m ago•0 comments

All you need is myformconnect

1•myformconnect•7m ago•0 comments

EU age verification app: "Worry-free package" with security vulnerabilities

https://www.heise.de/en/news/EU-age-verification-app-Worry-free-package-with-security-vulnerabili...
2•_tk_•9m ago•0 comments

Techie buys fake Ledger Nano S+ hardware wallet and almost falls for phishing

https://www.tomshardware.com/tech-industry/cyber-security/techie-buys-fake-ledger-nano-s-hardware...
2•NewCzech•11m ago•0 comments

Show HN: SharpSkill – I simplified the process of ITWs preparation

https://sharpskill.dev/en
1•Enjoyooor•19m ago•0 comments

Marvin Minsky – Steps Toward Artificial Intelligence (1961) [pdf]

https://courses.csail.mit.edu/6.803/pdf/steps.pdf
1•the-mitr•20m ago•0 comments

Show HN: Understand Anything – Graphs that teach > graphs that impress

https://github.com/Lum1104/Understand-Anything
1•lum1104•22m ago•0 comments

Show HN: Browser Sysinfo – See everything a webpage can learn about you

https://sysinfo.theden.sh/
2•theden•23m ago•0 comments

HN: UmaBot – a multi-agent AI assistant

https://github.com/shaktsin/umaBot
1•shaktdev•23m ago•0 comments

Modern Rendering Culling Techniques

https://krupitskas.com/posts/modern_culling_techniques/
3•krupitskas•26m ago•0 comments

How (and why) we rewrote our production C++ front end infrastructure in Rust

https://blog.nearlyfreespeech.net/2026/04/17/how-and-why-we-rewrote-our-production-c-frontend-inf...
3•NewCzech•31m ago•0 comments

The Hilbert-Pólya Operator

https://substack.com/@metamagic/note/c-239237060
1•r0ze-at-hn•31m ago•0 comments

Under the hood of MDN's new front end

https://developer.mozilla.org/en-US/blog/mdn-front-end-deep-dive/
2•kevsim•36m ago•0 comments

Mythos and Cybersecurity

https://www.schneier.com/blog/archives/2026/04/mythos-and-cybersecurity.html
3•omer_k•36m ago•0 comments

Robot sprints to victory in Beijing, beating the half-marathon world record

https://apnews.com/article/humanoid-robots-half-marathon-beijing-302d0c4781bab20100d6a0bb4e77b629
4•tromp•41m ago•0 comments

Did Second-Wave Feminists Really "Forget" Motherhood?

https://fairerdisputations.org/second-wave-motherhood/
3•istist•42m ago•0 comments

The seven programming ur-languages

https://madhadron.com/programming/seven_ur_languages.html
3•helloplanets•42m ago•0 comments

Tell HN: macOS 26.4.1 bricked my MBP

4•nipponese•43m ago•0 comments

Language models transmit behavioural traits through hidden signals in data

https://www.nature.com/articles/s41586-026-10319-8
3•geox•55m ago•0 comments

Night into Day

https://billmckibben.substack.com/p/night-into-day
2•hackandthink•59m ago•0 comments

The RAM shortage could last years

https://www.theverge.com/ai-artificial-intelligence/914672/the-ram-shortage-could-last-years
13•omer_k•1h ago•6 comments

Regolo – European AI Provider

https://regolo.ai/
1•Mossy9•1h ago•1 comments

Android 15's hidden Linux Terminal is a real Debian VM – and it runs Claude Code

https://github.com/JoJa84/Codefone
4•JoJ84•1h ago•2 comments

Bullshit About Bullshit Machines [pdf]

https://aphyr.com/data/posts/411/the-future-of-everything-is-lies.pdf
2•hedayet•1h ago•1 comments

Hyperframes – AI Video Creation for Agents

https://github.com/heygen-com/hyperframes
1•steveharman•1h ago•1 comments