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

A spatial canvas of every public US Government UAP record

https://openuap.space
1•dominikmartn•1m ago•0 comments

OpenCS2 – 5k hours recording of Counter Strike for world model training

https://blanchon-opencs2-dataset-viewer.hf.space/
1•blanchon•3m ago•0 comments

Stupidly Simple SVG Sparklines

https://shkspr.mobi/blog/2026/05/stupidly-simple-svg-sparklines/
1•Brajeshwar•3m ago•0 comments

Show HN: Promptcellar – capture every Claude Code prompt as JSONL in your repo

https://github.com/dominiek/promptcellar-for-claude-code
1•dominiek•4m ago•0 comments

What if your AI could buy you a car?

https://medium.com/@alex_21933/what-if-your-ai-could-actually-buy-you-a-car-7ba84bae4a55
1•yankouskia•4m ago•0 comments

The US Is Winning the AI Race

https://avkcode.github.io/blog/us-winning-ai-race.html
1•akrylov•6m ago•0 comments

Styled-Components v7 Alpha

https://styled-components.com/docs/v7
1•quantizor•6m ago•0 comments

California mayor resigns, admitting to being an agent for China

https://time.com/article/2026/05/12/arcadia-california-mayor-eileen-wang-agent-china/
1•wslh•7m ago•0 comments

Open-source AI modding tool for Rimworld (and soon Factorio)

1•lebek•8m ago•0 comments

California Mayor Resigns, Admitting to Being an Agent for China

https://twitter.com/time/status/2054147083821801678
2•wslh•10m ago•0 comments

The wildlife sanctuary you can visit from anywhere [video]

https://www.ted.com/talks/maya_higa_the_wildlife_sanctuary_you_can_visit_from_anywhere
1•MattIPv4•10m ago•0 comments

Show HN: Hashiverse, an open-source decentralized social network in Rust

https://www.hashiverse.com/en/
1•jamesjardine•11m ago•0 comments

Wikipedia's bot traffic to overtake human readers by late 2026 (original data)

https://technicalseonews.com/analysis/wikipedia-bot-traffic-replacing-humans
1•SimilarWeb•13m ago•0 comments

Tracking historical progress against slavery and forced labor

https://ourworldindata.org/slavery
1•surprisetalk•14m ago•0 comments

Coders in 2030 be like: (Rick Rubin, Vibe Producer)

https://old.reddit.com/r/ClaudeAI/comments/1tbgj86/coders_in_2030_be_binlike/
1•consumer451•14m ago•1 comments

Conway's Law Teaches a Grim Lesson About AI in Product Development

https://brodzinski.com/2026/04/conways-law-ai-product-development.html
1•flail•14m ago•0 comments

AI agents make small companies bigger

https://text-incubation.com/ai-agents-make-small-companies-bigger
1•krrishd•15m ago•0 comments

Show HN: RedactScreen – Share your screen, not secrets

https://redactscreen.com/
1•madospace•15m ago•0 comments

Show HN: Rotunda - A Browser Built for Agents

https://github.com/monkeysee-ai/rotunda
2•icyfox•16m ago•0 comments

Publishers: Google's eBook Ad "Ban" Blocked Legitimate Sellers, Not Pirates

https://torrentfreak.com/publishers-googles-ebook-ad-ban-blocked-legitimate-sellers-not-pirates/
1•Brajeshwar•16m ago•0 comments

The syrup of crime bears sticky fruit

https://www.metafilter.com/212975/The-syrup-of-crime-bears-sticky-fruit
1•PaulHoule•17m ago•0 comments

What Inference-Platform Benchmark Posts Leave Out

https://ingero.io/inference-platform-benchmark-posts-leave-out/
1•ingero_io•17m ago•0 comments

Fine-Tuning TranslateGemma-4B for Better Welsh Translations on an H200 GPU

https://metalglot.com/blog/welsh-translategemma-finetuning-guide/
1•metalglot•17m ago•1 comments

Show HN: A "Git history" for Twitter/X profiles

https://tracktweets.com
1•code-less•18m ago•0 comments

WordStar

https://www.sfwriter.com/wordstar.htm
2•andsoitis•21m ago•1 comments

Reliance on Middle East Oil and Gas Supplies by Country

https://www.iea.org/data-and-statistics/data-tools/reliance-on-middle-east-oil-and-gas-supplies-b...
1•gmays•21m ago•0 comments

Linguistic workaround allows Marco Rubio to travel to China

https://www.theguardian.com/us-news/2026/may/13/marco-rubio-china-visit-new-character-name-trump-...
1•neaden•22m ago•0 comments

Social market liberalism has no political home in India

https://ordinaryanalysis.substack.com/p/the-inner-dialogue-of-a-social-market
1•shibaprasadb•23m ago•0 comments

Fragnesia: Linux kernel local privilege escalation via ESP-in-TCP

https://www.wiz.io/blog/fragnesia-linux-kernel-local-privilege-escalation-via-esp-in-tcp
2•ljahier•23m ago•0 comments

Finnish marketplace for 'Environmentally responsible actions'

https://luontoarvot.fi/en
1•Mossy9•23m ago•0 comments