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?

Self-Hosting WordPress Course

https://wpshell.com
1•k7n•4m ago•0 comments

Greeting Vocalizations in Domestic Cats Are More Frequent with Male Caregivers

https://onlinelibrary.wiley.com/doi/10.1111/eth.70033
1•JumpCrisscross•5m ago•0 comments

From the Grid to the Prompt

https://edwardjliebig.substack.com/p/from-the-grid-to-the-prompt
1•gk1•5m ago•0 comments

Grok: 'It's basically the curlable Résumé.'

https://www.cssdesignawards.com/sites/kiarash-adl-portfolio/48521/
1•GPTVisionGod•10m ago•0 comments

Study: Effects of LLMs versus Web Search on Depth of Learning

https://papers.ssrn.com/sol3/papers.cfm?abstract_id=5104064
1•mustaphah•11m ago•0 comments

Managing Postgres Extensions with ImageVolume

https://www.gabrielebartolini.it/articles/2025/12/cnpg-recipe-23-managing-extensions-with-imagevo...
1•bo0tzz•12m ago•0 comments

DiskBBQ – Elasticsearch's vector storage format

https://www.elastic.co/search-labs/blog/diskbbq-elasticsearch-introduction
1•emschwartz•12m ago•0 comments

Docker Compose Models Explained

https://oneuptime.com/blog/post/2025-12-03-docker-compose-models-explained/view
2•ndhandala•16m ago•0 comments

Yoloe: Real-Time Seeing Anything

https://docs.ultralytics.com/models/yoloe/
1•ensocode•17m ago•0 comments

Putting email in its place with Emacs and Mu4e

https://eamonnsullivan.co.uk/posts-output/email-setup/2025-12-3-putting-email-in-its-place/
1•eamonnsullivan•18m ago•0 comments

Postgres CDC in ClickHouse, A year in review

https://clickhouse.com/blog/postgres-cdc-year-in-review-2025
1•saisrirampur•19m ago•0 comments

Constructing a JPEG XL MD5 hash quine

https://stackchk.fail/blog/jxl_hashquine_writeup
1•fanf2•19m ago•0 comments

NASA Rover Detects Electric Sparks in Mars Dust Devils, Storms

https://www.jpl.nasa.gov/news/nasa-rover-detects-electric-sparks-in-mars-dust-devils-storms/
1•mzs•19m ago•1 comments

3D-Printed Carotid Artery-on-Chips for Personalized Thrombosis Investigation

https://advanced.onlinelibrary.wiley.com/doi/10.1002/adma.202508890
1•PaulHoule•20m ago•0 comments

IoT and AI-driven solutions for human-wildlife conflict

https://www.sciencedirect.com/science/article/pii/S2772375525000620
1•ensocode•21m ago•0 comments

Support Techdirt's Uncompromising Coverage, Get Our First Commemorative Coin

https://www.techdirt.com/2025/12/03/support-techdirts-uncompromising-coverage-get-our-first-comme...
1•doener•21m ago•1 comments

Trump Returns to Gasoline as Fuel of Choice for Cars

https://www.nytimes.com/2025/12/03/climate/trump-fuel-economy-car-rules.html
3•thelastgallon•22m ago•1 comments

Using AI to generate alt text for 27000 images

https://www.ianlurie.com/digital-marketing/use-ai-to-generate-alt-text/
1•AznHisoka•23m ago•0 comments

City Of Winter: A roleplaying game about a fantastical family saga

https://sphaerenmeisters-spiele.de/City-of-Winter/en
1•doener•23m ago•0 comments

Ragas: Automated Evaluation of Retrieval Augmented Generation

https://arxiv.org/abs/2309.15217
1•Anon84•27m ago•0 comments

Show HN: Cross-platform network traffic monitoring system

https://github.com/mohyware/packet-meter
1•mohyware•27m ago•0 comments

Show HN: Rust Client Library for Gradium.ai TTS/STT API

https://github.com/cydanix/rust-gradium
2•irqlevel•28m ago•0 comments

RISC-V Oral History Panel [video]

https://www.youtube.com/watch?v=lbMIuX28d18
3•camel-cdr•29m ago•0 comments

Cloudflare Timeouts in Europe

https://www.cloudflarestatus.com/incidents/s35102g9syk0
4•decide1000•30m ago•4 comments

Trump admin funds geothermal network expansion

https://insideclimatenews.org/news/03122025/rare-win-for-renewable-energy-trump-administration-fu...
2•fghorow•31m ago•0 comments

Making Friends with Foreigners

https://shxlpa.substack.com/p/making-friends-with-foreigners
3•itarmonkey•36m ago•1 comments

Developing a New Electric Vehicle Sound

https://acoustics.org/developing-a-new-electric-vehicle-sound/
2•geox•37m ago•0 comments

The framework isn't for you. You're just along for the voyage

https://doingsoftwarewrong.com/blog/javascript-frameworks/
3•ChunkyAu•40m ago•0 comments

"Netflix killed casting from phones"

https://www.androidauthority.com/netflix-casting-chromecast-google-tv-streamer-3620784/
1•valgaze•41m ago•1 comments

I ran out of money, spent my savings on a Hong Kong prostitute,& became a commie

https://docs.google.com/document/d/1Am8bYA1aoXuSGFg7w7NjlHXFZiSAEt_oAVITPYdNRGo/edit?tab=t.0
4•jxmorris12•42m ago•2 comments