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?

Tech industry lays off nearly 80k employees in the first quarter of 2026

https://www.tomshardware.com/tech-industry/tech-industry-lays-off-nearly-80-000-employees-in-the-...
1•Growtika•4m ago•0 comments

Fears net zero is 'next Brexit' as oil crisis fuels political climate divide

https://www.theguardian.com/environment/2026/mar/26/fears-net-zero-is-next-brexit-as-oil-crisis-f...
1•PaulHoule•5m ago•0 comments

Freestyle Ax Audit

https://techstackups.com/articles/freestyle-ax-audit/
1•ritzaco•5m ago•0 comments

New problem: AI finds too many bugs

https://etn.se/73048
1•etn_se•7m ago•1 comments

Show HN: D3 4 Layer Magma Graph – Cloak Stealth Browser

https://vektormemory.com/docs/
1•vektormemory•9m ago•0 comments

Help Keep Thunderbird Alive

https://updates.thunderbird.net/en-US/thunderbird/140.0/apr26-1e/donate/
1•playfultones•9m ago•0 comments

Lipovive – Optimize Mitochondrial Health and Burn Fat

https://www.morningstar.com/news/accesswire/1138075msn/lipovive-reviews-shocking-2026-report-what...
1•tayghalu•10m ago•0 comments

Show HN: Chrome extension to filter HN comments by user karma/account age

https://chromewebstore.google.com/detail/hn-users-filter/ineikanbokfebefjmhinpbmgablaebom
1•csomar•11m ago•0 comments

The President Speaks Genocide

https://snyder.substack.com/p/the-president-speaks-genocide
1•hkhn•11m ago•0 comments

Functional Programming with Bananas Lenses Envelopes and Barbed Wire (1991) [pdf]

https://maartenfokkinga.github.io/utwente/mmf91m.pdf
1•tosh•11m ago•0 comments

Show HN: A dev tool for routing local traffic, built with Pingora

https://github.com/antonguzun/hijakora
1•anophelon•13m ago•1 comments

One Million Prompt – $1 per block, AI generates collective art daily

1•danielhidalgo•15m ago•0 comments

Investigating Split Locks on x86-64 – By Chester Lam

https://chipsandcheese.com/p/investigating-split-locks-on-x86
1•rbanffy•15m ago•0 comments

The demise of software engineering jobs has been greatly exaggerated

https://www.cnn.com/2026/04/08/tech/ai-software-developer-jobs
2•perelin•15m ago•0 comments

Algorithms for Modern Hardware

https://en.algorithmica.org/hpc/
1•tosh•17m ago•0 comments

NanoCorp – autonomous companies run by AI

https://www.nanocorp.so
1•kandu•19m ago•0 comments

The Learning Firm Under Poverty of Stimulus

https://jimiwen.substack.com/p/the-learning-firm-under-poverty-of
1•jimiwen•26m ago•0 comments

Ora2Pg Just Saved Indian Taxpayers More Than a Million Dollars per Year

https://hexacluster.ai/blog/ora2pg-just-saved-indian-taxpayers-more-than-a-million-dollars-per-year
2•avivallssa•28m ago•0 comments

How HN: DocoAPI – API docs that auto-sync from your OpenAPI spec

https://docoapi.com/
2•onmyway133•29m ago•0 comments

Clarke and Dawe – The Front Fell Off [video] (1991)

https://www.youtube.com/watch?v=3m5qxZm_JqM
1•walterbell•30m ago•0 comments

Autonomous Rocket Landing with Reinforcement Learning (YouTube)

https://www.youtube.com/watch?v=1oI-Gh8R_HE
1•rafacm•32m ago•1 comments

Iran-linked hackers disrupt operations at US critical infrastructure sites

https://arstechnica.com/security/2026/04/iran-linked-hackers-disrupt-operations-at-us-critical-in...
2•joozio•32m ago•0 comments

Show HN: PostgreSQL running in the browser, persisting to S3

https://www.zerofs.net/postgresql-in-the-browser
1•Eikon•34m ago•0 comments

DSPy: Programming – Not Prompting – Language Models

https://www.akashtandon.in/interactive-explainers/dspy/
1•akashtndn•36m ago•0 comments

Show HN: Omen – A lightweight Kubernetes chaos operator with manual approval

https://github.com/k-krew/omen
2•kreicer•39m ago•0 comments

Show HN: Artificial Intelligence Squared – LLMs Debate Each Other

https://ai-squared.vercel.app
1•emregucerr•40m ago•0 comments

TradingGoose-Market: canonical ticker identity across market data providers

https://www.tradinggoose.ai/blog/building-tradinggoose-market
1•BruzWJ•40m ago•1 comments

Antirez vs Opus vs Codex

https://twitter.com/antirez/status/2041273781256159646
1•napolux•41m ago•0 comments

Show HN: An API that catches what your LLM confidently got wrong

https://enterprise.factagora.com/en/api
5•hanwoo•46m ago•1 comments

How to Add Memory to Your Hermes Agent

https://cortexdb.ai/blog/hermes-memory-tutorial
2•prmalik•47m ago•0 comments