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

C# and TypeScript with Anders Hejlsberg [video]

https://www.youtube.com/watch?v=uMqx8NNT4xY
1•gnabgib•59s ago•0 comments

Pablo's galaxy ran out of fuel as black hole choked off supplies

https://phys.org/news/2026-01-death-thousand-pablo-galaxy-ran.html
1•PaulHoule•3m ago•0 comments

I built an AI tool to generate clothing designs

https://aiclothes.ai/
1•Pluviobyte•4m ago•0 comments

Show HN: Schema-first codegen for SQL, Rust, Go, Python and TS (single binary)

https://github.com/hlop3z/astroladb
1•hlop3z•7m ago•0 comments

MSX is a standardized home computer architecture

https://en.wikipedia.org/wiki/MSX
1•doener•8m ago•0 comments

Apple CEO Tim Cook Responds After ICE Shootings in Minneapolis

https://www.macrumors.com/2026/01/27/tim-cook-responds-after-minneapolis-shootings/
1•ciconia•13m ago•0 comments

I made a website that has unlimited memory for chat GPT and Claude coding

https://www.thetoolswebsite.com/
1•DylanWain•13m ago•0 comments

Show HN: Eure – TOML-like data notation with arbitrary nesting and tagged unions

https://github.com/Hihaheho/eure
1•ryo33_hirayama•15m ago•0 comments

New iPhone failures on Telstra network compound Triple Zero crisis

https://www.afr.com/companies/telecommunications/new-iphone-failures-on-telstra-network-compound-...
1•KnuthIsGod•15m ago•0 comments

Property-based testing for web UIs

https://github.com/antithesishq/bombadil
1•lwhsiao•21m ago•0 comments

Virginia Oliver, Maine 'Lobster Lady' who fished for nearly a century, has died

https://www.theguardian.com/us-news/2026/jan/28/maine-lobster-lady-dies-aged-105
2•NaOH•24m ago•0 comments

She almost let the stranger walk out of her life. Then, a Beefeater intervened

https://www.cnn.com/travel/beefeater-tower-of-london-chance-encounters
1•keepamovin•27m ago•0 comments

Beautiful Mermaid

https://github.com/lukilabs/beautiful-mermaid
9•mellosouls•27m ago•0 comments

Home Office Is Sabotaging You

https://oedmethod.substack.com/p/your-home-office-is-sabotaging-you
7•truenfel•28m ago•0 comments

Largest Battery-Electric Ship Begins Harbour Trials

https://incat.com.au/worlds-largest-battery-electric-ship-begins-harbour-trials-in-hobart/
2•geox•28m ago•0 comments

SSH has no Host header

https://blog.exe.dev/ssh-host-header
1•colinprince•28m ago•1 comments

A web server on a single floppy disk

http://floppy.ddns.net/
1•ActionRetro•35m ago•1 comments

LinkedIn will let you show off your vibe-coding chops with a certificate

https://techcrunch.com/2026/01/28/linkedin-will-let-you-show-off-your-vibe-coding-chops-with-a-ce...
1•cratermoon•35m ago•0 comments

Silicon Valley Wants to Build A.I. That Can Improve A.I. On Its Own

https://www.nytimes.com/2026/01/26/technology/recursive-ai-ricursive.html
1•lxm•36m ago•0 comments

Flippy Planes

https://flippyplanes.com/
2•yaaang•36m ago•0 comments

Show HN: Building a TradingView alternative pixel by pixel

https://www.aulico.com/tradespaces/new
1•lalalerodas•47m ago•0 comments

ClawdBot Henry coded himself a voice using the ChatGPT API. Without me asking

https://twitter.com/AlexFinn/status/2016253994033938550
1•doener•47m ago•0 comments

AI Ships Code While You Sleep. Who Maintains It When You Wake?

https://twitter.com/acolombiadev/status/2015855181020234008
3•andreag11•49m ago•0 comments

Writing a .NET Garbage Collector in C# – Part 6: Mark and Sweep

https://minidump.net/writing-a-net-gc-in-c-part-6/
2•vyrotek•50m ago•0 comments

Capgemini in turmoil over its work with ICE

https://www.lemonde.fr/en/economy/article/2026/01/28/capgemini-in-turmoil-over-its-work-with-ice_...
2•belter•51m ago•0 comments

Ask HN: Aggregated Weekly World News?

1•nojs•52m ago•1 comments

Riemann Surfaces

https://en.wikipedia.org/wiki/Riemann_surface
2•ogogmad•52m ago•0 comments

Group Chats Rule the World (2024)

https://www.nytimes.com/2024/01/16/magazine/group-chats.html
1•ViktorRay•54m ago•0 comments

Finding My Spark Again (2025)

https://steipete.me/posts/2025/finding-my-spark-again
1•doener•55m ago•0 comments

Moltbot: Own Personal AI Assistant

https://github.com/moltbot/moltbot
1•doener•57m ago•1 comments