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?

Querying 3B Vectors

https://vickiboykis.com/2026/02/21/querying-3-billion-vectors/
1•speckx•1m ago•0 comments

Frequently asked questions about signal handling in C (2024)

https://shitpost.plover.com/s/signal-handling.html
1•jjgreen•1m ago•0 comments

Bioinspired Kirigami Capsule Robot for Minimally Invasive GI Biopsy

https://arxiv.org/abs/2602.06207
1•PaulHoule•1m ago•0 comments

I got Claude to teach me dbt

https://rmoff.net/2026/02/20/claude-the-instructor/
1•rmoff•2m ago•0 comments

Best Obsidian Plugins in 2026: Must-Haves, Nice-to-Haves, and Power Tools

https://desktopcommander.app/blog/best-obsidian-plugins/
1•rkrizanovskis•2m ago•0 comments

Look Ma, No FUSE

https://writethat.blog/lookma.html
1•psarna•2m ago•0 comments

Live data from the International Space Station to control a 3D-printed model

https://github.com/ISS-Mimic/Mimic
1•dewey•2m ago•0 comments

Show HN: sc-research – Social media analysis skill for AI agents (Reddit and X)

https://github.com/skainguyen1412/social-media-research-skill
1•skainguyen1412•2m ago•0 comments

Small tropical islands also exposed to extreme humid heat by end of the century

https://essopenarchive.org/doi/full/10.22541/essoar.177172416.60160039/v1
1•bikenaga•3m ago•0 comments

Compost Modernity

https://aeon.co/essays/in-solarpunk-cities-of-the-future-tech-follows-natures-lead
1•rainingmonkey•4m ago•0 comments

Coal plant owners say DOE 'emergency' order to run it violates Constitution

https://www.utilitydive.com/news/doe-emergency-order-craig-colorado-coal-tri-state/811088/
2•geox•5m ago•0 comments

Steer Agents with Socrates and Meeseeks

https://backnotprop.com/blog/steer-agents-with-socrates-and-meeseeks/
2•ramoz•6m ago•0 comments

FreeBSD's Rust Kernel Support Could Be Stable Enough to Try This Year

https://www.phoronix.com/news/FreeBSD-Q4-2025-Status-Report
1•mikece•7m ago•0 comments

The Missing Semester of Your CS Education

https://missing.csail.mit.edu/
1•anishathalye•7m ago•1 comments

A simple web we own

https://rsdoiel.github.io/blog/2026/02/21/a_simple_web_we_own.html
3•speckx•8m ago•0 comments

Show HN: Mato – a Multi-Agent Terminal Office workspace (tmux-like)

https://github.com/mr-kelly/mato
2•chepy•9m ago•0 comments

WebAccessBench: Digital Accessibility Reliability in LLM-Generated Websites [pdf]

https://conesible.de/wab/whitepaper_webaccessbench.pdf
2•kreerc•9m ago•1 comments

Ask HN: Is it better to have no Agent.md than a bad one?

2•parvardegr•11m ago•0 comments

Context Management Is the Real Bottleneck for AI Agents

https://twitter.com/auxten/status/2025957620994199690
1•auxten•12m ago•0 comments

Show HN: Agent Multiplexer – manage Claude Code via tmux

https://github.com/mixpeek/amux
2•Beefin•13m ago•0 comments

World Monitor – Real-time global intelligence dashboard

https://github.com/koala73/worldmonitor
1•Brajeshwar•14m ago•1 comments

If AI makes human labor obsolete, who decides who gets to eat?

https://www.theguardian.com/business/2026/feb/23/ai-how-will-we-be-fed
3•n1b0m•15m ago•0 comments

ROCm 7.1.1: you can (not) build

https://lunnova.dev/articles/rocm-711-you-can-not-build/
2•nalllar•15m ago•0 comments

Portable Secret: End-to-End Encrypted Files in One HTML

https://blog.alcazarsec.com/tech/posts/portable-secret
2•alcazar•16m ago•1 comments

First, They Came for the Journalists

https://www.codastory.com/disinformation/first-they-came-for-the-journalists/
3•cdrnsf•16m ago•0 comments

Cyber Blast – Classic Amiga Action Reignited

https://spaceygames.itch.io/cyber-blast-x
2•doener•16m ago•0 comments

Pursuit of Performance on Building a JavaScript Compiler

https://oxc.rs/docs/learn/performance
2•sensanaty•16m ago•0 comments

Show HN: SpecterQA – AI personas test your web app, no scripts needed

1•synctek•16m ago•0 comments

Syzkaller AI agentic framework and MCP server

https://groups.google.com/g/syzkaller/c/EOcnMJmX9NI
1•raggi•17m ago•0 comments

Using perceptual distance to create better headers

https://alexwlchan.net/2026/perceptual-colour-headers/
2•surprisetalk•17m ago•0 comments