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?

Paramount Makes Hostile Bid for Warner Bros. Discovery

https://www.nytimes.com/2025/12/08/business/paramount-warner-bros-discovery-netflix.html
1•doener•4m ago•0 comments

What Makes Goethe So Special?

https://www.newyorker.com/magazine/2025/12/08/goethe-a-life-in-ideas-matthew-bell-book-review
1•mitchbob•4m ago•1 comments

7-Eleven to Pay Record $4.5M Penalty for FTC Antitrust Order Violation Case

https://www.ftc.gov/news-events/news/press-releases/2025/12/7-eleven-pay-record-45-million-penalt...
1•gnabgib•5m ago•0 comments

The Lost Machine Automats and Self-Service Cafeterias of NYC (2023)

https://www.untappedcities.com/automats-cafeterias-nyc/
4•walterbell•7m ago•0 comments

Canadian traditional owners fear Australian-style LNG development

https://www.abc.net.au/news/2025-12-09/canada-traditional-owners-in-australia-to-protest-against-...
1•defrost•7m ago•0 comments

Scientific and Technical Amateur Radio

https://destevez.net/
4•gballan•8m ago•0 comments

Gig: How our 25G PON investment shatters the limits of today's internet

https://fiber.googleblog.com/2025/12/20-gig-update.html
1•xnx•9m ago•0 comments

Mr. Ren Zhengfei's Meeting with ICPC Foundation President

https://cence.comp.nus.edu.sg/cence/icpc_minutes_2025.html
2•doener•10m ago•0 comments

Metacode: The new standard for machine-readable comments for Python

https://github.com/pomponchik/metacode
1•pomponchik•11m ago•1 comments

Show HN: Octopii, a runtime for writing distributed applications in Rust

https://github.com/octopii-rs/octopii
1•puterbonga•12m ago•0 comments

RNA language models can generalize well on structure prediction tasks

https://www.nature.com/articles/s41467-025-60872-5
2•PaulHoule•16m ago•0 comments

Using an AI Mediator Because Humans Are Terrible at Conflict

https://www.mitigateapp.com/
2•mksinclair•19m ago•3 comments

Show HN: Tool to detect malware left behind after patching CVE-2025-55182

2•Just_Clive•26m ago•0 comments

Residents push back as 5G towers rise steps from their homes

https://www.local10.com/video/news/2025/12/04/residents-push-back-as-5g-towers-rise-steps-from-th...
2•walterbell•26m ago•0 comments

Using Citations to Explore Academic Literature

https://inciteful.xyz/
1•aragonite•28m ago•0 comments

What If Our Ancestors Didn't Feel Anything Like We Do?

https://www.theatlantic.com/magazine/2026/01/human-ancestors-emotion-history/684959/
2•petethomas•29m ago•1 comments

Authentication Explained: When to Use Basic, Bearer, OAuth2, JWT and SSO

https://javarevisited.substack.com/p/system-design-basics-authentication
3•rezaprima•30m ago•0 comments

Show HN: SteadyDancer – First-Frame Identity-Stable Dance Animation

https://www.steadydancer.net/?i=d1d5k
1•lu794377•31m ago•0 comments

Horses: AI progress is steady. Human equivalence is sudden

https://andyljones.com/posts/horses.html
3•pbui•32m ago•0 comments

I built an AI that learns code transformations from examples (not generative)

1•heavymemory•38m ago•0 comments

Bots, bias, and bunk: How can you tell what's real on the net?

https://www.theregister.com/2025/12/05/bots_bias_bunk/
1•CrankyBear•38m ago•0 comments

The Military Almost Got the Right to Repair. Lawmakers Just Took It Away

https://www.wired.com/story/the-military-almost-got-the-right-to-repair-lawmakers-just-took-it-away/
5•SanjayMehta•39m ago•0 comments

The Universal Weight Subspace Hypothesis

https://arxiv.org/abs/2512.05117
14•lukeplato•41m ago•1 comments

Trump Clears Sale of More Powerful Nvidia A.I. Chips to China

https://www.nytimes.com/2025/12/08/business/trump-nvidia-chips-china.html
4•aaraujo002•43m ago•1 comments

Bringing More Real-Time News and Content to Meta AI

https://about.fb.com/news/2025/12/bringing-more-real-time-news-and-content-to-meta-ai/
1•donohoe•49m ago•0 comments

Manual: Spaces

https://type.today/en/journal/spaces
2•doener•50m ago•1 comments

Deprecation: Software Engineering at Google

https://abseil.io/resources/swe-book/html/ch15.html
3•jez•51m ago•0 comments

Scientists devise method to fight aging at the cellular level

https://www.washingtonpost.com/science/2025/12/08/aging-stem-cells-longevity-mitochondria/
1•pseudolus•51m ago•1 comments

Show HN: ZetaCrush – An Intelligent LLM Leaderboard

https://zetacrush.com
1•zetacrushagent•53m ago•0 comments

EU says it will 'make sure' Elon Musk's X pays €120M fine

https://www.politico.eu/article/eu-commissions-will-make-sure-x-musk-pay-120m-fine-transparency-r...
3•doener•53m ago•0 comments