frontpage.
newsnewestaskshowjobs

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?

Universe and the First Cause

1•skwasimin•1m ago•0 comments

Oseberg Tapestry Fragments

https://en.wikipedia.org/wiki/Oseberg_tapestry_fragments
1•benbreen•7m ago•0 comments

How Close Are We to Autonomous Chip Design

https://semiengineering.com/how-close-are-we-to-fully-autonomous-chip-design/
3•Lind5•10m ago•0 comments

Microsoft Decision-1: 9B Qwen Model Launch Explained

https://shattered.io/microsoft-decision-1-qwen3-5-9b-model-2026/
1•gmays•10m ago•0 comments

What managing emergencies at Burning Man teaches me about incident management

https://greatcircle.com/blog/2026/09/29/burning-man-incident-management/
2•vinnyglennon•12m ago•0 comments

Show HN: Drint – packaging dielines and 3D box mockups as an MCP server

https://drint.io/help/mcp
1•Dan96•12m ago•0 comments

New research tries to defuse the "China shock"

https://www.economist.com/finance-and-economics/2026/10/22/new-research-tries-to-defuse-the-china...
1•andsoitis•14m ago•0 comments

Handy page for dealing with your nearby emotionally bypassed human

https://fuckeleveneleven.com/
1•tonimolins•16m ago•1 comments

Anthropic sued for allegedly using 274 Elvis Presley songs to train AI models

https://www.theguardian.com/us-news/2026/oct/25/elvis-presley-anthropic-lawsuit-ai-models-music
2•pseudolus•18m ago•1 comments

Brazil elections: Lula secures fourth term after dramatic comeback

https://www.bbc.com/news/articles/cmvg7p001qj9o
6•gverrilla•18m ago•1 comments

Mantle – Agentic API Maintenance

https://getmantle.dev/
1•ArmanC•18m ago•0 comments

JaJa: Job Agency Harness

https://github.com/Kahl-d/jaja
2•khalidmehtabk•27m ago•0 comments

The Designer Fallacy

https://humanslivehere.com/articles/the-designer-fallacy/
1•Patrax•29m ago•0 comments

Ask HN: Does your company require human review of AI-generated code?

1•is-is-odd•32m ago•1 comments

Can They Write a Function?

https://idiallo.com/blog/can-they-write-a-function
1•firefoxd•32m ago•0 comments

FileBot Forums (phpBB) have been hacked

https://www.reddit.com/r/filebot/comments/1xf4s2b/filebot_forums_phpbb_have_been_hacked/
3•hippogod•40m ago•0 comments

ARM1: Chip That Changed the World of Computing

https://www.youtube.com/watch?v=Q8OYQKuYtjE
1•cable2600•47m ago•0 comments

If AI displaces human workers, they will lose more than just pay

https://www.economist.com/business/2026/10/22/if-ai-displaces-human-workers-they-will-lose-more-t...
3•andsoitis•59m ago•1 comments

Biff 2.0.4: LLM Skills

https://biffweb.com/p/skills/
2•TheWiggles•1h ago•0 comments

Show HN: God – real-time control room for LLM agent societies (EMNLP 2026 demo)

https://github.com/XiaoLuoLYG/GOD
2•xiaoluolyg•1h ago•0 comments

U.S. birth rate drops to record low, but older women are having more babies

https://www.npr.org/2026/10/24/nx-s1-6012804/birth-rate-population-cdc
8•pseudolus•1h ago•0 comments

iPhone Duo Teardown [video]

https://www.youtube.com/watch?v=WOVIjFnivJA
2•obilgic•1h ago•1 comments

The subreddit each age is most over-represented in, women vs. men

https://www.reddit.com/r/dataisbeautiful/comments/1xf6gt3/oc_i_checked_177_million_redditors_who_...
1•gmays•1h ago•0 comments

IBM CEO says open weight models are now irresistibly good and cheap on-prem

https://www.theregister.com/systems/2026/10/22/ibm-ceo-says-open-weight-models-are-now-irresistib...
42•Betelbuddy•1h ago•6 comments

Data centre debate heats up ahead of US midterms

https://www.bbc.com/news/articles/cq2e9we7w2ejo
7•Betelbuddy•1h ago•0 comments

Recycling ANSI art: Tracing the origins of Fire Escape's BBS logon screens

https://breakintochat.com/blog/2026/10/25/recycling-ansi-art/
4•Kirkman14•1h ago•4 comments

Show HN: Little Fun Games – daily trivia with uncommon-answer scoring

https://littlefungames.com/
2•littlefungames•1h ago•0 comments

Grokking: A 777-Parameter Transformer Learned Real Math

https://themenonlab.blog/blog/grokking-777-parameter-transformer
4•peter_d_sherman•1h ago•2 comments

iPhone Duo Teardown

https://www.ifixit.com/News/119895/iphone-duo-teardown
54•kripy•1h ago•19 comments

Cve.now: A Free Feed of Security Vulnerabilities for Agents

https://www.sazabi.com/blog/introducing-cve-now
2•shcallaway•2h ago•0 comments