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?

Oh suddenly Habibi search trending everywhere

https://trends.google.com/trending
2•autoventure•2m ago•1 comments

Phone Harness: let your agent use your phone

https://phone-harness.com/
1•jonbaer•6m ago•0 comments

HyperDrone

https://hyperdrone.dev/
1•jonbaer•10m ago•0 comments

Google Says K-12 Students at Schools That Turn Off Its AI Tools Will Lose Search

https://www.ghacks.net/2026/11/04/google-says-k-12-students-at-schools-that-turn-off-its-ai-tools...
2•rdmuser•12m ago•2 comments

Hosted Markdown 2 medium tool

https://medium.com/@keith.hodges/markdown-2-medium-tool-d3711869b762
1•keithhodges•13m ago•0 comments

The State of Python Profiling in 2026

https://p403n1x87.github.io/the-state-of-python-profiling-in-2026.html
1•lumpa•14m ago•0 comments

Accelerating Engineering for the Physical World

https://openai.com/index/accelerating-engineering-for-the-physical-world/
1•gmays•17m ago•0 comments

Time || Space? Generation of Time and Dates in C Language:Generation of Space

http://www.catb.org/esr/time-programming/
1•efren6•18m ago•0 comments

Isometric SF

https://isometricsf.com/
3•avyfain•19m ago•0 comments

Show HN: Autorun-audit – find what runs when you open, CD into or install a repo

https://github.com/ag3ntsc4rn/autorun-audit
1•ag3ntsc4rn•19m ago•0 comments

Here Be Monsters

https://www.nybooks.com/online/2026/10/30/here-be-monsters/
1•benbreen•25m ago•0 comments

Half-Life in 23:58

https://www.youtube.com/watch?v=P74qS4zYmis
1•nonethewiser•31m ago•0 comments

Bansat – Make your AI agent write the blueprint before the code

https://github.com/bewithkhan/bansat
1•bewithkhan•33m ago•0 comments

Anthropic Needs to Disclose Its Tokenomics Before Its IPO

https://www.techpolicy.press/anthropic-needs-to-disclose-its-tokenomics-before-its-ipo/
2•JustinHendrix•35m ago•0 comments

Show HN: Botlark – HN for Agents

https://botlark.com/
1•1potato•36m ago•1 comments

Siri AI is now open to all developers

https://developer.apple.com/news/?id=gdk2umrf
4•gmays•36m ago•1 comments

Show HN: I turned 18 Agatha Christie novels into SQL murder cases

https://querythemurder.com/
3•jenikashah07•47m ago•1 comments

Quasi-Logarithmic Kitchen Timer

https://blog.coredump.cx/p/quasi-logarithmic-kitchen-timer
1•surprisetalk•50m ago•0 comments

Anthropic buys one-person Kendall Square biotech ahead of IPO. Here's why

https://www.masslive.com/news/2026/11/anthropic-buys-one-person-kendall-square-biotech-ahead-of-i...
3•thavalai•58m ago•0 comments

Agent State Machines: Building Deterministic Scaffolding for Agents

https://twitter.com/josharosen/status/2117687393213932003
3•gmays•58m ago•0 comments

Show HN: Exact integer LLL lattice basis reduction in C99

https://github.com/qawbecrdtey/clll
2•qawbecrdtey•1h ago•0 comments

Cat Wu joins OpenAI from Anthropic in product-lead coup

https://www.businessinsider.com/cat-wu-joins-openai-from-anthropic-product-lead-coup-2026-11
3•closetheloopdev•1h ago•0 comments

HawaiʻI Green Party Candidate Makes History, Edges Democrat

https://www.civilbeat.org/2026/11/hawaii-green-party-candidate-makes-history-edges-democrat/
2•PaulHoule•1h ago•0 comments

The anatomy of language model inference and reinforcement learning

https://www.nabo.dev/blogs/jam-architecture
2•nomi_uw•1h ago•0 comments

Competition for direct weight editing for models: Delta League

https://deltaleague.ai/
1•zmanian•1h ago•0 comments

Vietnam Jails Pirate Football Streamers for Up to a Year, Three Escape Prison

https://torrentfreak.com/vietnam-jails-pirate-football-streamers-for-up-to-a-year-three-escape-pr...
4•gslin•1h ago•0 comments

Kimi K3.1 Pro Recalls and Enforces Hidden Test Rules [pdf]

https://r40.org/papers/kimi_k31_benchmark_audit.pdf
3•cheshire_cat•1h ago•0 comments

Harvey AI Is Proud to Sponsor the HBO Original Series, War

https://www.instagram.com/reel/DfVLkeKtbyD/
1•flyingsky•1h ago•0 comments

I Rebuilt My Custom Calculator and Made It Worse [video]

https://www.youtube.com/watch?v=_a36lORxAdo
1•ProxyTracer•1h ago•0 comments

StateBench: Testing how language models track state changes over long documents

https://huggingface.co/blog/allenai/statebench
3•thedreammachine•1h ago•0 comments