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

Cognitive profiling from speech, not multiple choice

https://expressivecognition.org/
1•baplantas•4m ago•0 comments

The Philosopher and the Tsar

https://www.the-hinternet.com/p/the-philosopher-and-the-tsar
1•Caiero•4m ago•0 comments

Ask HN: Why have supply chain attacks become a near daily occurrence?

1•dhruv3006•4m ago•0 comments

Mental Health Fashion

https://nosaddays.com/
2•samdreamin•6m ago•0 comments

Show HN: I built an app after nearly missing a passport expiry

https://traveldocumentvault.com/
1•mustafahafeez•8m ago•1 comments

Screenpipe

https://github.com/screenpipe/screenpipe
2•handfuloflight•9m ago•0 comments

You can now run a full Linux operating system inside a 6mb PDF

https://twitter.com/oliviscusAI/status/2038563166431346865
3•matthewsinclair•15m ago•1 comments

Show HN: Provero – Data quality checks in YAML, compiled to single SQL queries

https://github.com/provero-org/provero
2•andreahlert•15m ago•0 comments

Office EU: European-owned cloud based office suite

https://office.eu
2•koenraad•16m ago•0 comments

Tokens Are the New Oil: How China Is Quietly Winning the AI Economy

https://thamizhelango.medium.com/tokens-are-the-new-oil-how-china-is-quietly-winning-the-ai-econo...
1•KnuthIsGod•17m ago•0 comments

The United States has become a rogue state

https://www.washingtonpost.com/ripple/2026/03/26/united-states-trump-rogue-state-iran/
1•hkhn•18m ago•0 comments

Show HN: Tiny Axios Alternative, Fch

https://www.npmjs.com/package/fch
1•franciscop•18m ago•0 comments

Our AI traced the axios NPM attack and found how the payload hid itself

https://app.strix.ai/share/chats/NDIxNzZiMTItZWQ2My00NDY4LWIzYzUtNDEyZDgyMWI1YjYzLm1uZTJldnQ0LkVt...
1•ahmedallam2•18m ago•0 comments

What is 'tokenomics' and how would China gain the edge

https://www.scmp.com/tech/big-tech/article/3347495/how-china-could-dominate-ai-eras-tokenomics-va...
1•KnuthIsGod•18m ago•0 comments

Delve – Fake Compliance as a Service – Part II

https://substack.com/home/post/p-192665132
1•theahura•21m ago•0 comments

California to impose new AI regulations in defiance of Trump call

https://www.theguardian.com/us-news/2026/mar/30/california-ai-regulations-trump
1•thm•23m ago•0 comments

Anthropic, The Pentagon, and the Future of Autonomous Weapons

https://www.bloomberg.com/news/articles/2026-03-28/anthropic-s-fight-with-us-military-over-future...
1•KnuthIsGod•23m ago•1 comments

Show HN: An AI Operating System

https://getariaos.com/
1•juniormpakou•31m ago•1 comments

Archive review: a gorgeous sci-fi movie that fails the Black Mirror test (2020)

https://www.polygon.com/2020/7/10/21320614/archive-review-vod-movie-theo-james-stacy-martin-westw...
1•walterbell•31m ago•0 comments

What to Know About California's Executive Order on A.I

https://www.nytimes.com/2026/03/30/technology/california-ai-executive-order.html
2•y1n0•32m ago•0 comments

Tropical geckos are more adaptable than we thought

https://phys.org/news/2026-03-tropical-geckos-australia-thought.html
1•y1n0•33m ago•0 comments

Purple Lifeform Photographed Sprouting 'Tentacles' on the ISS

https://www.sciencealert.com/purple-lifeform-photographed-sprouting-tentacles-on-the-iss
2•y1n0•34m ago•0 comments

Pairs of atoms observed existing in two places at once for the first time

https://phys.org/news/2026-03-pairs-atoms.html
1•arunc•35m ago•0 comments

Americans Have Never Been All That Excited About Going to the Moon

https://www.nytimes.com/2026/03/30/science/nasa-astronauts-moon-americans-mood.html
2•mmooss•36m ago•0 comments

Claude usage limits hitting faster than expected

https://old.reddit.com/r/ClaudeCode/comments/1s7zg7h/investigating_usage_limits_hitting_faster_than/
7•Austin_Conlon•36m ago•0 comments

The mindbending 'cyberpunk city' in China that exists on so many levels

https://www.cnn.com/travel/chongqing-china-tourism-cyberpunk-city-intl-hnk
2•1659447091•39m ago•0 comments

AI Tools Directory – Verified Anti-Hallucination SEO Tools – LogicBalls

https://logicballs.com
1•mohitsingh01•40m ago•0 comments

How fast can algorithms advance capabilities?

https://epoch.ai/gradient-updates/how-fast-can-algorithms-advance-capabilities
1•jxmorris12•41m ago•0 comments

Vaping likely to cause lung and oral cancer, Australian researchers find

https://www.theguardian.com/australia-news/2026/mar/31/vaping-lung-cancer-risk
1•sandebert•41m ago•0 comments

Artemis II mission countdown clock started

https://www.nasa.gov/blogs/missions/2026/03/30/nasas-artemis-ii-launch-mission-countdown-begins/
5•d_silin•44m ago•0 comments