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

Trump's $6T crypto plot [video]

https://www.youtube.com/watch?v=hqNxmWYMAr4
1•simonebrunozzi•1m ago•0 comments

Summary of CVE-2026-23864

https://vercel.com/changelog/summary-of-cve-2026-23864
1•tamnd•2m ago•0 comments

Show HN: Externalized Properties, a modern Java configuration library

https://github.com/joel-jeremy/externalized-properties
1•jeyjeyemem•4m ago•0 comments

Collatz High Cycles Do Not Exist (K. Knight), Discrete Mathematics 349(3), 2023

https://hal.science/hal-04261183/document
1•vismit2000•4m ago•0 comments

Show HN: GetClawdbot – A Community Guide and Skill Hub for Clawdbot

https://getclawdbot.org
1•medivhX•7m ago•1 comments

Chanfana: OpenAPI 3.1 and Zod for Hono/itty-router on Cloudflare Workers

https://github.com/cloudflare/chanfana
1•Lwrless•9m ago•0 comments

Syncthing: Open-Source Continuous File Synchronization

https://github.com/syncthing/syncthing
1•AbuAssar•11m ago•0 comments

Nixtamal: Fulfilling, Pure Input Pinning for Nix

https://nixtamal.toast.al
1•toastal•12m ago•0 comments

Microsoft ordered to stop tracking school children

https://noyb.eu/en/noyb-win-microsoft-ordered-stop-tracking-school-children
1•HotGarbage•13m ago•0 comments

Ask HN: What's your wiring pattern for large addressable LED installs?

3•emmasuntech•14m ago•1 comments

The state of Linux music players in 2026

https://crescentro.se/posts/linux-music-players-2026/
2•signa11•15m ago•0 comments

Disabling GitHub MCP on CC extended my sessions ~10%

https://staunch.ai/blog/disabling-github-mcp
1•irasigman•17m ago•0 comments

EU-India Free Trade,Investment Protection and Geographical Indications Agreement

https://policy.trade.ec.europa.eu/eu-trade-relationships-country-and-region/countries-and-regions...
2•Someone•17m ago•0 comments

DeepSeek-OCR 2

https://github.com/deepseek-ai/DeepSeek-OCR-2
3•wahnfrieden•18m ago•0 comments

From Hours to Seconds: Automating Python Security with AI?

https://nocomplexity.substack.com/p/from-hours-to-seconds-automating
1•runningmike•19m ago•0 comments

How do you use LLMs to verify databases with minimal hallucinations?

1•rochansinha•20m ago•0 comments

Windows Central Eliminates Most of Its Gaming Journalists

https://80.lv/articles/windows-central-eliminates-most-of-its-gaming-journalists
1•pjmlp•20m ago•0 comments

Anthropic launches the MCP Apps open spec, in Claude.ai

https://www.latent.space/p/ainews-anthropic-launches-the-mcp
1•swyx•21m ago•0 comments

Ask HN: What Happened to Apple App Clips?

3•tomtec•25m ago•2 comments

You gotta think outside the hypercube

https://lcamtuf.substack.com/p/you-gotta-think-outside-the-hypercube
1•fratellobigio•26m ago•0 comments

GiganticWebsites is AI and humans at its worst

https://github.com/Voultapher/blog/blob/main/posts/2026/gigantic-websites/text.md
1•Voultapher•26m ago•0 comments

Let's Talk About Those Watches in 'Severance'

https://www.hodinkee.com/articles/lets-talk-about-those-watches-in-severance
1•wslh•30m ago•0 comments

How to get your first customers[for Devs]

https://medium.com/@avneesh_67085/so-you-finished-your-mvp-heres-how-to-get-your-first-customers-...
1•mightymosquito•31m ago•0 comments

LLM Ad Blockers are coming

https://idiallo.com/blog/prompt-engineering-to-remove-ads
4•7777777phil•33m ago•0 comments

Roots is a game server daemon that manages Docker containers for game servers

https://github.com/SproutPanel/roots
1•Kerrick•35m ago•0 comments

Russia using Interpol's wanted list to target critics abroad, leak reveals

https://www.bbc.com/news/articles/c20gg729y1yo
5•breve•35m ago•0 comments

An ultra-high-resolution map of (dark) matter

https://www.nature.com/articles/s41550-025-02763-9
1•neom•36m ago•0 comments

Show HN: See how much things cost in terms of your runway

1•yakkomajuri•36m ago•0 comments

Hidden Preference to Auto-Resize Columns in the Finder on macOS

https://forums.realmacsoftware.com/t/auto-resizing-columns-in-finder/52435
3•7777777phil•36m ago•0 comments

Strong vs. swole: the surprising truth about building muscle

https://www.theguardian.com/lifeandstyle/2026/jan/26/strong-v-swole-building-muscle-bodybuilding-...
1•akbarnama•37m ago•0 comments