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: Figma alternative where AI works with vector primitives, not code

https://brilliant.design/
1•amantinband•40s ago•1 comments

Is Email Confidential in Transit Yet?

https://alexsci.com/blog/is-email-confidential-in-transit-yet/
1•fanf2•42s ago•0 comments

Does Point Cloud Boost Spatial Reasoning of Large Language Models?

https://arxiv.org/abs/2504.04540
1•gregsadetsky•1m ago•0 comments

Chip Startup Aims to Shatter AI's Dreaded Memory Wall

https://www.wsj.com/tech/chip-startup-aims-to-shatter-ais-dreaded-memory-wall-b5f4c563
1•Brajeshwar•3m ago•0 comments

Mild dehydration affects mood in healthy young women

https://pubmed.ncbi.nlm.nih.gov/22190027/
2•7777777phil•5m ago•1 comments

Scaling Test-Time Compute for Agentic Coding

https://arxiv.org/abs/2604.16529
1•gmays•6m ago•0 comments

Show HN: Rocky – Rust SQL engine with branches, replay, column lineage

https://github.com/rocky-data/rocky
1•hugocorreia90•6m ago•0 comments

Workday's Last Workday

https://www.a16z.news/p/workdays-last-workday
1•7777777phil•9m ago•0 comments

Big AI cluster little power the 8x Nvidia GB10 cluster

https://www.servethehome.com/big-cluster-little-power-the-8x-nvidia-gb10-cluster-marvell-cisco-ub...
1•teleforce•11m ago•0 comments

The Monetization of Spam

https://www.thomasmcgee.co/article/linkedin-inbox-spam
1•SunshineTheCat•11m ago•0 comments

The Making of Digital Identity: Mobile Revolution and the Surveillance Machine

https://syntheticauth.ai/posts/the-making-of-digital-identity-06-the-mobile-revolution-and-the-su...
1•zerolayers•14m ago•0 comments

The Pragmatic Prompter

https://liameveryday.substack.com/p/the-pragmatic-prompter
1•wlindner•14m ago•0 comments

Show HN: Keychase – A zero-config, offline Python secret scanner

https://github.com/Iflal/keychase
1•Iflal•15m ago•0 comments

GPT-5.5 prompt for Codex tries to make it not talk about goblins

https://twitter.com/arb8020/status/2048958391637401718
2•ndiddy•15m ago•0 comments

I Ditched the iCloud Keychain

https://webcatz.eu/blog/vaultwarden
1•speckx•15m ago•0 comments

Scammers use Gmail dot alias trick to spoof Robinhood in phishing scam

https://www.msn.com/en-us/news/technology/scammers-use-gmail-dot-alias-trick-to-spoof-robinhood-i...
1•kapkapkap•16m ago•0 comments

OpenAI's revenue, growth estimates fall short as company races toward IPO

https://www.cnbc.com/2026/04/28/openais-revenue-growth-estimates-fall-short-report.html
4•1vuio0pswjnm7•17m ago•0 comments

Show HN: Integrations gateway for agents with 2FA for destructive ops (OSS)

https://github.com/yakkomajuri/agentport
2•yakkomajuri•17m ago•0 comments

U.S. is 'being humiliated by Iran,' says Germany's Merz

https://www.cnbc.com/2026/04/28/us-humiliated-germany-merz-europe-iran-war-energy-prices-fuel.html
4•tcp_handshaker•18m ago•0 comments

Free retirement tax calculators – SS tax torpedo, IRMAA cliffs, Roth ladders

https://www.retiresmarter.co/
2•samedame•19m ago•0 comments

An AI prompt-injected another AI in the wild and recognized it had succeeded

https://ratnotes.substack.com/p/what-an-ai-does-when-nobody-on-the
3•mtrifonov•20m ago•0 comments

Wysiwyg LaTeX Editor Compositor for Windows and macOS Release 0.7

https://compositorapp.com/blog/2026-04-27/Compositor-Windows-07/
2•serhack_•21m ago•0 comments

Open grid data has a public benefit

https://nworbmot.org/blog/open-grid-data.html
2•lyoncy•21m ago•0 comments

PostgreSQL and the OOM Killer: Why We Use Strict Memory Overcommit

https://www.ubicloud.com/blog/postgresql-and-the-oom-killer-why-we-use-strict-memory-overcommit
2•yusufaytas•21m ago•0 comments

Clojure on Fennel part three: parsing

https://andreyor.st/posts/2026-04-27-clojure-on-fennel-part-three-parsing/
2•ibobev•21m ago•0 comments

Understanding Systems

https://entropicthoughts.com/understanding-systems
2•ibobev•22m ago•0 comments

Proton VPN's promises post-quantum groundwork, Stealth for Linux and new apps

https://www.techradar.com/vpn/vpn-services/proton-vpns-promises-post-quantum-groundwork-stealth-f...
3•losgehts•22m ago•0 comments

Where Optimizations Come From

https://buttondown.com/jaffray/archive/where-optimizations-come-from/
2•ibobev•22m ago•0 comments

Start with the sensors, then design the rest: How Zoox built its robotaxi

https://arstechnica.com/cars/2026/04/start-with-the-sensors-then-design-the-rest-how-zoox-built-i...
2•Brajeshwar•24m ago•0 comments

Microsoft Ecommerce Platform Options for Scalable Online Commerce

https://virtocommerce.com/blog/microsoft-ecommerce
2•vcmarketing•25m ago•0 comments