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

Reuse of Public Keys Across UTXO and Account-Based Cryptocurrencies

https://arxiv.org/abs/2601.19500
1•Anon84•1m ago•0 comments

The Relocation-Friendly Tech Jobs Report (2026)

https://relocateme.substack.com/p/the-relocation-friendly-tech-jobs-38c
1•hunglee2•1m ago•0 comments

What's New in Peergos in 2025

https://peergos.org/posts/2025
1•ianopolous•7m ago•0 comments

A Theory of Cognitive Inequality

https://davidbessis.substack.com/p/attention-is-all-we-have
2•leto_ii•9m ago•0 comments

Sandboxed script execution from VBA with support for module system

https://github.com/ECP-Solutions/ASF/blob/main/README.md
1•n013•9m ago•0 comments

Show HN: Find better round trips – TSP challenge

https://tsp-game.graphhopper.com/
1•oblonski•11m ago•0 comments

Can you treat AI as a tool?

https://rybarix.com/tils/ai-anthropo
1•sandruso•12m ago•1 comments

"Dive" into Hydrogen Storage Materials Discovery with AI Agents

https://www.tohoku.ac.jp/en/press/dive_into_hydrogen_storage_materials_discovery_with_ai_agents.html
1•JeanKage•12m ago•0 comments

Who has the lowest Erdos-Bacon-Epstein number?

https://statmodeling.stat.columbia.edu/2025/11/23/who-has-the-lowest-erdos-bacon-epstein-number/
1•varjag•17m ago•0 comments

Craftsmanship vs. Abstraction

https://karim.cloud/blog/posts/craftsmanship-vs-abstraction
2•k_shehadeh•18m ago•0 comments

Databricks Lakebase is now Generally Available

https://www.databricks.com/blog/databricks-lakebase-generally-available
1•bat_sy•20m ago•0 comments

A fast developer tools website

1•darth-cassan•20m ago•0 comments

UAE Firm Took Stake in the Trump Family's Crypto Company

https://www.nytimes.com/2026/02/01/us/politics/trump-crypto-uae-world-liberty.html
1•zerosizedweasle•21m ago•0 comments

26 years ago – The Joel Test: 12 Steps to Better Code (2000)

https://www.joelonsoftware.com/2000/08/09/the-joel-test-12-steps-to-better-code/
1•tamnd•23m ago•0 comments

Resist and Unsubscribe

https://www.resistandunsubscribe.com
3•gizzlon•23m ago•0 comments

Simulating Crowds in Hitman (2012) [pdf]

https://media.gdcvault.com/gdceurope2012/Presentations/Programming/Kasper_Fauerby_Programming_Cro...
1•tetris11•25m ago•1 comments

Writing an RSS reader in 80 lines of bash

https://yobibyte.github.io/yr.html
1•todsacerdoti•25m ago•0 comments

Self-Hosted Home, Part 1: Design and Planning

https://blog.fidelramos.net/software/self-hosted-home-1
3•fidelramos•26m ago•0 comments

Multi-layer defense for LLM agents inspired by immune systems (seeking critique)

https://gist.github.com/andreschauer/e0f958c2a279062559ae8306f946b43d
1•ono_hn•29m ago•0 comments

Treating cancer in morning seems to substantially beat treating later in day

https://twitter.com/cremieuxrecueil/status/2018717068573413848
2•tosh•31m ago•1 comments

Msgvault: Archive a lifetime of email and chat. Offline search, analytics, query

https://github.com/wesm/msgvault
1•ingve•33m ago•0 comments

Dash0 Acquires Lumigo to Expand Agentic Observability

https://www.dash0.com/blog/dash0-acquires-lumigo-to-expand-agentic-observability-across-aws-and-s...
1•puppion•33m ago•0 comments

Microsoft 365, Nextcloud and the trade-offs you need to be aware of

https://cloudepart.com/2026/02/microsoft-365-nextcloud-and-the-trade-offs-you-need-to-be-aware-of/
1•aeuropean12•33m ago•1 comments

Recent slop in OSS reminds me of "Data Smog" by David Shenk (1997)

https://archive.nytimes.com/www.nytimes.com/books/97/07/06/daily/data-book-review.html
1•omkar-foss•34m ago•0 comments

Coleman–Liau Readability Index

https://en.wikipedia.org/wiki/Coleman%E2%80%93Liau_index
1•letientai299•34m ago•0 comments

Run Claude Code and Codex from Telegram with Takopi

https://banteg.xyz/posts/takopi/
2•anupamchugh•35m ago•0 comments

Writing an Async Runtime in Rust

https://michaelhelvey.dev/posts/rust_async_runtime
1•fanf2•35m ago•0 comments

Kubernetes Learned to Resize Pods Without Restarting Them

https://medium.com/@dinidusachintha/how-kubernetes-learned-to-resize-pods-without-restarting-them...
1•anonymzz•37m ago•0 comments

Operational Sympathy

https://afkham-azeez.medium.com/operational-sympathy-8a9c5dc26b5a
2•anonymzz•40m ago•0 comments

Adobe is killing off software animators around the world are using every day

https://aftermath.site/adobe-animate-sunset-kill-off-ai-bullshit/
1•mrzool•41m ago•0 comments