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

The Unreported Story of Grid Scale Battery Fires

https://wattsupwiththat.com/2025/12/29/the-unreported-story-of-grid-scale-battery-fires/
1•delichon•6m ago•0 comments

Before Your Doctor Uses AI to Record Your Visits, Ask These Questions

https://www.wsj.com/health/wellness/doctor-visit-ai-302b765b
1•bookofjoe•6m ago•1 comments

Inlining

https://buttondown.com/jaffray/archive/inlining/
1•ibobev•6m ago•0 comments

I built a free Chrome extension security scanner now Fortune 500 teams use it

1•jensec•7m ago•0 comments

Is Topic Modelling Obsolete?

https://languagetechnology.substack.com/p/is-topic-modelling-obsolete
1•aragonite•10m ago•0 comments

Ask HN: How do we benchmark data extraction, analysis and subsequent enrichment

1•srijansriv•11m ago•0 comments

The Man Who Killed Google Search (2024)

https://www.wheresyoured.at/the-men-who-killed-google/
2•cwillu•12m ago•1 comments

Linux 7.0 Expected to Bring IO_uring Iopoll Polling Improvements

https://www.phoronix.com/news/Linux-7.0-IO-uring-Polling
2•rbanffy•13m ago•0 comments

The Precipice

https://samirvarma.substack.com/p/the-precipice
2•paulpauper•14m ago•0 comments

Different Arguments

https://daviddfriedman.substack.com/p/different-arguments
1•paulpauper•15m ago•0 comments

Top personal blogs on Hacker News in 2025, by points

https://twitter.com/jonobelotti_IO/status/2005737476069933272
1•thundergolfer•17m ago•2 comments

Show HN: NeuronDB – Embeddings and vector search for PostgreSQL

https://github.com/neurondb/neurondb
1•ibrar74•19m ago•1 comments

Release fish 4.3.0 · fish-shell/fish-shell

https://github.com/fish-shell/fish-shell/releases/tag/4.3.0
1•dmmalam•22m ago•0 comments

USPS Announces Changes to the Postmark Date System

https://nstp.org/article/usps-announces-changes-postmark-date-system
4•rbanffy•22m ago•0 comments

Show HN: An automated tutor to help you understand chess

https://chess-helios.vercel.app/
1•MintyPyro•22m ago•0 comments

Show HN: Code-Chunk for RAG

https://github.com/supermemoryai/code-chunk
1•mhosayny•23m ago•0 comments

Fedora Continued at the Forefront of Upstream Linux Innovations in 2025

https://www.phoronix.com/news/Fedora-Linux-2025-Highlights
1•rbanffy•23m ago•0 comments

How the weird language of tech dulled sport

https://www.theguardian.com/sport/2025/nov/28/from-value-adds-to-networking-superconductor-how-th...
1•PaulHoule•24m ago•0 comments

Show HN: Portdetective – A tiny, fast rust CLI for port inspection

https://github.com/cmakafui/portdetective
1•ckugblenu•26m ago•0 comments

Deprecating Volatile in C++

http://wg21.link/P1152R3
1•fanf2•27m ago•1 comments

How LLMs Work: Top Executive-Level Questions

https://sloanreview.mit.edu/article/how-llms-work/
2•ibrar74•28m ago•1 comments

Cold War bomb shelter in Nova Scotia being converted to high-end doomsday condos

https://www.ctvnews.ca/canada/article/cold-war-bomb-shelter-in-nova-scotia-being-converted-into-h...
1•amichail•29m ago•0 comments

Show HN: AI Domain Data Standard – Complete Tooling Suite

https://ai-domain-data.org/
1•dylanl37•30m ago•0 comments

Show HN: Home Stories – Track renovations with budgets, photos, timers

https://apps.apple.com/dk/app/home-stories-renovation-app/id6754754960HomeStories:RenovationApp
1•rhjensen79•33m ago•0 comments

Show HN: Cumbersome – iOS/macOS API client for OpenAI, Anthropic, Z.ai

https://apps.apple.com/us/app/cumbersome-ai-api-client/id6753016821
2•bluepeter•35m ago•0 comments

Why a $500 Steak Dinner Only Yields a $25 Profit

https://www.wsj.com/business/hospitality/why-a-500-steak-dinner-only-yields-a-25-profit-21e62353
2•leonidasv•36m ago•0 comments

Manim Community accounts got compromised, help needed to recover

https://twitter.com/onusoz/status/2005729271893881215
1•hosolmaz•36m ago•0 comments

Demystifying Fuzzer Behaviour [video]

https://www.youtube.com/watch?v=h3UcecN5fvQ
1•weinzierl•37m ago•0 comments

Show HN: swab – A configurable project cleaning tool

https://github.com/terror/swab
1•crap•37m ago•0 comments

(2023) GCHQ [Sigint] Summaries

https://christopher-parsons.com/resources/the-sigint-summaries/gchq-summaries/
1•azalemeth•39m ago•0 comments