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

European civil servants are being forced off WhatsApp

https://www.politico.eu/article/european-civil-servants-new-messaging-services/
1•ZacnyLos•2m ago•0 comments

Online age checks are coming in Europe

https://www.politico.eu/article/online-age-checks-are-coming-europe-children-social-media/
1•ZacnyLos•3m ago•0 comments

Can you steal $10k from a locked iPhone? [video]

https://www.youtube.com/watch?v=PPJ6NJkmDAo
1•ProfDreamer•6m ago•0 comments

GraphQL vs. REST: 18 Claims Fact-Checked with Primary Sources

https://wundergraph.com/blog/fact-checking-graphql-vs-rest
1•jensneuse•8m ago•1 comments

Has the Era of the Mega-Layoff Arrived?

https://www.wsj.com/business/has-the-era-of-the-mega-layoff-arrived-928f061d
1•erehweb•8m ago•0 comments

A premium infrastructure layer for hotels and event booking

https://cooveb-organizers-waitlist-gules.vercel.app/
1•sshinde•10m ago•0 comments

CERN Joins the OpenSearch Software Foundation as an Associate Member

https://opensearch.org/blog/cern-joins-the-opensearch-software-foundation/
1•Lunar5227•18m ago•0 comments

Show HN: Robust alternative to OpenClaw

https://github.com/opentalon/opentalon
3•opak•21m ago•0 comments

More Communities Like This?

1•ayorke•22m ago•0 comments

Show HN: Job Scraper for LinkedIn

https://chromewebstore.google.com/detail/job-scraper-for-linkedin/kkafipickfibnamoijjgamklecmmbbmf
1•qwikhost•23m ago•0 comments

Show HN: Agent Armor, a Rust runtime that enforces policies on AI agent actions

https://github.com/EdoardoBambini/Agent-Armor-Iaga
3•edoardobambini-•26m ago•2 comments

Coming Soon: Things That Matter in AI

https://www.technologyreview.com/2026/04/14/1135298/coming-soon-10-things-that-matter-in-ai-right...
1•joozio•27m ago•0 comments

AI Tremor-Print: Biometric Identification System

https://github.com/peterretief/biometric
1•peter_retief•27m ago•1 comments

Allbirds stock sees a wild surge of 582% on pivot from sneakers to AI

https://www.businessinsider.com/allbirds-stock-price-ai-newbird-gpus-compute-gpuaas-bird-shoes-20...
1•outlore•27m ago•0 comments

RIP Pull Requests (2005-2026)

https://www.latent.space/p/ainews-rip-pull-requests-2005-2026
1•swyx•29m ago•0 comments

JIT Compilers and Cache Coherency

https://joelsiks.com/posts/jit-compilers-and-cache-coherency/
2•joelsiks•36m ago•0 comments

AI Eyebrow Filter: Try Eyebrow Editor Online – AILab Tools

https://www.ailabtools.com/eyebrow-filter
1•minimk•37m ago•0 comments

EU age verification app ready as Europe moves to curb kids' social media access

https://www.reuters.com/world/eu-age-verification-app-ready-europe-moves-curb-childrens-social-me...
2•taubek•44m ago•0 comments

A Black-Box Contract Engine for Agentic Software Development

https://github.com/elmacnifico/dojo
1•feedyourhead•48m ago•0 comments

Lovable vs. Bolt vs. Replit: who's leaking the most Supabase data?

https://securityscanner.dev/blog/lovable-vs-bolt-vs-replit-rls
4•slederer•49m ago•0 comments

Leonardo, Borgia, and Machiavelli: A Fateful Collusion

https://www.historytoday.com/archive/leonardo-borgia-and-machiavelli-fateful-collusion
1•apollinaire•51m ago•0 comments

Eustella: We reinvent ChatGPT for Europeans, with OpenClaw in mind

https://eustella.com
1•doener•53m ago•1 comments

The Elegant Laminar Flow of Moroccan Tea [video]

https://www.youtube.com/watch?v=rB5jpFHq06w
1•user070223•55m ago•1 comments

From Idea to Deployed App: Full Laravel Workflow with LaraCopilot

https://laracopilot.com/blog/idea-to-deployed-app/
1•laracopilotai•58m ago•0 comments

I made an MVP in one day

https://diegolopez.dev/2026/04/15/i-made-an-mvp-in-one-day/
2•diegolopd•1h ago•0 comments

AI Data Residency: When Cloud APIs Don't Meet Your Compliance Requirements

https://substack.com/home/post/p-194377303
1•morleymedia•1h ago•0 comments

The New Window

1•claudecarlyle•1h ago•0 comments

The Mathematics of Tetris (2011)

https://math.stackexchange.com/questions/80246/the-mathematics-of-tetris
1•downbad_•1h ago•1 comments

What Is WebAssembly? (2015)

https://medium.com/javascript-scene/what-is-webassembly-the-dawn-of-a-new-era-61256ec5a8f6
2•downbad_•1h ago•1 comments

I Let Claude Opus Write a Chrome Exploit

https://www.hacktron.ai/blog/i-let-claude-opus-to-write-me-a-chrome-exploit
1•svenfaw•1h ago•0 comments