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?

WHO slams US-funded newborn vaccine trial as "unethical"

https://arstechnica.com/health/2026/02/who-slams-us-funded-newborn-vaccine-trial-as-unethical/
1•rbanffy•2m ago•0 comments

Peter Steinberger, creator of OpenClaw, joins OpenAI

https://www.reuters.com/business/openclaw-founder-steinberger-joins-openai-open-source-bot-become...
1•escargot•2m ago•0 comments

OpenClaw creator Peter Steinberger joins OpenAI

https://techcrunch.com/2026/02/15/openclaw-creator-peter-steinberger-joins-openai/
2•geox•3m ago•0 comments

Ancient Mars was warm and wet, not cold and icy

https://theconversation.com/early-mars-was-warm-and-wet-not-icy-suggests-latest-research-275347
1•rbanffy•3m ago•0 comments

Ask HN: Is OpenClaw a groundbreaking feat, a highly useful product or both?

1•chirau•5m ago•2 comments

The Crew That Makes Dancing Lions for the Lunar New Year

https://www.nytimes.com/2026/02/15/arts/design/lion-dancing-chinese-lunar-new-years-san-francisco...
1•whack•5m ago•0 comments

Terry Tao's General Exam: "My harmonic analysis was far from satisfactory"

https://web.math.princeton.edu/generals/students/tao_terence
3•mjs•7m ago•0 comments

I don't think AGI is imminent

https://dlants.me/agi-not-imminent.html
2•anonymid•9m ago•0 comments

OpenAI Hires OpenClaw AI Agent Developer Peter Steinberg

https://www.bloomberg.com/news/articles/2026-02-15/openai-hires-openclaw-ai-agent-developer-peter...
1•rmason•13m ago•2 comments

NASA Video Simulation of entering a black hole [video]

https://www.youtube.com/watch?v=chhcwk4-esM
1•altrus•17m ago•0 comments

An Exercise in Agentic Coding: AV1 Encoder from Scratch in Rust

https://caricio.com/blog/an-exercise-in-agentic-coding-av1-encoder-from-scratch-in-rust/
2•rjcaricio•22m ago•0 comments

Individualized Networks

https://stratechery.com/2026/spotify-earnings-individualized-networks-ai-and-aggregation/
1•widenrun•23m ago•0 comments

Visualizing the ARM64 Instruction Set (2024)

https://zyedidia.github.io/blog/posts/6-arm64/
2•userbinator•24m ago•0 comments

Dasher runs parallel Claude Code agents from Slack threads. Ship from your phone

https://www.dashercode.com/
1•lekomurphy•25m ago•1 comments

The Dangerous Economics of Walk-Away Wealth in the AI Talent War

https://softcurrency.substack.com/p/the-dangerous-economics-of-walk-away
1•econgradstud•29m ago•0 comments

Show HN: GatewayStack – Deny-by-default security for OpenClaw tool calls

https://github.com/davidcrowe/openclaw-gatewaystack-governance
1•davidcrowe•29m ago•0 comments

Show HN: 1vsALL Season 3 – Memory game where you remember patterns, not colors

https://1vsall.voidmind.io/
1•chrisremo85•31m ago•0 comments

Show HN: SyncFlow – Privacy-Focused SMS/MMS Sync Between Android, Mac, and Web

https://sfweb.app
1•solovibecoder•32m ago•0 comments

Error payloads in Zig

https://srcreigh.ca/posts/error-payloads-in-zig/
4•srcreigh•35m ago•0 comments

Make agents perform like your best engineers on large codebases

https://intent-systems.com/blog/intent-layer
1•itzlambda•41m ago•0 comments

Against Waldenponding

https://contraptions.venkateshrao.com/p/against-waldenponding
1•gygodard•42m ago•0 comments

Show HN: I built "Docker for code", isolate AI logic into semantic containers

1•alonsovm•45m ago•0 comments

Show HN: ManasPDF – GPU-accelerated PDF renderer built from scratch in C++

https://github.com/Informal061/ManasPDF
1•informal061•46m ago•0 comments

Show HN: Are you really Gen Z?

https://whats-my-gen.vercel.app/
2•IsruAlpha•46m ago•0 comments

The price of surveillance: Government pays to snoop (2013)

https://www.politico.com/story/2013/07/the-price-of-surveillance-government-pays-to-snoop-093946
1•marysminefnuf•50m ago•0 comments

Vox – Local Voice AI Framework in Rust (STT and TTS and VAD)

https://github.com/mrtozner/vox
1•mertoz3•51m ago•0 comments

AI and the Economics of the Human Touch

https://agglomerations.substack.com/p/economics-of-the-human
2•NomNew•55m ago•0 comments

Following Discord's suit, OpenAI will scan your usage and ask to confirm your ID

https://www.pcgamer.com/software/ai/following-discords-suit-openai-will-also-predict-your-age-bas...
2•rvnx•55m ago•0 comments

Continuous batching from first principles (2025)

https://huggingface.co/blog/continuous_batching
7•jxmorris12•56m ago•1 comments

AI to SWE ratio convergence and where AI Jobs are

https://revealera.substack.com/p/software-engineering-jobs-are-up
1•altdata•56m ago•1 comments