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?

Getting Started with Snobol – Ratfactor

https://ratfactor.com/cards/start-snobol
1•rbanffy•1m ago•0 comments

Is Traditional Software Engineering Dead?

https://twitter.com/naval/status/2028314493206585471
1•MrBuddyCasino•2m ago•0 comments

Let OpenClaw bot to manage your issues and Git repositories

https://gisia.dev/docs/ai-bot-skills
1•okoddcat•6m ago•1 comments

After gunshots in entertainment district: Waymo taxi blocks ambulance in Austin

https://www.heise.de/en/news/After-gunshots-in-entertainment-district-Waymo-taxi-blocks-ambulance...
1•doener•6m ago•0 comments

Show HN: Deterministic symbolic memory layer for grounding LLMs

https://github.com/Th3Hypn0tist/SymbolicMemoryMCP
1•Th3Hypn0tist•9m ago•0 comments

Lean and AI caught a bug in my 2-year-old TLA+ spec

https://medium.com/@polyglot_factotum/on-what-the-future-of-software-looks-like-today-ea9d53e647a7
1•polyglotfacto•10m ago•1 comments

Why was the Commodore 64 disk drive so slow?

https://imrannazar.com/articles/commodore-1541
1•Two9A•13m ago•0 comments

The Forever Wars of 1984

https://junot.substack.com/p/the-forever-wars-of-nineteen-eighty
1•jbegley•14m ago•0 comments

How to identify assumptions by distorting times

https://www.jonesabi.com/blog/thinking-tools-how-to-identify-assumptions-by-distorting-time
1•r4um•14m ago•0 comments

Show HN: Synthesize complex agent training data with just a few lines of code

https://github.com/OpenDCAI/AgentFlow
1•Junnn•15m ago•0 comments

Junot Diaz on George Orwell

https://thesirennews.com/junot-diaz-on-george-orwells-hate-day/
1•jbegley•16m ago•0 comments

Java Running Directly on Apple Silicon GPUs with TornadoVM Metal Codegen

https://github.com/beehive-lab/TornadoVM/pull/796
2•mikepapadim•17m ago•0 comments

Banned on Lobsters

https://medv.io/blog/banned-on-lobsters
2•medv•19m ago•1 comments

Data-structure-typed – TreeMap, Heap, Graph and more for TypeScript

https://github.com/zrwusa/data-structure-typed
1•zrwusa•19m ago•1 comments

PocketEngineer R1.1.0 – 4 new tools and QoF improvements

https://www.pockeng.com/
1•levario_studio•19m ago•1 comments

Show HN: Securos – Security-focused platform with hardened architecture

https://securos.org/
1•temple_ent•22m ago•0 comments

Converting dash cam videos into Panoramax images

https://www.openstreetmap.org/user/FeetAndInches/diary/408268
1•marklit•25m ago•0 comments

Gram: A Zed fork without all the AI

https://gram.liten.app/
2•todsacerdoti•28m ago•0 comments

Ask HN: Tools to Flag Vibecoded Repos?

1•pabs3•28m ago•0 comments

Show HN: Axiom – structural OCR for handwritten STEM notes

https://www.useaxiomnotes.com
1•mrajatnath•29m ago•1 comments

Ryzen AI Pro 400 Series Desktop CPUs for AI-Focused Computing

https://www.phoronix.com/news/Ryzen-AI-PRO-400-Desktop-CPUs
1•tankenmate•35m ago•0 comments

Show HN: OpenBets – AI agents build souls through prediction bets

https://openbets.bot
1•paifamily•35m ago•0 comments

Triplet Superconductor

https://www.sciencedaily.com/releases/2026/02/260221000252.htm
1•jonbaer•35m ago•0 comments

Show HN: Pooch PDF – Save Web Articles as Clean PDFs to Google Drive

https://poochpdf.com/
2•membrshiperfect•36m ago•0 comments

Show HN: On-device article extraction and ePub generation in a React Native app

1•chapiware•39m ago•0 comments

Figma blocks userland MCP tool so user clones Figma in one weekend

https://twitter.com/dan_note/status/2028201388074013048
2•swyx•44m ago•1 comments

Why it's difficult to NOT snack, even after a meal

https://www.sciencedirect.com/science/article/pii/S0195666325005434
1•omkar-foss•44m ago•0 comments

Hacking Super Mario 64 using covering spaces

https://happel.ai/posts/covering-spaces-geometries-visualized/
1•nill0•45m ago•0 comments

Show HN: Xpandas – running Pandas-style computation directly in pure C++

2•xqli•45m ago•0 comments

Visual Explainer Agent Skill

https://github.com/nicobailon/visual-explainer
1•vghaisas•49m ago•0 comments