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

The Anatomy of an Agent Harness

https://blog.langchain.com/the-anatomy-of-an-agent-harness/
1•onurkanbkrc•1m ago•0 comments

Muninn: Web Statistics

https://blog.chrislewis.me.uk/?post=2026-04-06-Muninn-Web-Statistics
1•paulcapewell•1m ago•0 comments

Trump dilemma for US officers: disobey orders or commit war crimes

https://www.theguardian.com/law/2026/apr/06/trump-threats-dilemma-for-officers-disobey-orders-or-...
1•KnuthIsGod•3m ago•0 comments

The JetStream 3 Benchmark Suite

https://webkit.org/blog/17899/introducing-the-jetstream-3-benchmark-suite/
1•djfergus•4m ago•0 comments

JetStream 3: A modern benchmark for high-performance, compute-intensive Web apps

https://blog.chromium.org/2026/03/jetstream-3-a-modern-benchmark.html
1•djfergus•4m ago•0 comments

Australia's most decorated soldier charged with committing war crime murders

https://www.nbcnews.com/world/australia/australias-decorated-soldier-charged-committing-5-war-cri...
1•KnuthIsGod•4m ago•0 comments

Show HN: claude-telemetry – Multi-PC usage dashboard for Claude Code

https://github.com/RyanTech00/claude-telemetry
1•RyanTech00•5m ago•0 comments

The AI Roadmap: How We Ensure AI Serves Humanity

https://www.humanetech.com/ai-roadmap
1•rapnie•5m ago•0 comments

Show HN: Go – Based Unix GUI app for local network management

https://github.com/yofabr/nocta
1•yofabr•8m ago•0 comments

Curated experiments that behave like Desktop UIs

https://simone.computer/#/webdesktops
1•keepamovin•12m ago•0 comments

Essay on AI – Exploring the transformative impact of AI on modern society

https://emitknowledge.com/essay-on-ai/
1•marjann•13m ago•0 comments

How Do You Find an Illegal Image Without Looking at It?

https://mahmoud-salem.net/the-invisible-shield
1•pjullrich•13m ago•1 comments

Show HN: Secure SDLC Agents for Claude and Cursor (MCP)

https://github.com/Kaademos/secure-sdlc-agents
1•kirumachi•15m ago•0 comments

Wisconsin governor says 'no' to age checks for porn

https://www.theverge.com/policy/907761/wisconsin-governor-porn-age-verification-vetoed
1•timpera•17m ago•1 comments

Show HN: An AI-powered knowledge base that thinks

https://github.com/Shelter41/thedirector
1•DSpider•18m ago•0 comments

Quansloth Using Google's Turboquant Breaks the "VRAM Wall" for Local LLMs

https://github.com/PacifAIst/Quansloth
1•gunzfanatic•20m ago•0 comments

JSIR: A High-Level IR for JavaScript

https://discourse.llvm.org/t/rfc-jsir-a-high-level-ir-for-javascript/90456
2•maxloh•20m ago•0 comments

Deterministic O(1) coordination via Recursive Field Invariants

https://github.com/9261834245z-ui/UltraCore-Protocol
1•TOT__7__•22m ago•1 comments

MAIP – Machine Agent Identity Protocol

1•dividebyzero-gt•22m ago•0 comments

Show HN: Browser-based M68K interpreter supports MOVEM,data defs,and disp. addr

https://github.com/gianlucarea/m68k-interpreter
2•aldino97•24m ago•0 comments

Show HN: Snill – Describe your business, get a complete internal system

https://snill.ai/
1•knutmartin•25m ago•0 comments

We parsed 1,031 WA breach filings. Malware hides 5x longer than ransomware

https://ciphercue.com/blog/ransomware-detected-19-days-malware-takes-93
1•adulion•25m ago•0 comments

Bridddge – Control LinkedIn Automation from Claude Code

https://bridddge.com/en
1•karterswitch•27m ago•1 comments

An Arctic Road Trip Brings Vital Underground Networks into View

https://www.quantamagazine.org/an-arctic-road-trip-brings-vital-underground-networks-into-view-20...
1•ibobev•27m ago•0 comments

Sorting performance rabbit hole

https://nibblestew.blogspot.com/2026/04/sorting-performance-rabbit-hole.html
1•ibobev•28m ago•0 comments

Writing an LLM from scratch, part 32h – Interventions: full fat float32

https://www.gilesthomas.com/2026/04/llm-from-scratch-32h-interventions-full-fat-float32
2•ibobev•28m ago•0 comments

The browser extension API setUninstallURL violates user privacy

https://lapcatsoftware.com/articles/2026/4/1.html
1•latexr•28m ago•0 comments

Show HN: Niquests – A Requests fork, three years of catching Python's HTTP up

https://github.com/jawah/niquests/tree/v3.18.4
1•mesahm•33m ago•0 comments

Blackholing My Email

https://www.johnsto.co.uk/blog/blackholing-my-email/
2•semyonsh•33m ago•0 comments

How to Make a Complete Map of Every Thought You Think (2003) [pdf]

https://users.speakeasy.net/~lion/nb/book.pdf
2•Rygian•34m ago•0 comments