frontpage.
newsnewestaskshowjobs

Open Source @Github

fp.

Open in hackernews

Ask HN: How can I load test PostgreSQL but avoid changing actual data?

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

Looking Ahead to Postgres 19

https://www.snowflake.com/en/blog/engineering/postgresql-19-features-beta/
1•craigkerstiens•3m ago•0 comments

A Missing Piece in Climate Models: Nature's Own Emissions

https://e360.yale.edu/features/warming-induced-ecosystem-emissions
1•Brajeshwar•3m ago•0 comments

Eot-bench: Open benchmark suite for end-of-turn detection in voice AI

https://github.com/livekit/eot-bench
1•codestackr•3m ago•0 comments

GPT-5 writing a Singularity scenario (2025)

https://www.lesswrong.com/posts/dT3StLjeJG7ordQGm/gpt-5-writing-a-singularity-scenario
1•Gooblebrai•6m ago•0 comments

iOS 27 Adds Four New Features to Notes App, Including Markdown Copy-and-Paste

https://www.macrumors.com/2026/06/17/ios-27-apple-notes-app-new-features/
2•Tomte•6m ago•0 comments

Infection found in wildlife evolved to spread between humans

https://www.dailymail.com/health/article-15911213/virus-dermatophilosis-human-transmission-europe...
1•Bender•7m ago•0 comments

PyQt6 now ships the Designer plugin on conda-forge, fixing a 6-year gap

https://github.com/conda-forge/pyqt-feedstock/pull/184
1•ludmilaklenova•7m ago•0 comments

Migrating from GNU Stow to Chezmoi

https://rednafi.com/misc/chezmoi/
1•speckx•7m ago•0 comments

Problems I'm having with Opus and regression

1•dleech•8m ago•1 comments

The Download: a new hunt for dark matter and Kenya's case for going solar

https://www.technologyreview.com/2026/06/18/1139261/the-download-dark-matter-hunt-kenya-solar-power/
1•joozio•8m ago•0 comments

Show HN: Prompt Foundry-tasks with focused context & instructions = sharper AI

https://marketplace.visualstudio.com/items?itemName=sdevries.prompt-foundry
1•espresso_dev•9m ago•0 comments

Why Deleted Mac Apps Leave Files Behind

https://crufti.app/blog/why-deleted-mac-apps-leave-files-behind
1•gbourne•9m ago•0 comments

Performance Has Layers

https://oxide.computer/blog/performance-has-layers
1•robin_reala•9m ago•0 comments

A PostgreSQL Database for Every Agent: In-Database RAG, Graph, and Multitenancy

https://www.yugabyte.com/blog/a-postgresql-database-for-every-agent/
2•bug2man•12m ago•0 comments

Death by 1k Compromises: How to Tap into Founder Mode

https://tim.blog/2026/06/18/mark-pincus/
1•Michelangelo11•12m ago•0 comments

Where do migrants live, and where were they born?

https://ourworldindata.org/where-do-migrants-live-and-where-were-they-born
1•TMWNN•14m ago•1 comments

Making budget models punch above their weight with a smart Rust harness

https://yogthos.net/posts/2026-06-08-dirge-code.html
1•theanonymousone•15m ago•0 comments

Show HN: A small, crazy fast hybrid search engine written in Rust

https://github.com/deepbluedynamics/lume
1•kordlessagain•16m ago•1 comments

Why AI Is Incorrigibly Didactic

https://www.theatlantic.com/ideas/2026/06/ai-writing-style-literature/687536/
4•Michelangelo11•17m ago•0 comments

Third time's the charm for a row of faint galaxies without dark matter

https://news.yale.edu/2026/06/16/third-times-charm-row-faint-galaxies-without-dark-matter
1•gmays•17m ago•0 comments

Wiki Spy

https://neal.fun/wiki-spy/
4•irs•17m ago•0 comments

Pnpm temp paths broke lifecycle sockets

https://github.com/pnpm/pnpm/pull/12327
1•scarabsystems•18m ago•0 comments

Developers React to AI-Scented Blog Posts

https://writethatblog.substack.com/p/dev-reaction-to-ai-blog-posts
1•birdculture•18m ago•0 comments

Show HN: SDK for embedding zot coding agent in your Node.js applications

https://github.com/patriceckhart/zot-sdk-javascript
4•patriceckhart•20m ago•0 comments

Commodore Unveils Linux Powered Flip Phone

https://hackaday.com/2026/06/18/commodore-unveils-linux-powered-flip-phone/
1•kristianpaul•20m ago•0 comments

Apple's A12 and A13 Chips Facing New Unpatchable Exploit

https://www.macrumors.com/2026/06/18/a12-and-a13-chips-facing-exploit/
1•latexr•20m ago•0 comments

Is it time for a new Embedded Linux build system?

https://yoebuild.org/blog/time-for-a-new-build-system/
1•cbrake•20m ago•0 comments

Europe Scales Down AI Ambitions with Smaller Data Center Tender

https://www.bloomberg.com/news/articles/2026-06-18/europe-scales-down-ai-ambitions-with-smaller-d...
1•alecco•20m ago•2 comments

Show HN: Foglamp – Open-source o11y for AI SDK

https://www.foglamp.dev/
1•gustavofior•22m ago•0 comments

The founder of Craigslist has given away half a billion dollars

https://www.independent.co.uk/us/money/craigslist-multimillionaire-craig-newmark-b2980681.html
3•Tomte•22m ago•0 comments