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?

Travelers wear pajamas to airports in protest of government request

https://www.washingtonpost.com/travel/2025/12/04/airport-pajamas-duffy-video/
2•bookofjoe•58s ago•1 comments

Show HN: AQUA – model agnostic lightweight command line agent coordinator

https://vignesh07.github.io/aqua/2025/12/02/introducing-aqua.html
1•eigen-vector•3m ago•0 comments

Russia blocks Apple's FaceTime in mounting push against foreign tech platforms

https://www.reuters.com/business/retail-consumer/russia-imposes-restrictions-apples-facetime-app-...
3•coloneltcb•3m ago•0 comments

Spotlight on the Artist/Producer

https://billboard-bangladesh.odoo.com/
1•billboardbd•4m ago•0 comments

A small group of women changed the UK law on deepfake porn

https://www.theguardian.com/society/ng-interactive/2025/dec/04/i-dont-take-no-for-an-answer-how-a...
2•robaato•4m ago•0 comments

A Look at the PowerVR Graphics Architecture: Tile-Based Deferred Rendering

https://blog.imaginationtech.com/a-look-at-the-powervr-graphics-architecture-tile-based-rendering/
1•jakogut•5m ago•0 comments

Meta poaches Apple design exec Alan Dye to lead new Reality Labs studio

https://techcrunch.com/2025/12/03/meta-poaches-apple-design-exec-alan-dye-to-lead-new-creative-st...
1•biglyburrito•6m ago•0 comments

PyTogether: Collaborative lightweight real-time Python IDE for teachers/learners

https://github.com/SJRiz/pytogether
2•indigodaddy•7m ago•0 comments

Ask HN: Best way to start coding with tools available today?

1•lepetitpenguin•7m ago•1 comments

I Built a Custom GPT to Improve Developer Resumes

https://relocateme.substack.com/p/i-built-a-custom-gpt-to-improve-your
1•andrewstetsenko•8m ago•0 comments

Associated Press 100 Photos of 2025

https://apnews.com/article/associated-press-100-photos-of-2025-ap-photos-that-defined-the-year
1•throw0101d•8m ago•1 comments

Show HN: We instrumented Claude Agent SDK using a tiny Rust proxy

https://laminar.sh/blog/2025-12-03-claude-agent-sdk-instrumentation
4•skull8888888•9m ago•0 comments

Google taps Replit in challenge to Anthropic and Cursor

https://www.cnbc.com/2025/12/04/google-replit-ai-vibe-coding-anthropic-cursor.html
1•indigodaddy•10m ago•0 comments

Someone said on Lemmy that he wanna kill "bad people" to protest agegating laws

https://old.lemmy.world/post/39432488
1•containersxllc•10m ago•0 comments

Unison: A new approach to Distributed programming

https://www.unison-lang.org/
1•mooreds•11m ago•0 comments

Show HN: Gihtub Wrapped 2025

https://www.unwrapped.live/
2•amawi•12m ago•1 comments

We Built ExoQuery

https://exoquery.com/blog/why-we-built-exoquery/
1•SureshG•12m ago•0 comments

Don't Track Tasks. Track Interruptions

https://adrianhoward.com/posts/track-interruptions/
1•adrianhoward•12m ago•0 comments

Ising-Conway Entropy Game (ICEg)

https://arxiv.org/abs/2503.03769
2•northlondoner•13m ago•0 comments

Who let the dogs out? Beeple unleashes uncanny robot canines at Art Basel Miami

https://www.theartnewspaper.com/2025/12/04/beeple-robot-dogs-elon-musk-art-basel-miami-beach
1•onemoresoop•14m ago•0 comments

An AI toy meant for kids was happy to chat about sexual fetishes

https://www.cbc.ca/radio/thecurrent/ai-toys-for-kids-safety-9.7001764
2•j45•15m ago•1 comments

Redrawing the Poverty Line: Why America's Most Quoted Number Is Wrong

https://indieinvestor.substack.com/p/redrawing-the-poverty-line-why-americas
1•IndieInvestor•15m ago•0 comments

Do you have an AI companion?

1•sarbak•16m ago•0 comments

Is Pixelfed sawing off the branch that the Fediverse is sitting on?

https://ploum.net/2025-12-04-pixelfed-against-fediverse.html
2•todsacerdoti•17m ago•0 comments

AI Takes over Boring Code: Is Software Engineering Losing Its Soul?

https://www.interviewquery.com/p/anthropic-ai-skill-erosion-report
2•birdculture•17m ago•2 comments

Effects of microgravity on edible and model insects for spaceflight food system

https://www.frontiersin.org/journals/physiology/articles/10.3389/fphys.2025.1622401/full
1•PaulHoule•18m ago•0 comments

Nvidia lobbies White House and wins loosened AI GPU export control to China

https://www.tomshardware.com/tech-industry/artificial-intelligence/nvidia-lobbies-white-house-and...
1•01-_-•19m ago•0 comments

Terminally ill baby ants emit chemical signal prompting adult ants to kill them

https://gizmodo.com/diseased-baby-ants-ask-their-nestmates-to-poison-them-with-acid-to-protect-th...
1•gmays•19m ago•0 comments

Show HN: Open security analytics for your product

https://github.com/tirrenotechnologies/tirreno
1•reconnecting•19m ago•1 comments

Has Meta "Poached" Apple's Top Interface Design Executive?

https://comuniq.xyz/post?t=585
1•01-_-•20m ago•0 comments