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?

Ransomware groups switch to stealthy attacks and long-term access

https://www.csoonline.com/article/4137010/ransomware-groups-switch-to-stealthy-attacks-and-long-t...
1•kseniamorph•1m ago•0 comments

Offlining a Live Game with .NET Native AOT

https://sephnewman.substack.com/p/offlining-a-live-game-with-net-native
1•kg•2m ago•0 comments

Communication Files: Interprocess IO before Pipes (2017) [pdf]

https://www.cs.dartmouth.edu/~doug/DTSS/commfiles.pdf
1•mpweiher•2m ago•0 comments

US Customs destroys rare floppy disk

https://twitter.com/TehKeripo/status/2027171532825571678
1•Shank•3m ago•0 comments

Chinese car crashes after voice command kills headlights

https://carnewschina.com/2026/02/27/car-crashes-after-voice-command-kills-headlights-lynk-co-z20-...
2•giuliomagnifico•3m ago•0 comments

PostmarketOS in 2026-02: generic kernels, bans use of generative AI

https://postmarketos.org/blog/2026/02/26/pmOS-update-2026-02/
2•pantalaimon•5m ago•0 comments

Perplexity Computer Review – $100 lost in an hour

https://old.reddit.com/r/perplexity_ai/comments/1rfver4/perplexity_computer_review_100_lost_in_an...
1•daniel_iversen•5m ago•0 comments

Pentagon Fires Another Laser at Drone, Prompting New Air Closure

https://www.nytimes.com/2026/02/26/us/drone-faa-dhs-el-paso-airspace.html
1•reaperducer•5m ago•0 comments

A benchmark of expert-level academic questions to assess AI capabilities – HLE

https://www.nature.com/articles/s41586-025-09962-4
1•tufo•5m ago•0 comments

Blame RMS for AI Coding

https://bit1993.bearblog.dev/blame-rms-for-ai-coding/
3•bit1993•7m ago•0 comments

The war against PDFs is heating up

https://www.economist.com/business/2026/02/24/the-war-against-pdfs-is-heating-up
3•jcartw•8m ago•1 comments

The Insane Stupidity of UBI

https://geohot.github.io//blog/jekyll/update/2026/02/27/the-insane-stupidity-of-ubi.html
1•swah•9m ago•0 comments

Why your AI agents have goldfish syndrome

https://substack.com/home/post/p-189327282
1•vektormemory•12m ago•0 comments

Global Intelligence Crisis

https://www.citadelsecurities.com/news-and-insights/2026-global-intelligence-crisis/
1•jbredeche•12m ago•0 comments

Osmix

https://medium.com/conveyal-blog/introducing-osmix-365c4b4332ef
1•maxerickson•15m ago•0 comments

Which piece of speculative fiction had the greatest one-day stock market impact?

https://www.ft.com/content/f12398a8-ef57-412f-ae40-67ef9b421bed
2•cainxinth•18m ago•1 comments

AI Isn't the Excuse. It's the Enabler

https://devrimvardar.com/topic/ai-enabler-layoffs
1•devrimco•18m ago•1 comments

Show HN: Caddy plugin that charges AI crawlers real USDC to access your site

https://github.com/paolobietolini/caddy-x402
1•paolobietolini•20m ago•2 comments

STRinGS: Selective Text Refinement in Gaussian Splatting

https://strings-official.github.io
2•Claudiusseibt•21m ago•0 comments

Show HN: Kaomojiya – Browse and copy kaomoji (Japanese text emoticons) instantly

https://www.kaomojiya.org
1•chrisweiindie•22m ago•0 comments

Show HN: AI sandbox that runs on your homelab

https://github.com/deevus/pixels
1•deevus•23m ago•0 comments

"Our programs are fun to use."

https://unsung.aresluna.org/our-programs-are-fun-to-use/
2•todsacerdoti•24m ago•0 comments

Perplexity Computer – The Age of AI Agents Is Here

https://medium.com/seeds-for-the-future/perplexity-computer-the-age-of-ai-agents-is-here-958b3388...
1•hungryminded•25m ago•1 comments

Architectural Decisions That Will Make or Break Your AI Product

https://kb-it.net/5-architectural-decisions-that-will-make-or-break-your-ai-product/
1•better-it•26m ago•0 comments

Show HN: Httap – intercept and inspect HTTP traffic from your shell or agent

https://github.com/mtford90/httap
1•mtford•28m ago•0 comments

Best books/guides to learn about Stable coins in 2026

1•karti03•29m ago•0 comments

Lawmakers say US Military used laser to take down Border Protection drone in TX

https://apnews.com/article/military-laser-border-drone-texas-airport-55aaab7093f7d6dd174f909f3875...
5•thinkcontext•29m ago•1 comments

How Neoliberalism Broke Britain (2023)

https://tribunemag.co.uk/2023/10/breaking-britain-neoliberalism
1•robtherobber•29m ago•0 comments

Show HN: Shannon – Local desktop app to orchestrate Claude Code agent teams

1•lydionfinance•29m ago•0 comments

ChatGPT Advanced Data Analysis vs. Local Alternatives: A Privacy Comparison

https://www.queryveil.com/blog/chatgpt-data-analysis-privacy-comparison
1•david-rodriguez•31m ago•1 comments