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

My hot take on vibe coding for PMs

https://www.ddmckinnon.com/2026/02/11/my-%f0%9f%8c%b6-take-on-vibe-coding-for-pms/
1•awaxman11•28s ago•0 comments

AI: Brainrot Inducer or Cognitive Multiplier?

https://www.cjroth.com/blog/2026-02-12-brainrot
1•thoughtfulchris•1m ago•0 comments

Deft – a class and interface system for Clojure[video]

https://www.youtube.com/watch?v=dlW6YzwUZ-M
1•sammy0910•1m ago•0 comments

AI and consciousness: from objective descriptions to 'level zero'

https://randomseed.io/txt/ai-and-consciousness/
1•siefca•3m ago•0 comments

Cloudflare adds real-time Markdown rendering for AI agents

https://blog.cloudflare.com/markdown-for-agents/
3•thestackfox•4m ago•0 comments

A Read-Only Philosophical Archive on Restraint and AI Ethics

https://coexilia.io/coexilian-documents/
1•aegissolis•4m ago•1 comments

RFK Jr. food pyramid site links to Grok, which says you shouldn't trust RFK Jr

https://arstechnica.com/health/2026/02/rfk-jr-food-pyramid-site-links-to-grok-which-says-you-shou...
1•doener•4m ago•0 comments

Skip the Tips: A game to select "No Tip" but dark patterns try to stop you

https://skipthe.tips/
1•randycupertino•5m ago•1 comments

Amazon's Ring cancels Flock partnership amid Super Bowl ad backlash

https://www.cnbc.com/2026/02/12/amazons-ring-cancels-flock-partnership-amid-super-bowl-ad-backlas...
1•zzzeek•8m ago•0 comments

Z-Image Implemented in NCNN Vulkan

https://github.com/nihui/zimage-ncnn-vulkan
2•luyu_wu•11m ago•0 comments

Show HN: I taught AI to remember. Then it warned me

https://github.com/Relic-Studios/ISSA-Repository
1•relicstudios•11m ago•0 comments

What happens when capability decouples from credentials?

1•falsework•11m ago•0 comments

Bryan Johnson's Immortals program costs $1M. How to DIY it <1% of the price

https://www.empirical.health/blog/bryan-johnson-immortals-program-diy/
1•brandonb•12m ago•0 comments

True, Relevant, and Wrong: The Applicability Problem in RAG

https://www.pinecone.io/learn/series/beyond-retrieval/rag-applicability-problem/
2•gk1•14m ago•0 comments

Coinbase Posts $667M Net Loss, Revenue Declines 20%

https://www.bloomberg.com/news/articles/2026-02-12/coinbase-posts-667-million-loss-sees-revenue-t...
3•petethomas•15m ago•0 comments

Leveraging LLMs to extract smoking history from clinical notes

https://www.nature.com/articles/s41746-025-02009-y
1•biosubterranean•16m ago•1 comments

Rovo Dev is now generally available in VS Code

https://www.atlassian.com/blog/announcements/rovo-dev-now-generally-available-in-vs-code
1•cebert•16m ago•1 comments

I built Doppelganger: a self-hosted automation tool that isn't slow or outdated

https://doppelgangerdev.com
2•asernasr•16m ago•0 comments

EXT4 in Linux 7.0 Improves Write Performance for Concurrent Direct I/O Writes

https://www.phoronix.com/news/Linux-7.0-EXT4
2•Bender•16m ago•0 comments

XFS Introducing Autonomous Self-Healing Capabilities with Linux 7.0

https://www.phoronix.com/news/XFS-Linux-7.0
2•Bender•17m ago•0 comments

Show HN: Mango Lollipop – AI-powered lifecycle messaging generator

https://github.com/sr-kai/mango-lollipop
1•Nlupus•21m ago•0 comments

Hacktivists, State Actors, Cybercriminals Target Global Defense Industry

https://www.securityweek.com/hacktivists-state-actors-cybercriminals-target-global-defense-indust...
3•Bender•22m ago•0 comments

FTC Chairman Andrew N. Ferguson Issues Warning Letter to Apple CEO Tim Cook

https://www.ftc.gov/news-events/news/press-releases/2026/02/federal-trade-commission-chairman-and...
4•jacquesm•23m ago•2 comments

Vim-pencil: Rethinking Vim as a tool for writing

https://github.com/preservim/vim-pencil
2•gurjeet•24m ago•0 comments

Isomorphic unlocks a new frontier in AI drug design

https://www.isomorphiclabs.com/articles/the-isomorphic-labs-drug-design-engine-unlocks-a-new-fron...
1•lysozyme•29m ago•0 comments

Show HN: Non-Custodial Crypto Payment SDK for Node.js (BTC, ETH, Sol, USDC)

https://www.npmjs.com/package/@profullstack/coinpay
1•cranberryturkey•29m ago•0 comments

On The Crank Spectrum

https://exple.tive.org/blarg/2026/02/07/on-the-crank-spectrum/
2•pabs3•29m ago•0 comments

New Linear Homepage (2026)

https://linear.app/homepage
1•cristinacordova•30m ago•0 comments

Standards for Shipping Production LLM Features

https://teotti.com/8-standards-for-building-production-ready-features-using-llms/
1•agenteo•31m ago•1 comments

Utter Disregard for Git Commit History (2015)

https://zachholman.com/posts/git-commit-history/
1•pabs3•32m ago•0 comments