frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

Ask HN: How can I load test PostgreSQL but avoid changing actual data?

1•LawZiL•6mo 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•6mo 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•6mo 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•6mo 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•6mo ago
Load test against a clone instead of a DB whose contents you care about?

Mind-altering 'brain weapons' no longer only science fiction, say researchers

https://www.theguardian.com/world/2025/nov/22/mind-altering-brain-weapons-no-longer-only-science-...
1•zdw•21s ago•0 comments

Magicians of the Miniature (2014)

http://nzpetesmatteshot.blogspot.com/2014/12/magicians-of-miniature.html
1•exvi•1m ago•0 comments

I built a $19 forensic ATS scanner because Jobscan costs $50/mo

https://www.interviewghost.us/
1•ryanpedram•2m ago•1 comments

Video posted by Garry Tan shows suspect who robbed his friend of $11M in crypto

https://www.sfchronicle.com/crime/article/sf-cryptocurrency-robbery-21203804.php
1•markerz•2m ago•0 comments

Show HN: I built a CLI to use devcontainers without VS Code

https://github.com/UPwith-me/Container-Maker
1•DEVINHE111•4m ago•0 comments

Mitigating Application Resource Overload with Targeted Task Cancellation

http://muratbuffalo.blogspot.com/2025/11/mitigating-application-resource.html
1•zdw•5m ago•0 comments

Unpaid Labor Allegations Cast Shadow over Naver WEBTOON's Market Dominance

https://www.animenewsnetwork.com/feature/2025-11-05/unpaid-labor-allegations-cast-shadow-over-nav...
1•PaulHoule•5m ago•0 comments

Through the Looking Glass: The Traditional Glass Shot Matte Painting (2016)

http://nzpetesmatteshot.blogspot.com/2016/08/through-looking-glass-traditional-glass.html
1•exvi•5m ago•0 comments

Eggroll: Novel general-purpose machine learning algorithm provides 100x speed

https://eshyperscale.github.io/
1•felineflock•7m ago•0 comments

Astrl– a free AI-powered Khan Academy for self-guided learning

https://tryastrl.com/
1•jjwilkin•21m ago•1 comments

We're Stuck in an Infinite Loop of Terrible Tech

https://timyc.substack.com/p/were-stuck-in-an-infinite-loop-of
1•TimDotC•22m ago•0 comments

An Auto Holy Grail: Motors That Don't Rely on Chinese Rare Earths

https://www.nytimes.com/2025/11/24/business/automakers-rare-earth-minerals-magnets.html
1•mmooss•23m ago•0 comments

Anthropic introduces cheaper, more powerful, more efficient Opus 4.5 model

https://arstechnica.com/ai/2025/11/anthropic-introduces-opus-4-5-cuts-api-pricing-and-enables-muc...
1•jnord•25m ago•0 comments

Humanoid robot walked 66 miles in 3 days, right into the Guinness World Records

https://www.cbsnews.com/news/china-humanoid-robot-agibot-a2-walks-66-miles-guinness-world-records/
1•satonakamoto•25m ago•1 comments

Jakarta overtakes Tokyo as largest city, according to UN

https://www.abc.net.au/news/2025-11-25/jakarta-overtakes-tokyo-as-worlds-largest-city/106049122
2•Gaishan•26m ago•1 comments

Endogenous Automation Will Hit You

https://lydianottingham.substack.com/p/endogenous-automation-will-hit-you
1•eatitraw•28m ago•1 comments

Revolut hits $75B valuation

https://news.crunchbase.com/fintech/revolut-valuation-spikes-secondary-share-sale/
2•rudderdev•29m ago•3 comments

Beddel: Secure, Declarative, and Extensible Agent Runtimes

https://github.com/botanarede/beddel-alpha
1•mesenga•29m ago•1 comments

The 'S&P 493' reveals a different U.S. economy

https://www.washingtonpost.com/business/2025/11/24/sp500-stock-market-tech-nvidia/
1•ProAm•33m ago•0 comments

The Valley of Death: Why $100k Is the New Poverty

https://www.thefp.com/p/why-do-americans-feel-poor-because
2•mhb•33m ago•0 comments

Claude Opus 4.5, and why evaluating new LLMs is increasingly difficult

https://simonw.substack.com/p/claude-opus-45-and-why-evaluating
1•hackthegibson2•34m ago•0 comments

Google Further Encroaches on Nvidia's Turf with New AI Chip Push

https://www.theinformation.com/articles/google-encroaches-nvidias-turf-new-ai-chip-push
2•JumpCrisscross•34m ago•2 comments

Real-world Nausicaa Ghibli anime glider completes its final flight in Japan

https://soranews24.com/2025/11/20/real-world-nausicaa-ghibli-anime-glider-completes-its-final-fli...
1•thunderbong•34m ago•0 comments

ULTIMATE EROS 3: An End to Fuckening

https://substack.com/home/post/p-179390401
1•eatitraw•35m ago•0 comments

The Tree That Produces the Only True Blue Fruit on the Planet

https://www.forbes.com/sites/scotttravers/2025/11/23/meet-the-tree-that-produces-the-only-true-bl...
1•malshe•39m ago•1 comments

Show HN: Device for visually impaired folks that describes their surroundings

https://piyushgupta.xyz/be-my-eyes-using-raspberry-pi-and-ai/
1•piyushgupta53•42m ago•0 comments

Will CoreWeave's Heavy Debt Load Disrupt Its Growth Momentum?

https://finance.yahoo.com/news/coreweaves-heavy-debt-load-disrupt-164500990.html
1•zerosizedweasle•45m ago•0 comments

X blew up its own platform with a new location feature

https://www.theatlantic.com/technology/2025/11/x-about-this-account/685042/
3•raw_anon_1111•45m ago•1 comments

Founder's unlikely path to Silicon Valley could become an edge

https://techcrunch.com/2025/11/21/how-this-founders-unlikely-path-to-silicon-valley-could-become-...
1•fcpguru•46m ago•0 comments

FBI concludes Trump's would-be assassin acted alone during rally shooting

https://vechron.com/2025/11/fbi-trump-rally-shooting-investigation-closed/
1•ashishgupta2209•56m ago•1 comments