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?

Unpleasant Design and Hostile Urban Architecture (2016)

https://99percentinvisible.org/episode/unpleasant-design-hostile-urban-architecture/
1•jacobedawson•1m ago•0 comments

Against Generative AI: Is Art the Last Refuge of Our Humanity?

https://lithub.com/against-generative-ai-is-art-the-last-refuge-of-our-humanity/
1•FigurativeVoid•3m ago•0 comments

African trade has been vastly underestimated

https://www.economist.com/middle-east-and-africa/2026/01/18/african-trade-has-been-vastly-underes...
1•petethomas•5m ago•0 comments

Results from the 2025 Go Developer Survey

https://go.dev/blog/survey2025
1•prattmic•7m ago•0 comments

A zero-overhead bridge between C++23 std:mdspan and CUTLASS cute layouts

https://github.com/weyl-ai/mdspan-cute
1•benreesman•11m ago•1 comments

SUPERMAN Written by James Gunn [pdf]

https://www.superman.com/script/supermanscript.pdf
1•hbcondo714•11m ago•0 comments

Sine – The ultimate theme manager for Firefox-based browsers

https://github.com/CosmoCreeper/Sine
1•modinfo•12m ago•0 comments

Show HN: Roo Code Slack: end to end agentic workflow in Slack

https://www.youtube.com/watch?v=dJM_8HHGe1E
1•hrudolph•18m ago•0 comments

Ask HN: CVAT users, how do you QA labels?

1•Abderrahman54•18m ago•1 comments

2025 AI Wrapped: What I've Shipped with 100% AI-generated code

https://www.jsrowe.com/ai-wrapped-evolution-of-using-ai-every-day/
3•jsr6720•20m ago•0 comments

Best Practices for Claude Code

https://code.claude.com/docs/en/best-practices
1•mfiguiere•20m ago•0 comments

Show HN: Markdown TOC generator for JavaScript builds.Works recursively for repo

1•datalackey•20m ago•0 comments

Delta single handle ball faucets (1963)

https://archive.org/details/DeltaSingleHandleBallFaucets
1•userbinator•21m ago•0 comments

Meta Pays $3B for Manus: Its Fastest Path to AI Agent Dominance

https://gilpignol.substack.com/p/meta-pays-3-billion-for-manus-its
1•light_triad•21m ago•0 comments

Show HN: Wisp: Stateful Claude Code Management

https://github.com/canaanmckenzie/Wisp
2•prince_nez•24m ago•0 comments

ClearFlow Keyboard

https://clearflowkeyboard.github.io/
2•_thisdot•26m ago•0 comments

SlimEdge: Lightweight Distributed DNN Deployment on Constrained Hardware

https://arxiv.org/abs/2512.22136
1•PaulHoule•30m ago•0 comments

High speed graphics rendering research with tinygrad/tinyJIT

https://github.com/quantbagel/gtinygrad
3•quantbagel•31m ago•0 comments

Show HN: Laptop Stickers – cheap individual short run stickers

https://laptopstickers.store/
1•decryption•32m ago•0 comments

Libcurl Memory Use Some Years Later

https://daniel.haxx.se/blog/2026/01/21/libcurl-memory-use-some-years-later/
3•firesteelrain•33m ago•0 comments

Waymo founder John Krafcik: Tesla's Full Self-Driving has 'bad case of myopia'

https://electrek.co/2026/01/20/waymo-founder-john-krafcik-teslas-full-self-driving-myopia/
1•senti_sentient•37m ago•0 comments

Infinite Jest

https://infinijest.com
3•hn_throway•38m ago•1 comments

Show HN: I built an AI that calls you and practices spoken English with you

https://englishcall.online/
2•rahma_tm•40m ago•0 comments

Why Big Tech Performance Reviews Aren't Meritocratic

https://medium.com/data-science-collective/big-tech-performance-review-01fff2c5924d
3•dikobraz•49m ago•1 comments

Time Until Someone Points Out This Is Not a Real Study

https://journal-preliminary-results.fly.dev/38472951
1•ipnon•53m ago•0 comments

Agree or Disagree

https://a-or-d.lovable.app
2•Conceiver•53m ago•0 comments

Dev Logs Without the Noise (2024)

https://peterlyons.com/problog/2024/08/dev-logs-without-the-noise/
1•mooreds•53m ago•0 comments

Ruby_LLM-agents: A Rails agent framework for RubyLLM

https://github.com/adham90/ruby_llm-agents
1•thunderbong•55m ago•0 comments

The secret fast track for animal drugs (2025)

https://worksinprogress.co/issue/the-secret-fast-track-for-animal-drugs/
1•mooreds•55m ago•0 comments

Rise in Sophisticated Dark Patterns Designed to Trick and Trap Consumers (2022)

https://www.ftc.gov/news-events/news/press-releases/2022/09/ftc-report-shows-rise-sophisticated-d...
4•wslh•58m ago•0 comments