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

Cancer jab can eradicate tumours in patients, trial shows

https://www.theguardian.com/science/2026/may/30/cancer-jab-can-eradicate-entire-tumours-in-patien...
1•tosh•2m ago•0 comments

Claude Code vs. Codex: FRA challenge 75746d-2025

https://gist.github.com/joelonsql/c49129b151d7e77fb83250f675ffea07
2•JoelJacobson•5m ago•0 comments

I Ported Pixal3D over to Apple Silicon

https://blog.chillaid.art/posts/porting-pixal3d-one-cursed-kernel-at-a-time
1•pawelma•7m ago•1 comments

Cancer Alley

https://en.wikipedia.org/wiki/Cancer_Alley
2•amarcheschi•7m ago•0 comments

Looking at code behind File Pilot

https://www.youtube.com/watch?v=Ww26eO1WeGQ
1•vjekoslav•8m ago•0 comments

Wordiply

https://www.wordiply.com/
1•saikatsg•9m ago•0 comments

Bluey deal FOMO will kill the next Bluey. Do you want dreams or dollarbucks?

https://oblongataresearch.substack.com/p/bluey-deal-fomo-will-kill-the-next
2•basiljh•10m ago•0 comments

The Largest Vocabulary in Hip Hop

https://pudding.cool/2017/02/vocabulary/
2•chistev•11m ago•0 comments

NNSI Architecture – Standalone Neuromorphic memory chip specification (v0.1)

https://app.notion.com/p/Show-HN-NNSI-Architecture-Standalone-Neuromorphic-memory-chip-specificat...
1•nyan_archive•12m ago•0 comments

Review of Linux Android Gaming Emulator Solutions

https://ivonblog.com/en-us/posts/android-emulators-for-linux/
1•ivo8n52•13m ago•0 comments

Ming (Clam)

https://en.wikipedia.org/wiki/Ming_(clam)
1•thunderbong•14m ago•0 comments

US plans to halt immigration, customs processing at 'sanctuary city' airports

https://www.reuters.com/legal/government/us-drawing-up-plans-halt-immigration-customs-processing-...
5•littlexsparkee•17m ago•0 comments

Zig's New Relationship with LLVM (2020)

https://kristoff.it/blog/zig-new-relationship-llvm/
1•tosh•19m ago•0 comments

I built a wallpaper app with Tauri and Rust

https://github.com/Halfaxas/Splashy
1•Halfaxa•21m ago•1 comments

Internet Speed Test by Cloudflare

https://speed.cloudflare.com/
1•gurjeet•25m ago•0 comments

Rigid C++: A Pragmatic Architecture for High-Performance Systems

https://github.com/I-A-S/Rigid-Cpp
2•I-A-S•29m ago•1 comments

Opensecrets Bulk Data

https://www.opensecrets.org/bulk-data
2•mooreds•31m ago•0 comments

We are constantly broadcasting emotional data

https://www.tonyrice.me/emotional-intelligence/
2•tonyrice•34m ago•0 comments

Updata portfolio company job board

https://jobs.updata.com/jobs
1•mooreds•34m ago•0 comments

Hormuz crisis side effect: a sharp rise in container shipping rates

https://www.lloydslist.com/LL1157327/Hormuz-crisis-side-effect-a-sharp-rise-in-container-shipping...
5•mooreds•34m ago•1 comments

Temporal Primer – Building Long-Running Systems

https://arpitbhayani.me/blogs/temporal-primer/
1•vasudua1•34m ago•0 comments

Hints for Computer System Design (1983)

https://dl.acm.org/doi/epdf/10.1145/800217.806614
1•jruohonen•35m ago•0 comments

Boogy: Production Infrastructure for Vibe Coders

https://boogy.ai/
1•notgelotto•39m ago•2 comments

DockWarden – open-source power-user companion for Bitwarden

https://github.com/JaredScar/DockWarden
2•JaredScar•39m ago•0 comments

White House's Aliens.gov Site Brags That ICE Arrested More Than 700 US Citizens

https://www.wired.com/story/white-house-aliens-gov-us-citizens-arrested/
26•hydrolox•39m ago•3 comments

'Hidden datacentre tax' costing Irish households millions, report says

https://www.theguardian.com/technology/2026/may/28/irish-datacentres-household-bills-electricity
2•saikatsg•40m ago•0 comments

Original 'Star Trek' Enterprise Model Resurfaces Decades After It Went Missing

https://www.smithsonianmag.com/smart-news/first-ever-star-trek-enterprise-model-boldly-returns-af...
5•geox•43m ago•0 comments

Terence Tao's promotional video for OpenAI

https://twitter.com/OpenAI/status/2060451757818601808
1•fuglede_•44m ago•0 comments

They STOLE his $200k Lego Collection – – – LEGALLY? [video]

https://www.youtube.com/watch?v=14ktgvoH4Mc
2•abirch•44m ago•2 comments

GitHub Copilot charges GPT 5.5 with a 57x multiplier per request from June first

https://docs.github.com/en/copilot/reference/copilot-billing/request-based-billing-legacy/model-m...
2•theanonymousone•44m ago•0 comments