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?

AI Subscriptions Are Dead

https://twitter.com/i/status/2064492311686607161
1•twapi•49s ago•0 comments

The History of Neural Networks, 1900-1990 [video]

https://www.youtube.com/watch?v=Ab44IusdINA
1•zetalyrae•1m ago•0 comments

The AI Curse (Vis the Lisp Curse)

https://blog.djhaskin.com/blog/the-ai-curse/
1•djha-skin•4m ago•0 comments

Show HN: Crxray – Git clone but for Chrome extension source code

https://github.com/collinboler/crxray
3•chaddover•4m ago•0 comments

Run the void test on Claude Fable 5 here

https://getswiftapi.com/void-test
2•rayanpal_•4m ago•1 comments

The Dialectic of Essay Writing and Truth

https://systemsthinkingcollection.substack.com/p/roots-in-the-sky
1•InputName•8m ago•0 comments

Show HN: Pick worldcup 2026 winners with your colleagues

https://wc26.ossy.dev/
1•postatic•14m ago•0 comments

Agentic search – retrieval, harness, or model?

https://softwaredoug.com/blog/2026/06/08/three-kinds-of-agentic-search
1•kordlessagain•15m ago•0 comments

Starlink shifts hardware from one-time purchase to $10/month rental

https://arstechnica.com/tech-policy/2026/06/starlink-takes-page-from-cable-firms-with-10-monthly-...
4•Lihh27•16m ago•0 comments

Accelerating Transactional Execution via Processing-in-Memory

https://dl.acm.org/doi/10.1145/3767295.3803621
1•teleforce•17m ago•0 comments

Microsoft patches 0-day disclosed by researcher it feuded with

https://arstechnica.com/security/2026/06/locked-in-heated-rivalry-with-researcher-microsoft-fixes...
2•p_stuart82•25m ago•0 comments

Preserving Any Game with Codex

https://twitter.com/ongestalte/status/2064477218802131116
1•focusgroup0•26m ago•0 comments

Show HN: The agent that builds and operates its own SaaS tools

https://craftbot.live
5•zfoong•29m ago•2 comments

OpenClaw agent leaked mock AWS keys and CRM data in phishing tests

https://www.varonis.com/blog/openclaw-phishing
2•logickkk1•29m ago•0 comments

It's Death

https://jesseduffield.com/ITS-DEATH/
3•inatreecrown2•30m ago•0 comments

RailRat

https://railrat.net/
4•skogstokig•31m ago•0 comments

Why the AI race misses the point

https://autonomousagents19.com/blog/organizational-intelligence/tool-that-executes-vs-system-that...
3•KissMySaas•32m ago•0 comments

2026 Volvo XC60 T8 Recharge Review: Solid Combo of Competence and Comfort

https://www.thedrive.com/news/2026-volvo-xc60-t8-recharge-review
1•PaulHoule•33m ago•0 comments

Side by side videos of Claude Fable vs. Opus 4.8 vs. ChatGPT 5.5

https://generative-ai.review/2026/06/claude-fable-rush-test-compare-vs-opus-4-8-vs-chatgpt-5-5-20...
1•tezza•35m ago•1 comments

AI Will Not Start a Nuclear War, but Humans Might

https://aifrontiersmedia.substack.com/p/ai-will-not-start-a-nuclear-war-but
1•healthworker•36m ago•1 comments

Did Claude just reset usage?

https://ajin.im/is/building/did-claude-just-reset-usage/
1•poppypetalmask•37m ago•0 comments

Show HN: MCP-gateway-scan read-only scanner for MCP production-readiness

https://github.com/willianpinho/mcp-gateway-scan
1•willianpinho•39m ago•0 comments

RoguePlanet: Windows 0-day privilege escalation

https://github.com/MSNightmare/RoguePlanet
2•parliament32•39m ago•0 comments

World Cup 2026: Does referee case show FIFA has lost control of its tournament?

https://www.bbc.co.uk/sport/football/articles/clyr6drdl79o
2•lifeisstillgood•40m ago•0 comments

ServiceNow discloses security incident exposing customer data

https://www.bleepingcomputer.com/news/security/servicenow-discloses-security-incident-exposing-cu...
8•coloneltcb•43m ago•0 comments

A filterable, tag-based GPU reference for every card released since 2020

https://www.supertags.app/ws/gpulist--g8qQfl
1•keyes343•44m ago•0 comments

I Reported a Facebook Scam. Meta Reported Back: 'Looks Fine to Us'

https://brothke.medium.com/i-reported-a-facebook-scam-meta-reported-back-looks-fine-to-us-bdb1f8f...
2•benrothke•48m ago•1 comments

Stadium workers have a tentative deal, averting strike ahead of World Cup

https://apnews.com/article/world-cup-los-angeles-sofi-stadium-workers-a25f17dfdc4172a585880834a25...
2•AndrewKemendo•55m ago•0 comments

Show HN: PolyHelper – Self-evolving cognitive exoskeleton orchestrating 10 AIs

https://github.com/PolyHelper/polyhelper
1•PolyHelper•57m ago•0 comments

Claude Fable 5 and new AI safety fables

https://www.interconnects.ai/p/claude-fable-5-and-new-ai-safety
2•carbocation•58m ago•0 comments