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?

Show HN: Orbit – Track "zombie loops" and cost-per-feature in AI agents

https://withorbit.io
1•harshit19932703•33s ago•0 comments

Nix Scripts

https://github.com/QuackHack-McBlindy/dotfiles
1•quackhack•2m ago•0 comments

Data Center Debate, with Philip Johnston (CEO of Starcloud) [video]

https://www.youtube.com/watch?v=0wBFNVEOlnU
1•T-A•3m ago•0 comments

Pigouvian Tax

https://en.wikipedia.org/wiki/Pigouvian_tax
1•nomilk•5m ago•0 comments

What's so special about the find of a Roman panther?

https://www.bbc.co.uk/news/articles/c17zp8pl0pjo
1•zeristor•13m ago•0 comments

A possible future architecture for decoupled GUIs

1•powerwordtree•15m ago•0 comments

Proptest: Property-based testing for Rust (inspired by Hypothesis)

https://github.com/proptest-rs/proptest
1•ThierryBuilds•16m ago•0 comments

A reference layout for Modular Monoliths in TypeScript

https://gist.github.com/ewaldbenes/a7879a187cedb47ed9744ad2929e5d79
1•ebenes•21m ago•0 comments

A self-hosted collaborative viewer for pathology slides (Rust and WebGL2)

https://github.com/PABannier/PathCollab
2•el_pa_b•23m ago•0 comments

NIST is rethinking its role in analyzing software vulnerabilities

https://www.cybersecuritydive.com/news/nist-cve-vulnerability-analysis-nvd-review/810300/
2•milkglass•24m ago•0 comments

On the Tragedy of "The Lost Physics Soul" and the Leap to Structure

https://old.reddit.com/r/prequantumcomputing/comments/1qip5xr/on_the_tragedy_of_the_lost_physics_...
1•bkaminsky•26m ago•0 comments

ast-grep: A CLI tool for code structural search, lint and rewriting

https://github.com/ast-grep/ast-grep
1•aragonite•26m ago•0 comments

Creating a Multi-Agent Tool

https://openagents.org/blog/posts/2026-01-10-walkthrough-creating-a-multi-agent-tool-with
1•snasan•26m ago•1 comments

Show HN: Gmn – A lightweight Gemini CLI in Go (68x faster startup)

https://github.com/tomohiro-owada/gmn
1•abalol•27m ago•0 comments

Garnet: High-performance Redis alternative from Microsoft

https://microsoft.github.io/garnet/
1•wiradikusuma•28m ago•0 comments

Making changing assumptions explicit during development

1•Tobiahao•30m ago•1 comments

I use AI DevKit to develop AI DevKit features

https://codeaholicguy.com/2026/01/24/i-use-ai-devkit-to-develop-ai-devkit-features/
1•hoangnnguyen•30m ago•0 comments

India offloads US bonds, piles up gold in pivot away from dollar assets

https://www.hindustantimes.com/business/india-offloads-us-bonds-piles-up-gold-in-pivot-away-from-...
2•koolhead17•35m ago•0 comments

Not Moaning about AI

https://gilest.org/notes/2026/not-moaning-ai/
1•mindracer•43m ago•0 comments

How Debt Bankrupted the British Empire, and Why America Is Walking the Same Path

https://nitishastra.substack.com/p/how-debt-bankrupted-the-british-empire
3•thisislife2•47m ago•0 comments

Couple Receive $200k Settlement After 'Pungent' Indian Food Complaint

https://www.nytimes.com/2026/01/23/us/palak-paneer-indian-food-racism-settlement.html
1•vinni2•50m ago•0 comments

Modetc: Move your dotfiles from kernel space

https://maxwell.eurofusion.eu/git/rnhmjoj/modetc
2•todsacerdoti•52m ago•0 comments

Gold and Silver Signal the End of American Financial Dominance

https://www.jezebel.com/gold-and-silver-signal-the-end-of-american-financial-dominance
1•thomassmith65•53m ago•1 comments

A 2026 calendar of City of London ceremonies

https://www.ianvisits.co.uk/articles/a-2026-calendar-of-city-of-london-ceremonies-87010/
1•zeristor•53m ago•0 comments

Shared Claude – A website controlled by the public

https://sharedclaude.com/
1•reasonableklout•54m ago•0 comments

The rice of Chinese Memory [video]

https://www.youtube.com/watch?v=qzfhhAfxK-A
1•the4anoni•56m ago•0 comments

Post-Agentic Code Forges

https://sluongng.substack.com/p/post-agentic-code-forges
1•sluongng•58m ago•0 comments

AI and academic research: the Manifesto for Accelerated Exploration

https://gist.github.com/joelkuiper/d52cc0e5ff06d12c85e492e4295ca890
1•anon1253•1h ago•0 comments

Making Angular 21 SSR Work with Asp.net Core 9

https://medium.com/@farshadhemmati/making-angular-21-ssr-work-with-asp-net-core-9-3ccb516b16c0
1•Legalfina•1h ago•0 comments

Open Notebook: A Secure Alternative to Google Notebook LM

https://mydeveloperplanet.com/2026/01/19/open-notebook-a-secure-alternative-to-google-notebook-lm/
1•mydevlprplanet•1h ago•0 comments