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?

Show HN: AgoraPages – A Collaborative Website Builder

https://agorapages.com
1•APMikeDotNet•50s ago•0 comments

ChatGPT to start showing ads in the US

https://www.theguardian.com/technology/2026/jan/16/chatgpt-ads-in-revenue-boost
1•trocado•1m ago•0 comments

Rate Limiting, Cells, and GCRA

https://brandur.org/rate-limiting
1•panic•2m ago•0 comments

Meet the new biologists treating LLMs like aliens

https://www.technologyreview.com/2026/01/12/1129782/ai-large-language-models-biology-alien-autopsy/
1•CharlesW•2m ago•0 comments

The fashion industry that is tech

https://www.baldurbjarnason.com/2025/the-fashion-that-is-tech/
1•random_duck•7m ago•1 comments

Adsly – a marketplace for direct sponsorships and partnerships

https://adsly.io
1•ksl_dev•9m ago•1 comments

Can you legally defend yourself against an attacking police officer? (2017)

https://law.stackexchange.com/questions/16695/can-you-legally-defend-yourself-against-an-attackin...
2•zahlman•10m ago•0 comments

Keifu – A TUI for navigating commit graphs with color and clarity

https://github.com/trasta298/keifu
1•indigodaddy•10m ago•0 comments

Satellogic to Deliver Two Mark V High-Resolution Satellites

https://investors.satellogic.com/news-releases/news-release-details/satellogic-signs-18mm-usd-agr...
1•wslh•13m ago•0 comments

Acetaminophen during pregnancy does not increase risk of autism, ADHD or IDs

https://medicalxpress.com/news/2026-01-acetaminophen-pregnancy-autism-adhd-intellectual.html
2•bikenaga•13m ago•1 comments

The One Trick to 10x Your Database Performance [video]

https://www.youtube.com/watch?v=934J1v_B238
1•p0u4a•22m ago•0 comments

LLMs Are Lagging Indicators

https://hollisrobbinsanecdotal.substack.com/p/llms-are-lagging-indicators
1•HR01•24m ago•0 comments

Show HN: Claude-Config – Dotfiles for Claude Code

https://github.com/sumchattering/claude-config
1•sumeruchat•34m ago•0 comments

Show HN: WPTR – We built an automated audit lab for Headless WordPress

https://www.wptr.net
1•gezginweb•35m ago•0 comments

Show HN: Commander AI – Mac UI for Claude Code

https://commanderai.app/
2•krzyzanowskim•35m ago•1 comments

Structural Stability and Morphogenesis: An Outline of a General Theory of Models [pdf]

https://uberty.org/wp-content/uploads/2015/12/Thom-Structural-Stability-and-Morphogenesis.compres...
1•foster_nyman•36m ago•1 comments

Bank opacity and deposit rates

https://www.nber.org/papers/w34618
3•hhs•38m ago•0 comments

Bazalgette Embakment

https://diamondgeezer.blogspot.com/2026/01/bazalgette-embakment.html
1•zeristor•40m ago•0 comments

The past, present and future of LLM coding

https://www.hermandaniel.com/blog/20260116-my-take-on-LLM-coding/
2•kekqqq•40m ago•1 comments

HTTP Instagram.com Japouni_02

1•chahinee•40m ago•0 comments

Show HN: Super AI Markets – Testing Ground for AI Shopping Agent Security

https://superaimarkets.com/
1•jmchugh9•44m ago•0 comments

Why Americans Can't Buy the Best Electric Car

https://www.nytimes.com/2025/07/08/opinion/byd-china-car-ev.html
5•zzzeek•45m ago•3 comments

How Nature Works: The Science of Self-Organized Criticality [pdf]

https://neurocurso.wordpress.com/wp-content/uploads/2016/05/per-bak_how-nature-works_-the-science...
1•foster_nyman•46m ago•0 comments

Langauge Modeling, Part 3: Vanilla RNNs

https://connorjdavis.substack.com/p/language-modeling-part-3-vanilla
1•cjamsonhn•50m ago•0 comments

Simulario – A physics simulation based game

https://x.com/ZoldenGames
2•LordSeptum•55m ago•0 comments

Why 'basic science' is the foundation of innovation

https://news.berkeley.edu/2026/01/15/from-quantum-theory-to-the-modern-laser-why-basic-science-is...
1•hhs•55m ago•0 comments

Engine-Bench: Benchmarking Coding Agents on TCG Game Engine Tasks

https://github.com/JoshuaPurtell/engine-bench
1•JoshPurtell•56m ago•0 comments

FLUX.2 [Klein]: Towards Interactive Visual Intelligence

https://bfl.ai/blog/flux2-klein-towards-interactive-visual-intelligence
2•GaggiX•56m ago•0 comments

Caliper: Right-size your CI runners

https://www.attune.inc/blog/caliper
1•greenRust•57m ago•0 comments

Babyfiend.net

https://babyfiend.net/
2•martialg•1h ago•0 comments