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?

Chinese court freezes $300M of Dutch chipmaker Nexperia assets in Wingtech case

https://www.reuters.com/world/asia-pacific/chinese-court-freezes-dutch-chipmaker-nexperia-bvs-sta...
1•giuliomagnifico•4m ago•0 comments

What the Hugging Face / Artifactory exploit teaches us about good UX for agents

https://crosswalk.to/blog/agents-shared-state-artifactory
1•jase_jase•12m ago•0 comments

Sony Music, Warner sue Anthropic for intellectual property theft

https://techcrunch.com/2026/08/29/sony-music-warner-sue-anthropic-alleging-a-brazen-campaign-of-i...
1•edg5000•12m ago•0 comments

Show HN: Codex Skin, a plugin for applying themes

https://codexskin.ai/
2•JohnYuan97•13m ago•0 comments

Determining when to delegate to AI, and when to keep it strictly in my own hands

https://rivetrune.com/notes/where-the-tool-stops/
1•rivetrune•20m ago•0 comments

AI Can Make You Suck Faster Too

https://www.hermit-tech.com/blog/ai-can-make-you-suck-faster-too
2•degamad•21m ago•0 comments

Show HN: Mcpbeat – I pinged 26,000 MCP servers; 2,300 are dead

https://mcpbeat.com
1•theevoq•22m ago•0 comments

Show HN: I've opensourced SaaS that was started in 2012

https://github.com/dbtiunov/sails-crm
1•dimatiu•25m ago•1 comments

The Firm – an agent-run org with a DID-signed public ledger

https://x402desk.vercel.app/join?src=hn
1•QuillHarbor•27m ago•0 comments

TimesFM-3: A zero-shot foundation model for multivariate forecasting

https://research.google/blog/timesfm-3-a-zero-shot-foundation-model-for-multivariate-forecasting/
2•GaggiX•28m ago•0 comments

Celeris-1 Magnus: Fast hybrid diffusion model for agentic work

https://celeris.ai/celeris-1-magnus
1•mjshashank•34m ago•0 comments

"A Prospectus for a New Magazine"

https://artmuseum.princeton.edu/art/collections/objects/136930
1•js2•35m ago•0 comments

Closing in on the Markdown Book

https://www.thurrott.com/paul/340890/closing-in-on-the-markdown-book
1•theanonymousone•39m ago•0 comments

A mysterious drone. A Mercedes RV. A Chinese intelligence puzzle in the New Mexi

https://www.cnn.com/2026/08/31/politics/drone-incursions-us-bases-chinese-spies
3•pir8life4me•51m ago•1 comments

AMD unveils next-generation RDNA and PlayStation tech with Sony (2025)

https://overclock3d.net/news/gpu-displays/amd-unveils-next-generation-rdna-and-playstation-tech-w...
2•peter_d_sherman•54m ago•1 comments

Dissociation Isn't Always a Trauma Response

https://www.psychologytoday.com/us/blog/the-neurodivergent-psychologist/202608/dissociation-isnt-...
4•thebeardisred•55m ago•0 comments

Vermell – Minimal, dependency-free C++ web framework using epoll

https://github.com/vermellcc/vermell
10•standar-donkey•58m ago•2 comments

Lapce – fast and powerful code editor

https://lap.dev/lapce/
3•jcbhmr•58m ago•0 comments

Agency and Agents

https://www.oneusefulthing.org/p/agency-and-agents
2•saikatsg•1h ago•0 comments

Everyone Was Right About the Button

https://medium.com/@gurvinder372/article-1-everyone-was-right-about-the-button-c2daf899396e
2•gps372•1h ago•0 comments

HuggingFace Attack Postmortem: Fleshing Out the Facts

https://thezvi.substack.com/p/huggingface-attack-postmortem-fleshing
3•paulpauper•1h ago•0 comments

ATLAS MITRE

https://atlas.mitre.org/matrices/ATLAS
3•saikatsg•1h ago•0 comments

Google Ads vs. Facebook Ads: Which Is Better for Small Businesses?

https://www.hostiqen.com/2026/08/google-ads-vs-facebook-ads-which-is.html
2•reviewhub•1h ago•0 comments

Building Without Predicting

https://sive.rs/fit
10•Curiositry•1h ago•2 comments

Show HN: A Bluesky bot that shares Wikipedia links from the HN front page

https://bsky.app/profile/hnwiki.bsky.social
3•doctoboggan•1h ago•0 comments

Wrong Tools for Clients

https://www.moodlenstodo.info
2•Amine000•1h ago•0 comments

expect-native: Jest's expect with Node's native node:test runner

https://www.npmjs.com/package/expect-native
2•ramblingenzyme•1h ago•0 comments

Ollama's Transparent Pricing

https://ollama.com/blog/transparent-pricing
3•wertyk•1h ago•1 comments

What Happened to Yoga?

https://www.theatlantic.com/culture/2026/08/yoga-america-culture-decline/688461/
7•fortran77•1h ago•1 comments

Malicious Virtualizor update served via BGP hijacking

https://www.virtualizor.com/blog/security-incident-bgp-hijacking/
2•MallocVoidstar•1h ago•0 comments