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

Show HN: EdgeDox – Offline document AI on Android using Qwen3.5-0.8B

https://play.google.com/store/apps/details?id=io.cyberfly.edgedox&hl=en_US
1•cyberfly-labs•13s ago•0 comments

EA Javelin Anticheat job listing mentions future support for Linux and Proton

https://www.gamingonlinux.com/2026/03/ea-javelin-anticheat-job-listing-mentions-future-support-fo...
1•exploraz•8m ago•0 comments

Should AI web agents skip sponsored/ad results by default?

2•ilyasJosef•16m ago•2 comments

TCXO Failure Analysis

https://serd.es/2026/03/06/TCXO-failure-analysis.html
1•zdw•17m ago•0 comments

Google Workspace CLI Removes MCP Support

https://github.com/googleworkspace/cli/pull/275
1•waf•25m ago•0 comments

Armed robots take to the battlefield in Ukraine war

https://www.bbc.com/news/articles/c62662gzlp8o
2•dabinat•25m ago•0 comments

Show HN: CC Pocket – Control Claude Code/Codex from Your Phone

https://github.com/K9i-0/ccpocket
1•k9i•27m ago•0 comments

Readeck 0.22 Released

https://readeck.org/en/blog/202602-readeck-22/
1•Curiositry•39m ago•0 comments

Evolving Languages Faster with Type Tailoring (2024)

https://lambdaland.org/posts/2024-07-15_type_tailoring/
1•PaulHoule•40m ago•0 comments

Grammarly is using our identities without permission

https://www.theverge.com/ai-artificial-intelligence/890921/grammarly-ai-expert-reviews
6•LordAtlas•40m ago•1 comments

I compiled a list of why you should be excited about std:SIMD and C++26

https://old.reddit.com/r/cpp/comments/1rjld1s/i_compiled_a_list_of_6_reasons_why_you_should_be/
1•ibobev•41m ago•0 comments

Mars MIPS Simulator in the Browser

https://mars.nfiles.top/
2•nenepbl•43m ago•1 comments

Ask HN: Is SWE mostly just calling APIs?

1•humbleharbinger•45m ago•6 comments

Practical Guide to Bare Metal C++

https://arobenko.github.io/bare_metal_cpp/#_abstract_classes
1•ibobev•45m ago•0 comments

NPM audit passes malicious packages with no CVE

https://westbayberry.com/
1•ComCat•45m ago•1 comments

Claude.ai "We are experiencing delivery issues with some email providers"

1•freely0085•46m ago•1 comments

Sarvamai/Sarvam-105B

https://huggingface.co/sarvamai/sarvam-105b
1•ryanhn•48m ago•0 comments

T3 Code [video]

https://www.youtube.com/watch?v=hDn8-fK3XaU
1•jv22222•48m ago•0 comments

Show HN: I built an AI agent that wrote a full novel in 10 minutes

https://github.com/fugue-labs/gollem
1•helsinki•57m ago•3 comments

Man Randomly Stabbed in Back in SF's Chinatown While Waiting to Cross

https://www.ktvu.com/news/man-stabbed-back-sfs-chinatown-suspect-arrested
2•robertwt7•1h ago•0 comments

The Little Book of Algorithms

https://github.com/little-book-of/algorithms
1•ibobev•1h ago•0 comments

Every Tool Progress Update

https://everytool.solutions/
1•Mihir1426•1h ago•0 comments

Show HN: Open source drone that can hold cargo

https://github.com/L42ARO/Mercury-Transforming-Drone
2•devmandan•1h ago•1 comments

Support for Aquantia AQC113 and AQC113C Ethernet Controllers on FreeBSD

https://github.com/Aquantia/aqtion-freebsd/issues/32
1•justinclift•1h ago•1 comments

AI Dev News Digest: March 6th, 2026

https://www.everydev.ai/p/news-ai-dev-news-digest-march-6th-2026
1•devhouse•1h ago•0 comments

LLMs will supplant most human-driven vulnerability research

https://twitter.com/tqbf/status/2030102845089804473
1•lambdaba•1h ago•0 comments

The Filthy Human Hands (FHH) License v1.0

https://git.disroot.org/bsdclown/filthy_human_hands
2•MBCook•1h ago•1 comments

Anthropic Unveils Amazon Inspired Marketplace

https://www.bloomberg.com/news/articles/2026-03-06/anthropic-unveils-amazon-inspired-marketplace-...
1•dthread3•1h ago•0 comments

Show HN: Glad-IA-Tor – Tired of Vibecoded Products? Come and Roast Them for Free

https://glad-ia-tor.com/
1•GiornoJojo•1h ago•1 comments

Ontology (Information Science)

https://en.wikipedia.org/wiki/Ontology_(information_science)
2•downboots•1h ago•0 comments