frontpage.
newsnewestaskshowjobs

Open Source @Github

fp.

Open in hackernews

Ask HN: How can I load test PostgreSQL but avoid changing actual data?

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

Show HN: Git-temp (local scratchpad for AI agents that won't clutter Git status)

https://github.com/sebmellen/git-temp
1•sebmellen•1m ago•0 comments

Linux on Older Hardware: The Complete Revival Guide

https://www.fosslinux.com/158206/linux-on-older-hardware-revival-guide.htm
1•tapanjk•2m ago•0 comments

Noubin – Local-First Physical Media Hyperlink Standard

https://github.com/TobyKLight/Noubin
1•bj-rn•4m ago•0 comments

Meta Pauses Employee Spyware After Exposing Workers' Private Data

https://dissenter.com/tech/meta-pauses-employee-spyware-after-leaking-workers-private-data-to-ent
2•NewCzech•6m ago•0 comments

Chinese models are sometimes better, even if they're distilled

https://dualuse.dev/posts/chinese-models-are-sometimes-better-even-if-distilled
1•handfuloflight•9m ago•1 comments

Show HN: Find where multi-agent AI systems break before production

https://github.com/surajkumar811/swarm-test
1•surajkumar001•11m ago•0 comments

The False Promise of Imitating Proprietary LLMs

https://arxiv.org/abs/2305.15717
1•handfuloflight•12m ago•0 comments

GTA 6 Physical Copies Won't Include a Disc, Will Just Be a Code in a Box

https://www.ign.com/articles/grand-theft-auto-6-physical-copies-wont-include-a-disc-will-just-be-...
7•jmsflknr•14m ago•0 comments

Americans Got Tricked into Using a Bank That Isn't a Bank [video]

https://www.youtube.com/watch?v=hiE7NvONU5U
2•onemoresoop•21m ago•0 comments

How to Write an Effective Software Design Document

https://refactoringenglish.com/excerpts/write-an-effective-design-doc/
1•theanonymousone•22m ago•0 comments

SoftBank Shareholders Update [pdf]

https://group.softbank/media/Project/sbg/sbg/pdf/ir/investors/shareholders/2026/shareholders-meet...
1•gregsadetsky•22m ago•1 comments

Bill Gates names women he had affairs with in Epstein testimony about blackmail

https://www.independent.co.uk/news/world/americas/bill-gates-jeffrey-epstein-house-oversight-comm...
3•handfuloflight•25m ago•0 comments

Connect Dropbox to Claude

https://help.dropbox.com/integrations/connect-dropbox-to-claude
2•dr_pardee•27m ago•0 comments

Bernie Sanders Wants a U.S. Sovereign Wealth Fund for AI

https://www.forbes.com/sites/jamesbroughel/2026/06/22/bernie-sanders-wants-a-us-sovereign-wealth-...
1•hentrep•27m ago•2 comments

The Artificial Analysis Speech to Speech Index

https://artificialanalysis.ai/articles/announcing-the-artificial-analysis-speech-to-speech-index
1•theanonymousone•28m ago•0 comments

The Secret Truth Behind the Abundance Movement – Dylan Gyauch-Lewis – TMR [video]

https://www.youtube.com/watch?v=jNOMjH-3gfU
1•xbmcuser•28m ago•0 comments

Rust for Malware Development

https://git.smukx.site/smukx/Rust-for-Malware-Development
1•rzk•32m ago•0 comments

IatroBench: Pre-Registered Evidence of Iatrogenic Harm from AI Safety Measures

https://arxiv.org/abs/2604.07709
2•NavinF•32m ago•0 comments

Show HN: TakoQA – A harness to get a swarm of agents to break your application

https://github.com/Tako-Research/TakoQA
1•sakuraiben•32m ago•0 comments

Why David Levinson Could Hack Aliens Using a PowerBook 5300 in Independence Day (1996)

https://decodingvibes.com/blog/why-david-levinson-could-hack-aliens-independence-day/
2•altmanaltman•35m ago•1 comments

Loop engineering, latest AI buzzword, still needs humans in the loop

https://www.theregister.com/ai-and-ml/2026/06/24/loop-engineering-latest-ai-buzzword-still-needs-...
2•Bender•36m ago•0 comments

Companies are not looking before they're leaping into the AI playpen

https://www.theregister.com/devops/2026/06/24/companies-are-not-looking-before-theyre-leaping-int...
2•Bender•36m ago•0 comments

Hotly anticipated Grand Theft Auto VI will cost more than other AAA games

https://arstechnica.com/gaming/2026/06/grand-theft-auto-vi-will-cost-80-without-a-physical-disc/
1•Bender•37m ago•1 comments

Show HN: Find the Shortest Path in 24 steps

https://pathology.thinky.gg/level/hi19hi19/against
1•k2xl•40m ago•0 comments

Security tools inside coding agents get ignored unless we do things

https://www.boringappsec.com/p/edition-34-a-consensus-is-finally
1•joj123•45m ago•0 comments

You all think it's normal to sit behind a laptop all day

1•shoman3003•45m ago•6 comments

Yunwu

https://yunwu.ai/
2•handfuloflight•57m ago•0 comments

Wan Streamer v0.1: End-to-End Real-Time Interactive Foundation Models

https://wan-streamer.com/
1•ilreb•1h ago•0 comments

Powerful back-to-back earthquakes strike Venezuela, collapsing buildings

https://www.bbc.com/news/live/c621z18wznet
2•tartoran•1h ago•1 comments

Projectlens v1.0.6 released, supports npkill

https://www.npmjs.com/package/projectlens
1•dagmawibabi•1h ago•1 comments