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

The Game of Chomp

https://en.wikipedia.org/wiki/Chomp
1•Jun8•2m ago•0 comments

Microsoft Paper: LLMs Corrupt Your Documents When You Delegate (Arxiv.org)

https://arxiv.org/abs/2604.15597
1•wuschel•2m ago•0 comments

AI and Junk Development

https://zkmarek.com/blog/ai-and-junk-development-aka-pazdziez-development/
2•keyraycheck•3m ago•0 comments

Cloud agnostic: not unlike database agnostic

https://site.sebasmonia.com/posts/2026-04-22-cloud-agnostic--not-unlike-database-agnostic.html
2•speckx•5m ago•0 comments

Show HN: Keep up with your coding agents – Git Watchttower

https://gitwatchtower.dev/
2•drummel33•6m ago•0 comments

Health care price transparency (from the comments)

https://marginalrevolution.com/marginalrevolution/2026/04/on-health-care-price-transparency-from-...
2•paulpauper•6m ago•0 comments

Bitcoin Is Digging Deeeeeper

https://alphametrics.substack.com/p/bitcoin-is-digging-deeper
2•bratak•7m ago•0 comments

Balancing Act of Reliability

https://yusufaytas.com/balancing-act-of-reliability
10•benyields•8m ago•0 comments

Show HN: Search tool for Bay Area childcare license violations

https://azuki.vip/childcare/
2•bcrypt•9m ago•0 comments

HP's remote desktop push retreats as Anyware heads for end of life

https://www.theregister.com/2026/04/20/hp_anyware_eol/
2•bhouston•9m ago•1 comments

Why Your RL Agent Is Cheating (and How to Catch It)

https://rewardguard.dev/blog-why-rl-agents-cheat
2•DerekColins•10m ago•0 comments

I built an AI code reviewer bot for GitHub – no external APIs

https://github.com/basilevincenzo/ai-code-reviewer
2•basilevincenzo•14m ago•0 comments

(Disclose Act) Bill to End Dark Money in American Elections

https://kevinmullin.house.gov/2026/03/06/rep-mullin-reintroduces-bill-to-end-dark-money-in-americ...
2•rawgabbit•15m ago•0 comments

EverQuest, the MMO that changed everything (2019)

https://www.pcgamer.com/breaking-the-internet-the-story-of-everquest-the-mmo-that-changed-everyth...
2•awkwardpotato•17m ago•0 comments

Chernobyl 40 Years On

https://yunzi.co.uk/chernobyl-40-years-on/
2•speckx•17m ago•0 comments

Atlantic '41

https://stephanrewind.itch.io/atlantic-41
2•ndr42•17m ago•1 comments

Report of the Yale Committee on Trust in Higher Education [pdf]

https://president.yale.edu/sites/default/files/2026-04/Report-of-the-Committee-on-Trust-in-Higher...
2•loughnane•18m ago•0 comments

OpenAI Reportedly Working on an AI Smartphone to Rival iPhone

https://www.macrumors.com/2026/04/27/openai-working-on-an-ai-smartphone/
2•newusertoday•21m ago•0 comments

Sergey Brin Moves to the Right, with a 'MAGA Girlfriend' by His Side

https://www.nytimes.com/2026/04/27/us/politics/sergey-brin-gg-soto-trump-california-billionaire-t...
3•carabiner•21m ago•0 comments

'Existential Risk': Western Car Companies Are Blowing the Software Race

https://insideevs.com/features/794029/how-western-companies-are-losing-the-software-race/
2•01-_-•22m ago•0 comments

Eliminating AI Failure Modes Using DSLs – The Drafter Pattern

https://georgianailab.substack.com/p/the-drafter-pattern-a-design-pattern
2•nahimn•22m ago•0 comments

Trump admin fires independent board overseeing the National Science Foundation

https://apnews.com/article/national-science-board-nsf-trump-6a23f3ab1b4c6eb131b4e79d95b3536f
4•Bondi_Blue•23m ago•1 comments

OpenAI breaks off Microsoft exclusivity to free up path for Amazon, Google deals

https://www.reuters.com/legal/litigation/microsoft-end-exclusive-license-openais-technology-2026-...
3•01-_-•23m ago•0 comments

Show HN: Erdös Problem Solver Agent

https://github.com/demirbey05/erdos-problem-solver-cli
2•demirbey05•23m ago•0 comments

GitHub Alternatives?

5•krthr•23m ago•3 comments

Critical Perspectives on Provable Security: 15 Years of "Another Look" Papers [pdf]

https://www.math.uwaterloo.ca/~ajmeneze/anotherlook/papers/critper.pdf
2•ogogmad•25m ago•0 comments

Being a Manager: Hiring AI

https://thorprojects.com/2026/04/21/being-a-manager-hiring-ai/
2•speckx•25m ago•0 comments

We Were Unique

https://www.likeus.blog/p/we-were-unique
3•nathan-wall•26m ago•0 comments

BezelBase – Vintage Rolex Reference Database

https://bezelbase.org/wiki/Main_Page
4•pawelb0•26m ago•0 comments

CIA Reportedly Used Secret Quantum Tool to Find Downed Airman in Iran

https://tech.slashdot.org/story/26/04/08/0152253/cia-reportedly-used-secret-quantum-tool-to-find-...
3•us321•28m ago•2 comments