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?

Final run for the current LHC accelerator (but more to come)

https://www.nikhef.nl/en/news/final-run-for-the-current-lhc-accelerator-but-more-to-come/
2•elashri•11m ago•0 comments

Have politics come for the National Academies of Science?

https://arstechnica.com/science/2026/06/have-politics-finally-come-for-the-national-academies-of-...
1•rbanffy•12m ago•0 comments

Hacking Salesforce Sites with an LLM Agent

https://www.reco.ai/blog/hacking-salesforce-sites-with-an-llm-agent
2•llmacpu•17m ago•0 comments

Why the US economy keeps defying the odds

https://www.bbc.com/news/articles/cwy031el03po
1•ilreb•19m ago•0 comments

Anthropic Is Taking AI Welfare Seriously. I'm Not Sure It Knows What It's Measu

https://www.lesswrong.com/posts/gNtHHCh363xSGJyz3/anthropic-is-taking-ai-welfare-seriously-i-m-no...
2•joozio•29m ago•0 comments

I accidentally hit SOTA on agentic memory by using AI companions

https://graph.coder.company/
2•vignesh_146•30m ago•1 comments

Local Models in Mid-2026

https://coles.codes/posts/local-models-mid-2026
1•colescodes•33m ago•0 comments

Google's Pinpoint is the free research tool you should know about

https://www.fastcompany.com/91558438/googles-pinpoint-is-the-free-research-tool-you-should-know-a...
1•OutOfHere•35m ago•1 comments

Untrusted data in Linux – How Rust is going to save us

https://www.youtube.com/watch?v=Nzmj7K0FNRY
1•tux1968•36m ago•0 comments

One-click, production-like ATProto network for local development and E2E testing

https://github.com/eurosky-social/u-at-proto
1•doener•39m ago•0 comments

Levyer: The Platform. Designed for Freedom

https://levyer.com/
1•doener•40m ago•0 comments

HumanizeHub: A confidential marketplace for humanizing AI content

https://humanizehub.me
1•cocoglare•44m ago•0 comments

While Oracle Will Rake in Big Bucks on AI, Profits Are Hard to Predict

https://www.nextplatform.com/cloud/2026/06/12/while-oracle-will-rake-in-big-bucks-on-ai-profits-a...
1•rbanffy•46m ago•0 comments

Upscaling Space Quest 3 [video]

https://www.youtube.com/watch?v=Zozc1xGuO7Q
1•skibz•50m ago•0 comments

Network service termination for certain Sony Electronics products

https://www.sony.com/electronics/support/articles/00398725
2•croes•50m ago•0 comments

Sygnet – Hash any document with SHA3-512 and declare your AI usage level

https://mysygnet.com
1•Pistachero•53m ago•0 comments

Zuckerberg says Meta made 'mistakes' in AI workforce shift

https://www.reuters.com/business/metas-zuckerberg-admits-mistakes-made-ai-transformation-2026-06-12/
1•jgilias•53m ago•0 comments

Superpowers for Claude, Codex etc.

https://github.com/obra/superpowers
1•wood_spirit•54m ago•0 comments

Nockchain vs. Pearl: The Great Compute War

https://x.com/blocmates/article/2065357097353764868
1•MrBuddyCasino•56m ago•0 comments

A Rant about IPOs

https://dampedspring101.substack.com/p/ipo-rant-everybody-lies
1•rwmj•1h ago•0 comments

Trial of 12mph bike lane speed limit grinds gears of Dutch cyclists

https://www.theguardian.com/world/2026/jun/14/trial-of-12mph-bike-lane-speed-limit-grinds-gears-o...
9•defrost•1h ago•8 comments

Cursed Knowledge

https://obscura.com/cursed-knowledge/
2•Cider9986•1h ago•0 comments

An architectural blueprint to excise MS-DOS device debt (CON, NUL) from Windows

https://feedbackportal.microsoft.com/feedback/idea/dca14930-b767-f111-9b47-6045bdbd0989
1•breakthematrix•1h ago•0 comments

New Brunswick woman sues OpenAI, alleging ChatGPT led to daughter's death

https://www.cbc.ca/news/canada/new-brunswick/sue-open-ai-suicide-chat-gpt-9.7234630
1•uladzislau•1h ago•0 comments

Don't trust large context windows

https://garrit.xyz/posts/2026-05-06-dont-trust-large-context-windows
15•computersuck•1h ago•5 comments

China Is Propping Up the World Economy by Importing Less Oil

https://www.wsj.com/business/energy-oil/china-is-propping-up-the-world-economy-by-importing-a-lot...
6•PankajGhosh•1h ago•0 comments

Introduction to (Multimodal) LLM-as-a-Judge

https://yinghonglan.substack.com/p/introduction-to-multimodal-llm-as
4•rented_mule•1h ago•0 comments

Mining And refining: uranium and plutonium (2024)

https://hackaday.com/2024/04/24/mining-and-refining-uranium-and-plutonium/
2•leonidasrup•1h ago•0 comments

How an astrophysicist uses Codex to help simulate black holes

https://openai.com/index/using-codex-to-simulate-black-holes/
3•gmays•1h ago•0 comments

AI: Surgeon's Assistant or Commodity on a Meter?

https://replicated.wiki/blog/stream.html
2•gritzko•1h ago•0 comments