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

Learning About FPGAs in Finance

https://www.semidesignjobs.com/blog/fpgas-in-finance-hft
2•johncole•3m ago•0 comments

Show HN: Another experiment with an Erdos problem and LLMs

1•ilitirit•5m ago•0 comments

US power demand to reach record highs in 2026–2027 driven by AI and data centers

https://www.reuters.com/business/energy/us-power-use-beat-record-highs-2026-2027-ai-use-surges-ei...
1•latentframe•6m ago•1 comments

Ask HN: Will local models on normal hardware ever compete?

1•locusofself•9m ago•0 comments

Roast My Startup: Aluqos

https://www.aluqos.com/
1•ndossantos•14m ago•1 comments

Details That Make Interfaces Feel Better

https://jakub.kr/writing/details-that-make-interfaces-feel-better
1•vinhnx•14m ago•0 comments

Transformation and Analogies

https://camerongordon0.substack.com/p/on-transformation-and-analogies
1•iciac•18m ago•0 comments

Critical Thinking: The Architecture of Doubt

https://calltothink.com/blog/critical-thinking-architecture-of-doubt/
1•akarnam37•18m ago•0 comments

Show HN: Vibe Check – Client-side invisible Unicode steganography scanner

https://websationflow.com/
1•Raywob•19m ago•0 comments

I'm Not a Robot

https://sheets.works/data-viz/captcha
2•thunderbong•27m ago•0 comments

The Foldable iPhone Is Basically an iPad Mini That Folds in Half

https://gizmodo.com/the-foldable-iphone-is-basically-an-ipad-mini-that-folds-in-half-2000750451
1•thunderbong•35m ago•0 comments

Show HN: Paper Millionaire – A Startup Stock Option Horror Roguelike

https://paper-millionaire.pagey.site/
2•freakynit•42m ago•0 comments

Show HN: Free On-Brand AI Ad Maker

https://www.context.dev/free-tools/ad-maker
1•ICodeSometimes•43m ago•0 comments

Show HN: MemOperator-4B

https://huggingface.co/MemTensor/MemOperator-4B
2•MemTensor•44m ago•0 comments

Branimir Lambov from IBM on Cassandra

https://theconsensus.dev/p/2026/04/26/branimir-lambov-from-ibm-on-cassandra.html
2•SerCe•50m ago•0 comments

Surfshark releases new proprietary VPN protocol

https://www.zdnet.com/article/surfshark-dausos-vpn-protocol/
2•kitchi•50m ago•0 comments

Learning to Repair Lean Proofs from Compiler Feedback

https://arxiv.org/abs/2602.02990
1•matt_d•51m ago•0 comments

Italy to extradite suspected Chinese hacker wanted by US authorities

https://www.reuters.com/world/china/italy-extradite-suspected-chinese-hacker-wanted-by-us-authori...
1•NN88•55m ago•0 comments

Ask HN: Is there a way to render URLs to PDFs on Android?

1•Irongirl1•55m ago•1 comments

California's Billionaire Tax Has the Signatures to Make the Ballot, Backers Say

https://www.wsj.com/politics/policy/californias-billionaire-tax-has-the-signatures-to-make-the-ba...
7•testfoobar•59m ago•2 comments

Banning AI Art – Wallhaven

https://wallhaven.cc/forums/thread/4800
2•thedayisntgray•59m ago•2 comments

Low-Dose Aspirin Usage for Primary Prevention Has Fallen by >50% Since 2018

https://www.epicresearch.org/articles/low-dose-aspirin-usage-for-primary-prevention-of-cardiovasc...
1•salkahfi•1h ago•0 comments

Making UIs like text adventure games

https://en.andros.dev/blog/b5ba872a/making-uis-like-text-adventure-games/
1•andros•1h ago•0 comments

Framework's new Linux laptop is selling faster than its Windows one

https://www.pcworld.com/article/3123900/framework-new-linux-laptop-is-selling-faster-than-its-win...
10•Garbage•1h ago•1 comments

Show HN: Twitter Bulk Delete

https://chromewebstore.google.com/detail/twitter-bulk-delete-bulk/liocepnkgmapkfiplhhgjkokgnolglbc
2•qwikhost•1h ago•0 comments

PLA-Based triboelectric nanogenerators: Pathway to sustainable energy harvesting

https://www.sciencedirect.com/science/article/pii/S2773207X25000193
1•ludicrousdispla•1h ago•0 comments

Cursor Deleted Railway Production Volume and Backups

https://twitter.com/i/status/2048103471019434248
3•fastest963•1h ago•0 comments

YouTube Removes Alt-Right Criticism

https://www.youtube.com/post/UgkxiDyyBsYJwX0PKsnu2_AOGMhMYwm0qPKm
11•pkilgore•1h ago•0 comments

Making a Landing Page Work for Both Humans and AI Agents

https://docsalot.dev/blog/i-redesigned-my-landing-page-so-ai-agents-can-read-it
3•fazkan•1h ago•0 comments

AI and Digitalization in HTA: Enhancing Evidence, Equity and Efficiency [video]

https://www.youtube.com/watch?v=2wN0D-AqUQQ
1•DarkmSparks•1h ago•0 comments