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: Fastsleep.app – want to fall asleep in 20 minutes?

https://fastsleep.app/
1•mathnorth_com•1m ago•0 comments

Why Choose OpenAgents Instead of CrewAI, LangGraph, AutoGen?

https://medium.com/@openagents/open-source-ai-agent-frameworks-compared-crewai-vs-langgraph-vs-au...
1•Cherie91•1m ago•0 comments

Claude is down 8:29 pm PST (3/2/26)

1•HPMOR•2m ago•0 comments

Iran executes Khamenei's plan to spread regional war

https://www.ft.com/content/02eb660a-3c80-4d6b-9e58-e7411278b0f1
1•ParentiSoundSys•2m ago•0 comments

Show HN: AsmForge: Open-Source AI-Powered Assembly IDE Based on Eclipse Theia

https://github.com/TamTunnel/asmforge
1•pp10•3m ago•0 comments

A "Game First" Implementation of GenAI (Unity and Agents)

https://blackwaterlabs.io
1•AlisonJJJ•4m ago•1 comments

Show HN: Time to Decimal Calculator

https://www.timetodecimalcalculator.com/
1•atharvtathe•11m ago•0 comments

Intent-Based Commits

https://github.com/adamveld12/ghost
1•adamveld12•11m ago•1 comments

Apply Within – Bringing applicative desugaring to Scala for-notation

https://blog.podsnap.com/apply.html
2•luu•15m ago•0 comments

U.S. Marines Fire on Protesters in Karachi

https://www.wsj.com/livecoverage/iran-israel-us-strikes-2026/card/u-s-marines-fire-on-protesters-...
3•JumpCrisscross•17m ago•0 comments

Using a GPT-5-driven autonomous lab to optimize cell-free protein synthesis

https://www.biorxiv.org/content/10.64898/2026.02.05.703998v1
2•peyton•18m ago•0 comments

Augustus: Open-Source LLM Prompt Injection Tool

https://www.praetorian.com/blog/introducing-augustus-open-source-llm-prompt-injection/
2•umairnadeem123•21m ago•1 comments

Eoghan McCabe: "There is one way that SaaS can be saved"

https://twitter.com/eoghan/status/2028522852044206258
2•doppp•22m ago•0 comments

Show HN: Starcraft2 replay rendering engine and AI coach

https://www.starcraft2.ai/en/replay/72228e2b-569e-440d-9fcc-93e4a1f5a4b9
3•tomkit•23m ago•0 comments

Groveling for Dollars (1998)

https://www.salon.com/1998/05/04/feature_325/
2•psawaya•24m ago•0 comments

Building My Own Canva over a Weekend

https://catalinionescu.dev/ai-agent/building-my-own-canva-over-the-weekend/
2•cionescu1•24m ago•0 comments

The Interface Theory of Perception [pdf]

https://sites.socsci.uci.edu/~ddhoff/interface.pdf
2•jerlendds•32m ago•0 comments

The Support Agent Who Never Burns Out

2•natematthew•36m ago•0 comments

Beijing Doesn't Think Like Washington–and the Iran Conflict Shows Why

https://carnegieendowment.org/emissary/2026/03/iran-china-us-intervention-strategy
3•jackyli02•36m ago•0 comments

Show HN: Personal AI gateway for OpenClaw – tokenomics

https://github.com/rickcrawford/tokenomics
2•crawdog•39m ago•0 comments

Dabao evaluation board for Baochip-1X

https://www.crowdsupply.com/baochip/dabao
2•MassPikeMike•41m ago•0 comments

U.S. Troops Were Told Iran War Is for "Armageddon,"

https://jonathanlarsen.substack.com/p/us-troops-were-told-iran-war-is-for
37•fzeroracer•45m ago•29 comments

A brief history of logic [pdf]

https://www.cs.rice.edu/~vardi/comp409/history.pdf
2•vinhnx•46m ago•0 comments

Working on multiple tasks in parallel using 1 OpenClaw Agent

https://openclaw-setup.me/blog/usage-tips/run-multiple-openclaw-sessions-concurrently/
2•Gregoryy•47m ago•1 comments

He wanted to use ChatGPT to create sustainable housing. It took over his life

https://www.theguardian.com/technology/ng-interactive/2026/feb/28/chatgpt-ai-chatbot-mental-health
8•georgecmu•48m ago•0 comments

Whats Up with Claude Lately?

3•mech422•48m ago•1 comments

Deploy OpenClaw Agents in 6 seconds

https://tryshift.sh
2•akasuv•53m ago•0 comments

Giving LLMs a personality is just good engineering

https://www.seangoedecke.com/giving-llms-a-personality/
2•emschwartz•55m ago•0 comments

Elevated Errors in Claude.ai

https://status.claude.com/incidents/yf48hzysrvl5
7•LostMyLogin•1h ago•4 comments

ChatGPT uninstalls surged by 295% after DoD deal

https://techcrunch.com/2026/03/02/chatgpt-uninstalls-surged-by-295-after-dod-deal/
6•Garbage•1h ago•1 comments