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?

Musk wants up to $134B in OpenAI lawsuit, despite $700B fortune

https://techcrunch.com/2026/01/17/musk-wants-up-to-134b-in-openai-lawsuit-despite-700b-fortune/
1•SilverElfin•1m ago•0 comments

Camden County Police in New Jersey expands drone program

https://www.cbsnews.com/philadelphia/news/camden-nj-homicides-drone-program/
1•pilingual•2m ago•0 comments

Ask HN: Duterte EJK, 2025-09, US extrajudicial killing in the Caribbean?

1•stopbulying•2m ago•0 comments

Authenticating Digital Evidence in US Courts [pdf]

https://law.baylor.edu/sites/g/files/ecbvkj1546/files/2023-11/7_grimm_capra_joseph.pdf
1•colonCapitalDee•2m ago•0 comments

EU Set to Halt US Trade Deal over Trump's New Tariff Threat

https://www.bloomberg.com/news/articles/2026-01-17/eu-set-to-halt-us-trade-deal-over-trump-s-late...
3•ekjhgkejhgk•4m ago•0 comments

Ask HN: Why is the $0 hijacking of intellectual labor so normalized in OSS?

1•fumi2026•7m ago•2 comments

My Rube Goldberg RSS Pipeline

https://taoofmac.com/space/blog/2026/01/17/2130
1•rcarmo•7m ago•0 comments

Global trust crisis deepfakes AI

https://techfusiondaily.com/global-trust-crisis-deepfakes-ai/
1•nelkazzu•9m ago•0 comments

Ask HN: How AliExpress gets its recommendation as priority in Gmail?

1•RicoElectrico•10m ago•0 comments

Weight-loss drugs could save U.S. airlines more than $500M this year

https://www.latimes.com/business/story/2026-01-15/weight-loss-drugs-help-airlines
2•cwwc•10m ago•0 comments

A.I. and Burnout

https://petersobot.com/blog/on-ai-and-burnout/index.html
3•psobot•11m ago•0 comments

"This is the way" parody Bluesky posts

https://bsky.app/profile/shengokai.blacksky.app/post/3mcndjl5hw22w/quotes
1•mooreds•12m ago•1 comments

Texas A&M university is banning Plato, citing his "gender ideology"

https://lithub.com/texas-am-is-banning-plato-citing-his-gender-ideology/
4•Geekette•14m ago•1 comments

Has AI removed the appeal of vertical SaaS?

https://www.elliotcsmith.com/has-ai-removed-the-appeal-of-vertical-saas/
1•smitec•17m ago•0 comments

Pittsburgh researchers developing lifesaving robot "dogs"

https://www.cbsnews.com/news/pittsburgh-researchers-carnegie-mellon-life-saving-robot-dogs/
1•rolph•17m ago•0 comments

Show HN: Potatoverse, Platform for Apps

https://github.com/blue-monads/potatoverse
5•born-jre•19m ago•1 comments

The Engineering Management Myths Star Trek Teaches (2022)

https://philipotoole.com/star-trek-made-me-a-bad-engineering-manager/
4•otoolep•22m ago•0 comments

Partial reprogramming as a strategy for aging and disease

https://www.sciencedirect.com/science/article/pii/S1568163726000012
1•jjoe•23m ago•0 comments

DIY Potato Aerogel: Free Cooling from Your Kitchen? [video]

https://www.youtube.com/watch?v=J87Qyxzm_fQ
1•znpy•24m ago•0 comments

The EU, spurred by Trump, to sign mega free-trade deal with South America

https://www.washingtonpost.com/world/2026/01/17/eu-trade-deal-mercosur-south-america/
5•stopbulying•26m ago•3 comments

Auto start Next.js dev server when you open the project in VSCode

https://marketplace.visualstudio.com/items?itemName=bullptr.nextjs-code
1•bukharim96•26m ago•0 comments

Show HN: School/ಶಾಲೆ – Agentic Voice Tutor for Students

1•gaganyatri•33m ago•0 comments

Apache Arrow for the Database

https://dataengineeringcentral.substack.com/p/apache-arrow-for-the-database
1•tanelpoder•34m ago•0 comments

New fintech company claims Bitcoin will reach 100M by 2050

https://www.distributedledgertechnologies.com/
1•winnertakeall•35m ago•1 comments

Vibe Coding the Port – I gave up waiting for engine exports

https://benwiser.com/blog/Vibe-Coding-the-Port---I-gave-up-waiting-for-engine-exports.html
1•RupertWiser•39m ago•0 comments

The Computer Chronicles – Artificial Intelligence (1984) [video]

https://www.youtube.com/watch?v=_S3m0V_ZF_Q
2•usernamed7•42m ago•0 comments

Light Mode InFFFFFFlation

https://willhbr.net/2025/10/20/light-mode-infffffflation/
51•Fudgel•42m ago•11 comments

Show HN: Pylot – Jobs API at 1/30th the cost of Coresignal

https://pylothq.com/
1•yadavrh•43m ago•2 comments

Chorex: Restartable, Language-Integrated Choreographies (2025)

https://programming-journal.org/2025/10/20/
1•mpweiher•43m ago•0 comments

Flux 2 Small, from BFL: AI image generation on consumer GPUs

https://the-decoder.com/flux-2-small-brings-ai-image-generation-and-editing-to-consumer-graphics-...
1•dreadsword•49m ago•2 comments