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

Podcasting has a Hall of Fame. Almost nobody knows it exists

https://recognized.substack.com/p/exclusive-behind-the-scenes-look
1•Chachingfm•21s ago•0 comments

Optophone

https://en.wikipedia.org/wiki/Optophone
1•Hooke•2m ago•0 comments

Lords of the Ring

https://harpers.org/archive/2026/03/lords-of-the-ring-joshua-hunt-cultural-politics-sumo-wrestling/
1•lermontov•3m ago•0 comments

Phil Spencer is exiting Microsoft as AI executive takes over Xbox

https://www.neowin.net/news/phil-spencer-is-exiting-microsoft-as-ai-executive-takes-over-xbox/
1•bundie•3m ago•0 comments

Show HN: AgentCheck – AI bot posture leaderboard from robots.txt and llms.txt

https://www.agentcheck.com
1•MK_Phoenix•5m ago•1 comments

Jsonh (JSON for Humans)

https://github.com/jsonh-org/Jsonh
3•Joy-less•7m ago•1 comments

Show HN: Dev visibility for non-technical founders and stakeholders

1•inferno22•7m ago•0 comments

Thoughts about Pi

https://colorforth.github.io/pi.htm
1•tosh•9m ago•0 comments

NASA chief classifies Starliner flight as "Type A" mishap, agency made mistakes

https://arstechnica.com/space/2026/02/nasa-chief-classifies-starliner-flight-as-type-a-mishap-say...
1•rbanffy•10m ago•0 comments

Palladium filters could enable cheaper, efficient generation of hydrogen fuel

https://news.mit.edu/2025/palladium-filters-could-enable-cheaper-more-efficient-generation-hydrog...
1•rbanffy•13m ago•0 comments

Nascent tech, real fear: how AI anxiety is upending career ambitions

https://www.theguardian.com/technology/ng-interactive/2026/feb/20/ai-future-work-technology-white...
1•paulpauper•13m ago•0 comments

MIT Challenge: Bachelor's Degree in 100 Days

https://gist.github.com/tirthd16/f9a5759352eea33cec6a278f9dbe2c35
1•tirthd•15m ago•1 comments

Taalas – The Model Is the Computer

https://taalas.com/
1•rvnx•15m ago•1 comments

ZSTDify: A robust pure-JavaScript implementation of ZSTD

https://github.com/bhouston/zstdify
1•bhouston•15m ago•0 comments

The Great Disconnect: Why the "12-Month" Clock Is Ticking Faster Than We Think

https://grayrhino.blog/
1•ghostinshell515•16m ago•1 comments

That 6am feeling – living at the end and beginning of everything

https://antonioaestero.substack.com/p/that-6am-feeling-living-at-the-end-and-beginning-of-everything
1•pmg101•16m ago•0 comments

Real-Time 3D Room Mapping with ESP32, VL53L5CX Sensor and IMU

https://hackaday.com/2026/02/14/real-time-3d-room-mapping-with-esp32-vl53l5cx-sensor-and-imu/
1•toomuchtodo•16m ago•0 comments

AI coding assistant Cline compromised to create more OpenClaw chaos

https://www.theregister.com/2026/02/20/openclaw_snuck_into_cline_package/
1•beardyw•17m ago•0 comments

A floating power station? China's flying wind turbine hits milestone

https://www.euronews.com/next/2026/01/29/a-floating-power-station-chinas-flying-wind-turbine-hits...
1•geox•17m ago•0 comments

James Bond x Seedance 2.0 [video]

https://old.reddit.com/r/singularity/comments/1r9xgdz/james_bond_x_seedance_20/
1•mgh2•20m ago•0 comments

I Analyzed Every Nootropic Study on PubMed

https://outspeaker.com/post/217
1•onesandofgrain•20m ago•0 comments

Bay Area Apartment Hunting Has Turned into an AI Hellscape

https://www.sfgate.com/local/article/bay-area-apartment-ai-21332194.php
2•randycupertino•20m ago•1 comments

The Sixth Bureau [video]

https://www.bloomberg.com/features/the-sixth-bureau/
1•petethomas•20m ago•0 comments

OpenScan

https://openscan.eu/pages/scan-gallery
2•joebig•21m ago•0 comments

Phil Spencer Retiring, Sarah Bond Out, Asha Sharma Named New Xbox Boss

https://www.ign.com/articles/phil-spencer-retiring-sarah-bond-out-matt-booty-promoted-as-microsof...
8•CIARobotFish•22m ago•2 comments

Private Equity Debt Left a Leading VPN Open to Chinese Hackers

https://financialpost.com/pmn/business-pmn/how-private-equity-debt-left-a-leading-vpn-open-to-chi...
1•strict9•25m ago•0 comments

Task-Completion Time Horizons of Frontier AI Models (Includes Opus 4.6)

https://metr.org/time-horizons/
1•admp•25m ago•0 comments

Video Is 6 Minutes Long [video]

https://www.youtube.com/watch?v=NL-IVJi8r3M
1•financetechbro•25m ago•0 comments

What do you do after paste in sensi info i.e: API token & key into IDE AI chat?

1•lctan•26m ago•0 comments

Testing a proof-of-data transfer model for social media

https://www.galacticfederation.tech
1•subvertio•26m ago•1 comments