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•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?

Training a Simple World Model with Jax

https://www.alexinch.com/blog/simple-world-model
1•ainch•25s ago•0 comments

Security and Protection of Data in the IBM System/38

https://dl.acm.org/doi/pdf/10.1145/800053.801932
1•rbanffy•3m ago•0 comments

AI fiction is the new fast food

https://www.washingtonpost.com/opinions/2026/05/31/ai-fiction-is-fast-food-human-mind/
1•KnuthIsGod•4m ago•0 comments

Scientists discover lost range of 'supermountains' 3x longer than the Himalayas

https://www.space.com/supermountains-drove-evolution-on-earth
2•thunderbong•5m ago•0 comments

two strangers. one call. no names

https://just2voices.com/
1•whatis1215•9m ago•0 comments

Why Are Large Language Models So Terrible at Video Games?

https://spectrum.ieee.org/ai-video-games-llms-togelius
2•sxx0•10m ago•0 comments

Meta Fixes Instagram AI Flaw Used in Account Takeovers

https://sqmagazine.co.uk/meta-fixes-instagram-ai-flaw-account-takeovers/
1•mmsc•11m ago•0 comments

Intention – The Next Layer of Abstraction

https://intelligence.bearblog.dev
1•GlowingFern•12m ago•0 comments

Rainbow Query Language

https://rbql.org/
1•shakna•18m ago•0 comments

Exec into Node via Kubectl

https://github.com/kvaps/kubectl-node-shell
1•ankitg12•19m ago•0 comments

An AI native hedge fund

https://github.com/achaljhawar/1rok
2•satoshiclad•20m ago•0 comments

The Seven-Action Documentation Model

https://passo.uno/seven-action-model/
1•eigenBasis•21m ago•0 comments

Package Manager for Kubectl Plugins

https://krew.sigs.k8s.io/plugins/
1•ankitg12•21m ago•0 comments

Tongan Castaways

https://en.wikipedia.org/wiki/Tongan_castaways
1•mpweiher•21m ago•0 comments

Tech overlords plan for conscious AI to conquer the cosmos. What could go wrong?

https://www.theguardian.com/us-news/ng-interactive/2026/may/31/transhuman-silicon-valley-ai
2•contingencies•21m ago•0 comments

Data Breach Disclosure Lag Is Getting Worse

https://www.troyhunt.com/1000-data-breaches-later-the-disclosure-lag-is-worse-than-ever/
2•moebrowne•22m ago•0 comments

How LLMs Work

https://arpitbhayani.me/blogs/how-llms-work/
1•samrat11•23m ago•0 comments

Concrete Ways I Use AI During a Normal Engineering Workday (Week 4 Roundup)

https://theaileverageweekly.com/posts/8-concrete-ways-i-use-ai-during-a-normal-engineering-workda...
1•talvardi7•23m ago•0 comments

TaskSlinger: A faster, cleaner task manager for Windows with modern interface

https://taskslinger.net/
2•smusamashah•26m ago•2 comments

SWE-Rebench by Nebius

https://swe-rebench.com
1•chaoz_•26m ago•0 comments

Cannot Upvote

2•jjgreen•28m ago•4 comments

Show HN: Ronda lets non-technical users safely edit your webapp

https://useronda.com
2•antoinec•30m ago•0 comments

Divinity: Original Sin – Enhanced Edition 90% off

https://store.steampowered.com/app/373420/Divinity_Original_Sin__Enhanced_Edition/
1•doener•31m ago•0 comments

Unreleased Pixel Watch 5 Found by Diver in St Martins

https://xcancel.com/DuvalMagic/status/2061147076096872836#m
1•noelwelsh•32m ago•0 comments

Cessation of public development of Kefir C compiler

https://kefir.protopopov.lv/posts/announce2.html
2•f311a•32m ago•0 comments

How Not to Buy SpaceX Stock (It's Harder Than You Think)

https://cranberries.medium.com/how-not-to-buy-spacex-stock-its-harder-than-you-think-a37610cb8bd3
3•clktmr•34m ago•0 comments

Growing the Linux App Ecosystem with RISC-V and RVA23 Platforms

https://www.youtube.com/watch?v=ZPY3WZouYrA
1•fork-bomber•35m ago•0 comments

Nvidia Enters Windows Laptop Market, Taking on Intel and AMD

https://www.bloomberg.com/news/articles/2026-06-01/nvidia-enters-windows-laptop-market-taking-on-...
2•lvnfg•39m ago•0 comments

I Dropped PRDs for Shape Up

https://lswith.io/posts/why-i-dropped-prds-for-shapeup/
2•lswith•44m ago•0 comments

Go Experiments Explained

https://www.alexedwards.net/blog/go-experiments-explained
1•ingve•45m ago•0 comments