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?

Paseo – Beautiful open-source coding agent interface (desktop, mobile, CLI)

https://github.com/getpaseo/paseo
2•timhigins•51s ago•1 comments

The Empty Field That Wasn't: GPS, OTAD and Two Decades of Encrypted Broadcasts

https://lsc-pagepro.mydigitalpublication.com/publication/?i=865273&p=62&view=issueViewer
1•ahlCVA•2m ago•0 comments

WinUtils: Shell-powered CLI tools for Windows 95

https://www.codenaked.com/winutils
2•code_naked•2m ago•1 comments

We tore down our no-code site and went back to code

https://twitter.com/chrismuccioli/status/2061909833893257389
1•nadis•3m ago•0 comments

ContextWall – Context firewall for AI agents and RAG pipelines

https://contextwall.io/
1•sumeshpk•3m ago•0 comments

Show HN: Scholar Sidekick – citation verifier for the "real DOI, wrong paper"

https://scholar-sidekick.com
1•ProductivePhys•5m ago•0 comments

Dense Retrievers Know More Than They Can Express

https://www.mixedbread.com/blog/latent-terms
1•emschwartz•6m ago•0 comments

Android gets fake-call detection for spoofed calls

https://arstechnica.com/gadgets/2026/06/google-announces-deepfake-call-detection-for-android-new-...
1•Lihh27•8m ago•0 comments

Understand your AI generated code

https://archtocode.com/blog
1•grzelazny•12m ago•0 comments

4K years ago, Mohenjo-daro grew more equal over time

https://archaeologymag.com/2026/05/mohenjo-daro-grew-more-equal-over-time/
1•marojejian•12m ago•0 comments

A harness for every task: dynamic workflows in Claude Code

https://claude.com/blog/a-harness-for-every-task-dynamic-workflows-in-claude-code
1•cebert•13m ago•0 comments

JavaScript Crossword

https://lyra.horse/fun/jscrossword/
2•patrikcsak•14m ago•0 comments

Short Seller (Andrew Left) Convicted for $21M Stock Market Manipulation Scheme

https://www.justice.gov/opa/pr/activist-short-seller-convicted-21m-stock-market-manipulation-scheme
2•gnabgib•15m ago•0 comments

Pigeons navigate using magnetic sensors in their livers

https://phys.org/news/2026-05-pigeons-magnetic-sensors-livers.html
2•marojejian•16m ago•0 comments

Gleam v1.17.0 Released

https://gleam.run/news/single-file-gleam-beam-programs-with-escript/
15•figbert•19m ago•1 comments

Copper imbalance tied to autism's social symptoms and white matter development

https://medicalxpress.com/news/2026-06-copper-imbalance-autism-social-symptoms.html
2•OutOfHere•20m ago•1 comments

Firefox AI Coding Policy

https://firefox-source-docs.mozilla.org/contributing/ai-coding.html#firefox-ai-coding-policy
1•Topfi•22m ago•0 comments

The Last Whole Earth Catalog, Catalog (2026)

https://wholeearth.cjohnson.io
2•natural219•22m ago•1 comments

A 5-minute OTA update and rollback flow for Expo and Capacitor apps

https://otalan.com/docs/quick-start/quick-start/
1•cirtadev•23m ago•0 comments

The next gold rush: How the Bay Area can keep its edge in the AI era

https://www.mckinsey.com/industries/social-sector/our-insights/the-next-gold-rush-how-the-bay-are...
1•littlexsparkee•24m ago•0 comments

I got tired of proprietary supplement blends, so I open-sourced my formulas

https://nuc.luyml.com
12•david_clk•26m ago•2 comments

Yahoo reduces email storage limits for free and paid accounts

https://help.yahoo.com/kb/SLN37064.html
1•asdefghyk•30m ago•1 comments

Show HN: Name2Tree – Turn any name into a deterministic tree

https://tree.bairui.dev/
3•subairui•32m ago•1 comments

Pass the Cherries: Review of Twilight of the Dons

https://literaryreview.co.uk/pass-the-cherries
1•Petiver•33m ago•0 comments

Company Manufactures Stamped-Steel Classic Replica Bodies for Mustang, FJ40

https://www.youtube.com/watch?v=cBBZrjwqWZc
1•benfrancom•34m ago•1 comments

The Next Era of Knowledge Work [pdf]

https://cdn.openai.com/pdf/the-next-era-of-knowledge-work.pdf
1•iooi•34m ago•0 comments

AI Coding Tips for 2026

https://raheelyawar.medium.com/ai-coding-tips-may-2026-43a12e68067a
1•dbgrman•34m ago•1 comments

Create Godot Games on Android

https://godotengine.org/article/gabe-stable-release/
1•LorenDB•36m ago•0 comments

Real-time map of when the world is horny

https://masturbate.now/pulse
1•untitled-now•38m ago•1 comments

Against the Survival of the Prettiest (2022)

https://worksinprogress.co/issue/against-the-survival-of-the-prettiest/
2•tmp10423288442•38m ago•0 comments