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?

Intro to VLIW Kernel Optimization

https://nickgregory.me/post/2026/10/07/vliw-kernel-optimization/
1•kallsyms•50s ago•0 comments

Analyzing Rust Programs with Charon

https://lwn.net/SubscriberLink/1097198/48bd9ebe2a00d3de/
1•mkesper•1m ago•0 comments

Agor: Collaborative Canvas for Humans and Agents

https://agor.live/
1•skadamat•1m ago•0 comments

The Economics of the AI Buildout

https://pierreb05.substack.com/p/the-economics-of-the-ai-buildout
2•denishtefan•1m ago•0 comments

Trump? Diesel? ICE? Corruption? All of Those. But Mostly–Data Centers

https://newrepublic.com/article/216376/midterms-data-centers-trump-diesel-ice-corruption
2•SLHamlet•1m ago•0 comments

Can Jev save my inbox from the Democrats?

https://huggingface.co/blog/stephen-solka/use-jev-to-delete-fundraising-emails
2•lormayna•1m ago•0 comments

Bun check – a TypeScript type checker builtin to Bun

https://github.com/oven-sh/bun/pull/44361
2•maxloh•2m ago•0 comments

GTA6 – Interactive Leaked Map

https://gta6.city
1•jochumjurre•2m ago•0 comments

International Olympiad in Informatics Bans Israeli Competitors

https://www.jns.org/israel-news/international-computer-olympiad-bans-israeli-competitors
1•skadamat•4m ago•0 comments

Human-Like and Male? How AI Assistant Design Relates to Monetary Reward

https://dl.acm.org/doi/10.1145/3829807.3829910
1•nohillside•4m ago•0 comments

Show HN: The static website validator/linter in Rust

https://github.com/raviqqe/muffy
3•raviqqe•5m ago•0 comments

Skate 3 in the Browser

https://skate.aaddpp.lol/
1•manlymuppet•6m ago•2 comments

Spend Elon Musk's Money

https://www.wired.com/story/spend-elon-musk-money/
2•cwal37•6m ago•1 comments

AI Agents Are Missing a Real Data and Memory Layer – We Built One

https://www.claix.dev
1•gael_dev•8m ago•0 comments

Show HN: I digitized 66,010 pages from a 32-year student broadcast archive

https://voku-pub.newtypecola.workers.dev/
1•newtypecola•10m ago•0 comments

Once the Cheat Code Is There

https://blog.veitheller.de/cheats.html
1•evakhoury•10m ago•0 comments

A Former AI Doomer Reveals a Dark Truth [video]

https://www.youtube.com/watch?v=jt508VjX2H8
1•ptrhvns•13m ago•0 comments

Show HN: Ztmux, daily driver tmux superset in Rust

https://github.com/MenkeTechnologies/ztmux
2•linuxdev25•14m ago•0 comments

Project 2025 Tracker

https://www.project2025.observer/en
3•embedding-shape•14m ago•0 comments

MongoDB Atlas Infinite

https://www.mongodb.com/company/blog/engineering/ground-beneath-database
1•sparc24•14m ago•0 comments

Classifying Emails with Jev and the OpenAI Decisions API

https://builders.abnormal.ai/p/classifying-emails-with-jev-and-the
1•sshh12•15m ago•0 comments

1M+ monthly code reviews in open-source repos delivered by CodeRabbit

https://www.coderabbit.ai/blog/one-million-open-source-reviews-september-2026
3•smb06•16m ago•1 comments

Handing an agent's browser clicks to Jev

https://hrishikesh917277.substack.com/p/handing-an-agents-browser-clicks
2•hrishi1990•16m ago•0 comments

Drones hit Yandex site in first major attack on Russian data hub

https://www.reuters.com/world/drones-hit-yandex-data-centre-first-major-attack-russian-data-hub-2...
5•mikelgan•16m ago•0 comments

Show HN: Abyss – ACP Agent Isolation with Middleware Support

https://abyss.scurry.io
2•everforward•16m ago•0 comments

The SQL ran fine. 58% of the answers were wrong (AI agents on a real warehouse)

https://github.com/neocatalystlabs/semlayer
3•rajdevnath•18m ago•0 comments

Fakegreen: Catch AI coding agents faking a green build (no LLM)

https://github.com/fitzyracing1/fakegreen
1•fitzyracing1•18m ago•1 comments

Victor Taelin Custom Harness

https://twitter.com/VictorTaelin/status/2108200878553588091
1•hmokiguess•19m ago•0 comments

Joining the dots between big AI

https://www.ft.com/content/8475dc9b-b2d4-4e10-a6b6-12796b11758a
1•gmays•19m ago•0 comments

Strategies for Pricing an AI Coding Agent Subscription to Ensure Profitability

https://www.rswebsols.com/news/strategies-for-pricing-an-ai-coding-agent-subscription-to-ensure-p...
1•noashavit•20m ago•0 comments