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?

Node-RED Version 5.0 released

https://nodered.org/blog/2026/06/09/version-5-0-released
1•beardicus•2m ago•0 comments

Ask HN: Do you install other people agent skills?

1•sermakarevich•3m ago•0 comments

Show HN: A static SPA to query ATF / BATFE historic AFMER data

https://ryjones.github.io/AFMER-SPA/?ymin=2000&ymax=2024&text=BOEING
1•RyJones•3m ago•0 comments

Rules Before Tools in Critical Infrastructure

https://cabreza.substack.com/p/discipline-1-rules-before-tools
1•fathermarz•4m ago•0 comments

AI Is a Confidence Booster

https://ma.ttias.be/ai-is-a-confidence-booster/
1•Mojah•5m ago•0 comments

Hurdles to a hobby: climate change and runfluencer culture impact our daily jog

https://theconversation.com/hurdles-to-a-hobby-how-climate-change-and-runfluencer-culture-impact-...
1•PaulHoule•5m ago•0 comments

Nvidia's AI PC push banks on unproven demand beyond niche users

https://www.reuters.com/world/china/nvidias-ai-pc-push-banks-unproven-demand-beyond-niche-users-2...
1•1vuio0pswjnm7•6m ago•0 comments

Glucosamine supplement may accelerate dementia and mortality

https://medicalxpress.com/news/2026-06-popular-joint-pain-supplement-dementia.html
1•OutOfHere•6m ago•1 comments

RubyLLM 1.16: concurrent tool execution, Rails-style instrumentation, and more

https://github.com/crmne/ruby_llm/releases/tag/1.16.0
1•earcar•8m ago•0 comments

Apple failed to make its AI tool to comply to EU regulations, EU Commission says

https://www.reuters.com/business/apple-failed-make-its-ai-tool-comply-eu-regulations-eu-commissio...
1•1vuio0pswjnm7•9m ago•0 comments

Why az login ROPC ignores custom ports (CONNECT proxy workaround)

https://topaz.thecloudtheory.com/blog/ropc-local-azure-login/
1•kamilmrzyglod•9m ago•0 comments

StumbleUpon Is Back

https://stumbleupon.cc/
1•revolp•10m ago•0 comments

AV2 video codec released: 30% more efficient than AV1

https://www.flatpanelshd.com/news.php?subaction=showfull&id=1780642255
2•ksec•12m ago•0 comments

Integrate on-device AI models into your app using Core AI [video]

https://developer.apple.com/videos/play/wwdc2026/326/
1•sgt•12m ago•0 comments

Franz: Hacker News sent 10x the traffic

https://adlk.io/blog/hacker-news-vs-product-hunt/
3•tosh•13m ago•0 comments

Show HN: fftext - quick summary, fact check, ELI5 on CPU

https://github.com/kouhxp/fftext
1•mrkn1•14m ago•0 comments

I Made a Vibe Coded Operating System

1•annoymousperson•16m ago•0 comments

1979: Will Word Processors Start a Home Working Revolution?

https://www.youtube.com/watch?v=b6URa-PTqfA
1•tzury•16m ago•0 comments

Show HN: Squish – client-side video compression with WebAssembly

https://www.usesquish.me/
1•toolmaker_01•16m ago•0 comments

Fear of AI bubble ahead of SpaceX IPO

https://fortune.com/2026/06/08/stocks-ai-bubble-spacex-ipo/
2•amelius•19m ago•0 comments

Loop Engineering

https://twitter.com/addyosmani/status/2064127981161959567
1•pretext•21m ago•0 comments

China's Unitree Will Dominate Global Robotics

https://newsletter.semianalysis.com/p/chinas-unitree-will-dominate-global
1•nanmu42•22m ago•0 comments

AI Billionaires Brace for Pitchforks

https://www.axios.com/2026/05/29/ai-billionaires-tech-taxes-wealth
1•robtherobber•24m ago•0 comments

Learning to lead in a hybrid human-AI enterprise

https://www.technologyreview.com/2026/06/09/1137830/learning-to-lead-in-a-hybrid-human-ai-enterpr...
2•joozio•25m ago•0 comments

Musk's SpaceX IPO Narrative Is a Whole New Level of Bullshit

https://text.tchncs.de/chronik-des-laufenden-wahnsinns/h1elon-musk-has-spouted-his-fair-share-of-...
1•doener•25m ago•0 comments

Is AI-written code buggier than human code?

https://www.repowise.dev/blog/engineering/is-ai-written-code-buggier-than-human-code
2•raghavchamadiya•26m ago•0 comments

China's all-round dominance, from batteries to medicine, from trains to AI

https://www.lemonde.fr/en/economy/article/2026/06/07/china-s-all-round-dominance-from-batteries-t...
4•calcifer•28m ago•1 comments

Decentralized AI Inference Marketplace

https://t4t.eth.link
1•ffaerber•29m ago•1 comments

Show HN: Simple FFmpeg Download

https://www.ffmpeg.download/
1•pinter69•29m ago•0 comments

Show HN: You have public speaking anxiety, so do I

https://speaking-club.online/en/
1•shurman81•33m ago•0 comments