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•6mo 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•6mo 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•6mo 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•6mo 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•6mo ago
Load test against a clone instead of a DB whose contents you care about?

OpenAI's lead under pressure as rivals start to close the gap

https://www.ft.com/content/8881062d-ff4f-4454-8e9d-d992e8e2c4e3
1•thm•4m ago•0 comments

Qwen3-VL can scan two-hour videos and pinpoint nearly every detail

https://the-decoder.com/qwen3-vl-can-scan-two-hour-videos-and-pinpoint-nearly-every-detail/
1•thm•5m ago•0 comments

Aurora: The Linux-based ultimate workstation

https://getaurora.dev/en
1•doener•8m ago•0 comments

SOLID? Nope, Just Coupling and Cohesion

https://codeopinion.com/solid-nope-just-coupling-and-cohesion/
1•thunderbong•11m ago•0 comments

How to create your own ublue-OS variant [step by step]

https://youtu.be/IxBl11Zmq5w
1•doener•12m ago•1 comments

Decoding the Chaos of Breakup

https://physics.aps.org/articles/v18/184
1•ggirelli•12m ago•1 comments

DEP-18: A proposal for Git-based collaboration in Debian

https://optimizedbyotto.com/post/debian-collaboration-on-git/
1•JNRowe•12m ago•0 comments

Homebrew on Linux

https://docs.brew.sh/Homebrew-on-Linux
1•doener•13m ago•0 comments

Show HN: ReadyKit – Superfast SaaS Starter with Multi-Tenant Workspaces

https://readykit.dev/
1•level09•14m ago•0 comments

A rebuttal to Michael Burry: Why Nvidia isn't the Cisco of the dot-com era

https://x.com/jukan05/article/1994960719239139573
1•salkahfi•14m ago•0 comments

Zero click interface interaction design in the age of AI

https://medium.com/@pacificleo/zero-click-interface-interaction-design-in-the-age-of-artificial-i...
1•pacificleo12•19m ago•0 comments

Free Copies -Next.js: The Definitive Guide for Mastering Next.js

1•eyad_akeleh•25m ago•0 comments

Axon Mesh // the Serverless F2F/P2P Chat and Filesharing Application

https://axonmesh.net
3•SarahRoseLives•27m ago•1 comments

The Copenhagen Trap: How the West made passivity the only safe strategy

https://aliveness.kunnas.com/articles/copenhagen-trap
20•ekns•35m ago•9 comments

I Designed and Printed a Custom Nose Guard to Help My Dog with DLE

https://snoutcover.com/billie-story
1•ragswag•36m ago•1 comments

Algebraic Dynamical Systems in Machine Learning (2024)

https://link.springer.com/article/10.1007/s10485-023-09762-9
1•measurablefunc•42m ago•0 comments

OpenAdServer – A self-hosted ad server in Python, aiming to replace Revive"

https://github.com/seanZhang414/openadserver
1•root414•42m ago•1 comments

The Slow Grind That Sets You Free

https://medium.com/@naveensky/the-slow-grind-that-sets-you-free-97abd8b9bf2c
1•naveensky•51m ago•0 comments

What kind of grownup I want to be

https://sashachapin.substack.com/p/what-kind-of-grownup-i-want-to-be
1•eatitraw•1h ago•0 comments

Rock Paper Scissors Is Not Solved, in Practice

https://inchpin.substack.com/p/rock-paper-scissors-is-not-solved
1•eatitraw•1h ago•0 comments

Better GitHub Notifications Dashboard

https://github-notifications.dev/
4•shrimalmadhur•1h ago•2 comments

Crypto hoarding company shares under pressure as risk appetite wanes

https://www.reuters.com/business/finance/crypto-hoarding-company-shares-under-pressure-risk-appet...
2•1vuio0pswjnm7•1h ago•0 comments

Italy's Competition Watchdog Broadens WhatsApp AI Policy Probe

https://www.wsj.com/tech/ai/italys-competition-watchdog-broadens-whatsapp-ai-policy-probe-64c904cd
2•1vuio0pswjnm7•1h ago•0 comments

X402 – protocol for micropayments and the rise of an agentic economy

https://oasis.net/blog/x402-https-internet-native-payments
1•adrianwaj•1h ago•1 comments

Show HN: Tacopy – Tail Call Optimization for Python

https://github.com/raaidrt/tacopy
1•raaid-rt•1h ago•0 comments

CrowdStrike: Security Flaws DeepSeek-Generated Code Linked to Political Triggers

https://www.crowdstrike.com/en-us/blog/crowdstrike-researchers-identify-hidden-vulnerabilities-ai...
3•fosco•1h ago•1 comments

Harvard Database Hacked in Latest Ivy League Cyberattacks

https://www.bloomberg.com/news/articles/2025-11-22/harvard-hacked-in-most-recent-case-of-ivy-leag...
2•1vuio0pswjnm7•1h ago•0 comments

Best Free Headshot Generator 2026: 9 AI Tools Tested and Compared

https://www.aiheadshotreviews.com/articles/best-free-headshot-generator
1•naveensky•1h ago•1 comments

Why Jailbreaking Calculators Is (Unfortunately) a Thing Now [video]

https://www.youtube.com/watch?v=3a-X6FZfl2Y
2•josephcsible•1h ago•0 comments

Discord for LLMs in a single 3.7k-line HTML file

https://modelarena.xyz
2•Estrick•1h ago•1 comments