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?

The Math on AI Agents Doesn't Add Up

https://www.wired.com/story/ai-agents-math-doesnt-add-up/
1•brycehalley•1m ago•1 comments

So, why *should* GNOME support server side decorations?

https://blister.zip/posts/gnome-ssd/
1•birdculture•4m ago•0 comments

Umping giants: Fossils show giant prehistoric kangaroos could still hop

https://www.manchester.ac.uk/about/news/jumping-giants-fossils-show-giant-prehistoric-kangaroos-c...
1•gnufx•4m ago•0 comments

Airlines to save big money on fuel as new weight loss pills gain popularity

https://www.cnbc.com/2026/01/14/airlines-to-save-on-fuel-as-weight-loss-pills-grow-popular-wall-s...
1•fortran77•5m ago•0 comments

JSX for AI Video

https://varg.ai/sdk
2•mifydev•6m ago•0 comments

You can now talk to your shell in plain language

https://www.nlsh.dev/
2•JunaidL•7m ago•0 comments

CloudlyKit – a chatkit widget for your site (after struggling with ChatKit)

https://www.cloudlykit.com/
1•jacoblarszon•8m ago•1 comments

Like digging 'your own professional grave': The translators losing work to AI

https://www.cnn.com/2026/01/23/tech/translation-language-jobs-ai-automation-intl
2•methuselah_in•10m ago•0 comments

(Open) Widevine support added to the Chromium port

https://undeadly.org/cgi?action=article;sid=20260118112808
1•speckx•10m ago•0 comments

Show HN: Multi-agent deliberation plugin for Claude Code

https://github.com/BayramAnnakov/agent-tower-plugin
1•Bayram•11m ago•0 comments

Data Structures and Algorithms – Preparing for Interviews

https://tech.stonecharioteer.com/posts/2026/dsa/
1•stonecharioteer•12m ago•0 comments

A Better Practices Guide to Using Claude Code

https://kylestratis.com/posts/a-better-practices-guide-to-using-claude-code/
1•csoham•13m ago•0 comments

"Content Unavailable" – YouTube's latest attempt at breaking ad blockers

https://www.androidpolice.com/youtube-content-unavailable-bug/
3•mikece•16m ago•0 comments

Rust's Standard Library on the GPU

https://www.vectorware.com/blog/rust-std-on-gpu/
1•PaulHoule•16m ago•0 comments

DevCon Fall 2025 – Tracking AI generated code with Git [video]

https://www.youtube.com/watch?v=irK4G2SzhpA
1•addcn•17m ago•0 comments

Gold To 5000 USD, accelerates for more?

https://www.cnbc.com/quotes/@GC.1
3•trilogic•17m ago•2 comments

Show HN: 83 browser-use trajectories, visualized

https://trails-red.vercel.app/viewer
2•wayy•17m ago•0 comments

Steve Yegge Promoting "Gas Town" Crypto Coin

https://steve-yegge.medium.com/bags-and-the-creator-economy-249b924a621a
2•toraway•18m ago•0 comments

Show HN: First autonomous ML and AI engineering Agent

https://marketplace.visualstudio.com/items?itemName=NeoResearchInc.heyneo
1•svij137•18m ago•0 comments

They quit their jobs to bet on current events: A look inside prediction markets

https://www.npr.org/2026/01/21/nx-s1-5672615-e1/they-quit-their-day-jobs-to-bet-on-current-events...
1•paulpauper•22m ago•0 comments

Student Created Website reveals slow speeds of TTC streetcars in real time

https://www.youtube.com/watch?v=h-bgoxTdCJc
1•debo_•23m ago•0 comments

AI #152: Brought to You by the Torment Nexus

https://thezvi.substack.com/p/ai-152-brought-to-you-by-the-torment
2•paulpauper•23m ago•0 comments

Betting on Prediction Markets Is Their Job. They Make Millions

https://www.nytimes.com/2026/01/22/business/prediction-markets-polymarket-kalshi.html
1•paulpauper•24m ago•0 comments

The H.R. 7148 Amendment to repeal government "kill switches" in cars has failed

https://clerk.house.gov/Votes/202643
7•tokyobreakfast•25m ago•0 comments

Ask HN: Has the macOS design become too iOS-like?

2•Austin_Conlon•25m ago•2 comments

We have to re-learn to walk alone

https://blog.julik.nl/2026/01/go-fast-and-go-alone
1•julik•25m ago•0 comments

The Vic/VolksComputer Series

https://www.zimmers.net/cbmpics/hvic.html
1•geox•26m ago•0 comments

Measuring ROI in AI era: The language effect

https://jellyfishresearch.substack.com/p/measuring-roi-in-ai-era-the-language
1•gailaxelrod•27m ago•0 comments

Gender ideology has been a disaster for working-class women

https://spectator.com/article/gender-ideology-has-been-a-disaster-for-working-class-women/
2•puggen•27m ago•0 comments

Show HN: A brutalist architectural framework for CLI-based workflows

https://github.com/lucky7xz/drako
1•lucky7xz•27m ago•0 comments