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?

Show HN: Free Browser-Based Dev Tools (No Signup, Client-Side)

https://maxseats.github.io/devtools/
1•maxxmini•2m ago•0 comments

A procedural prompting framework for building and deploying agentic systems

https://diyclaw.dev/
1•kordlessagain•3m ago•0 comments

I want to wash my car. The car wash is 50 meters away. Should I walk or drive?

https://mastodon.world/@knowmadd/116072773118828295
3•novemp•5m ago•0 comments

Varnish HTTP Cache: The last usable commit on GitHub

https://github.com/varnishcache/varnish-cache/releases/tag/last
4•vickodin•10m ago•0 comments

Altman can recruit lucifer himself if he had a 1on1 meeting with him

2•shoman3003•18m ago•0 comments

The desperate race to escape AI's 'permanent underclass'

https://www.telegraph.co.uk/business/2026/02/15/the-desperate-race-to-escape-ais-permanent-underc...
1•SilverElfin•26m ago•1 comments

Show HN: codex-web-local – web UI for local Codex App Server

https://www.npmjs.com/package/codex-web-local
1•kolpaque•26m ago•0 comments

Show HN: Wisepanel – Multi-model AI panel for decision support

https://wisepanel.ai
1•quroi•29m ago•0 comments

Show HN: SafeClaw – a way to manage multiple Claude Code instances in containers

https://github.com/ykdojo/safeclaw
1•ykdojo•31m ago•0 comments

Show HN: Million Dollar Deeds – Own permanent digital land

https://milliondollardeeds.com
1•coldsundaynight•31m ago•0 comments

Show HN: 165k lines, 9 days, one dev I built what ICE sells to hedge funds

https://web-production-71423.up.railway.app/
3•Shmungus•39m ago•0 comments

Ask HN: Are teams syncing databases continuously?

1•sonichigo•40m ago•0 comments

Bible Companion – Bible Study and Devotional Platform

https://www.biblecompanion.top
1•Claraxia•40m ago•1 comments

Show HN: Jemini – Gemini for the Epstein Files

https://jmail.world/jemini
2•dvrp•44m ago•0 comments

Mini-Retirement: Or, How I Learned to Stop Grinding and Took Two Years Off

https://neuralpensieve.github.io/2026/02/15/mini-retirement.html
2•donutshop•46m ago•0 comments

Made a tool that turns datasheet PDFs into interactive register

https://regforge.dev/
1•coleman2247•51m ago•1 comments

South Korean researchers are testing reprogramming cells to fight cancer

https://twitter.com/argosaki/status/2022689326845563123
1•leiaru13•52m ago•0 comments

Words Without Consequence

https://www.theatlantic.com/technology/2026/02/words-without-consequence/685974/
2•dougb5•53m ago•0 comments

Building SQLite with a small swarm

https://kiankyars.github.io/machine_learning/2026/02/12/sqlite.html
4•kyars•58m ago•0 comments

Show HN: I track GPU rental prices – same H100 ranges from $0.80 to $3.19/HR

https://gpuperhour.com
1•hwspeed•1h ago•1 comments

Just Give Us the Prompt – Kevin.md

https://www.kevin.md/just-give-us-the-prompt.md/
3•thekevintang•1h ago•0 comments

An AI interviewed another AI. The most revealing moment was one word

https://residualstream.app/blog/two-mirrors/
1•Abeeprodev•1h ago•1 comments

The Apolitical Library Is Just Fiction

https://www.nationalreview.com/2026/02/the-apolitical-library-is-just-fiction/
1•petethomas•1h ago•0 comments

Obama responds to Trump sharing racist AI video depicting him as an ape

https://www.npr.org/2026/02/15/nx-s1-5715117/obama-racist-ai-video-response-trump
3•kiriberty•1h ago•0 comments

Windows PC might stop booting in June 2026 – here's why and how to fix it

https://www.makeuseof.com/windows-pc-might-stop-booting-june-2026-why-and-how-to-fix-it/
1•kiriberty•1h ago•0 comments

What Is Secure Boot and How Does It Work?

https://www.makeuseof.com/what-is-secure-boot-how-does-it-work/
1•kiriberty•1h ago•1 comments

Defer Available in GCC and Clang

https://gustedt.wordpress.com/2026/02/15/defer-available-in-gcc-and-clang/
2•r4um•1h ago•0 comments

DNA Mutations Discovered in the Children of Chernobyl Workers

https://www.sciencealert.com/dna-mutations-discovered-in-the-children-of-chernobyl-workers
2•aard•1h ago•0 comments

Show HN: Mindweave – AI-powered personal knowledge hub with semantic search

https://www.mindweave.space/
1•adas10•1h ago•0 comments

Three Olympic Athletes Were Just Disqualified for a Novel Reason: PFAS

https://www.nytimes.com/2026/02/15/climate/olympics-ski-snowboard-wax-pfas-forever-chemicals.html
1•igonvalue•1h ago•2 comments