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

Advice I WISH I'D BEEN Told (1999)

http://web.archive.org/web/20090502012411/http://wwwstage.valpo.edu/english/vpr/mcdonaldessay.html
1•downbad_•48s ago•0 comments

Family data reveal two genetic paths to childhood depression and anxiety

https://medicalxpress.com/news/2026-04-family-reveal-genetic-paths-childhood.html
1•pseudolus•3m ago•0 comments

More than double the gas stuck in Hormuz is wasted each year, IEA says

https://www.ft.com/content/fdc6aa8a-538a-4f1d-b1b9-a0ce0cd2a5ac
1•JumpCrisscross•5m ago•0 comments

Kant: Was Ist Aufklärung?

https://www.hs-augsburg.de/~harsch/germanica/Chronologie/18Jh/Kant/kan_aufk.html
2•doener•7m ago•1 comments

Show HN: Valk Guard– Catches dangerous SQL hidden inside your ORM,no DB required

https://github.com/ValkDB/valk-guard
1•valkdb•9m ago•0 comments

Why do so many people use AI to cheat at fun?

https://www.thecut.com/article/would-you-use-chatgpt-to-cheat-at-hobbies.html
1•the-mitr•9m ago•0 comments

Reviving the internet radio in my 12-year-old Denon

https://victorantos.com/posts/i-bought-a-denon-for-my-wedding-then-i-vibe-coded-its-radio-back/
1•victorbuilds•10m ago•0 comments

GitHub (But It's a EU Project)

https://pinolallo.com/html/eurohub-demo.html
4•HipstaJules•12m ago•0 comments

Shoppers falsely identified by facial recognition struggle to clear their names

https://www.theguardian.com/technology/2026/may/03/guilty-until-proven-innocent-shoppers-falsely-...
1•rwmj•13m ago•0 comments

AI-Generated Code Has No Author – Ossature Blog

https://ossature.dev/blog/ai-generated-code-has-no-author/
1•lifeisstillgood•14m ago•0 comments

United flight collides with truck and light pole as it lands at Newark airport

https://www.cnn.com/2026/05/03/us/united-airlines-newark-truck-streetlight
2•blendergeek•15m ago•0 comments

The Arena of Seperation

https://drive.google.com/drive/folders/1LhbVuK--98o6UsyiCzTjQ3yxQb3VjWce?usp=sharing
1•thepppanda•15m ago•1 comments

10K+ Satellites in Space

https://tech.marksblogg.com/gcat-satellite-database.html
1•marklit•16m ago•1 comments

Agent Skill Pack: Market and Marketing and Monetization (9 and 2 Skills)

https://8253360822677.gumroad.com/l/beamer-agent-skills-market-marketing-monetization
1•davidvartanian•16m ago•0 comments

Ouster's new color Lidar is coming to replace cameras

https://techcrunch.com/2026/05/04/ousters-new-color-lidar-is-coming-to-replace-cameras/
1•jacobwiseberg•18m ago•0 comments

The wild life and brutal death of a crypto hustler

https://thelogic.co/news/the-big-read/kevin-mirshahi-bitcoin-cryptocurrency-influencer-murder/
2•pseudolus•20m ago•0 comments

Speed of Implementation and the Law of Shitty Click Throughs

https://taylorpearson.me/ctr/
1•rzk•20m ago•0 comments

May the Fourth Be with You

2•emreb•21m ago•0 comments

Show HN: Pictero.com – mostly browser based image toolbox

https://www.pictero.com/
1•y42•22m ago•0 comments

Prototype Fund is a funding program for innovative Open Source Software

https://www.prototypefund.de/en/
1•snowpid•25m ago•0 comments

Show HN: Pokelingo – guess the Pokémon from its Pokédex entry in target language

https://pokelingo.io/en/riddle/
1•itsprobablyme•26m ago•1 comments

CartLens

https://www.cartens.co/
1•watat83•27m ago•1 comments

The German town where people print their own money

https://www.youtube.com/watch?v=WzijH3lgzHI
1•modinfo•27m ago•0 comments

Ruflo: Multi-agent AI orchestration for Claude Code

https://github.com/ruvnet/ruflo/blob/main/docs/USERGUIDE.md
2•pramodbiligiri•27m ago•0 comments

Farewell and Thank You, Spirit

https://jackfromgetcho.substack.com/p/farewell-and-thank-you-spirit
1•jackconsidine•28m ago•0 comments

Medical Information Provided to AI Is Often Incomplete

https://www.uni-wuerzburg.de/en/news-and-events/news/detail/news/reis-nature-health/
2•JeanKage•29m ago•0 comments

Trademark violation: Fake Notepad++ for Mac

https://notepad-plus-plus.org/news/npp-trademark-infringement/
73•maxloh•40m ago•11 comments

Daintreehq/daintree: A delegation environment for orchestrating AI coding agents

https://github.com/daintreehq/daintree
1•ankitg12•43m ago•0 comments

Setting Up Server Monitoring for a Rails App on Hatchbox

https://blog.appsignal.com/2026/04/30/setting-up-server-monitoring-for-a-rails-app-on-hatchbox.html
1•andreigaspar•49m ago•0 comments

GameStop makes $55.5B takeover offer for eBay

https://www.bbc.co.uk/news/articles/cn0p8yled1do
38•n1b0m•49m ago•9 comments