frontpage.
newsnewestaskshowjobs

Open Source @Github

fp.

Open in hackernews

Ask HN: How can I load test PostgreSQL but avoid changing actual data?

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

Show HN: Binge watch ideas from the best people from different domains

https://www.stealbrains.com/tv
1•bebekgoreng•1m ago•0 comments

Maksym Radziwill–'The quasi-Riemann Hypothesis' [video]

https://www.youtube.com/watch?v=kYCOOyYkit8
1•pfdietz•1m ago•1 comments

We Built a Voter Education Specialist Agent That Uses Your Tax Returns

https://serendb.com/caroline-hughes
1•lewistaariq•4m ago•0 comments

Dust-shrouded Milky Way star cluster may be nearly as old as the universe

https://phys.org/news/2026-10-shrouded-milky-star-cluster-universe.html
1•wglb•5m ago•1 comments

Pando - OpenAI's alternative to Git for source control

https://twitter.com/OpenAIDevs/status/2117408792346509663
1•treyhuffine•6m ago•0 comments

Hi guys check out my YouTube native client

https://github.com/XBoom31/crossfade
1•xbum•7m ago•0 comments

Deploying robots into the real world with Tutor (a16z podcast) [video]

https://www.youtube.com/watch?v=lXkjXSul6yg
1•qrush•7m ago•0 comments

UEAS: A modern omnichannel emergency alert standard using UUIDv7 and JSON

https://github.com/itswiktoragain/Unified-Emergency-Alert-Standard/tree/main
1•propalnie15•10m ago•0 comments

Claudbar: An AI side panel for Firefox

https://addons.mozilla.org/firefox/addon/claudbar/
1•sciltomia•14m ago•0 comments

Show HN: Mealumo – log a meal's calories and macros from a photo (iOS)

https://apps.apple.com/us/app/mealumo-ai-calorie-tracker/id6811904664
1•mealumo_vlad•14m ago•0 comments

WA is losing more from Canada than shoppers

https://www.seattletimes.com/opinion/wa-is-losing-more-from-canada-than-shoppers/
3•ClearwayLaw•18m ago•1 comments

Ask HN: Who still uses EXO Labs?

1•thesnarkitecht•20m ago•0 comments

Ask HN: Are Tenstorrent cards better than Nvidia?

2•thesnarkitecht•23m ago•0 comments

U.S. Strikes Iran's Qeshm Island as Trump Talks Down War Risks

https://www.wsj.com/world/middle-east/u-s-strikes-irans-qeshm-island-as-trump-talks-down-war-risk...
8•Foxhuls•26m ago•0 comments

Goldman restricts traders and bankers from using some AI tools

https://www.moneycontrol.com/europe/?url=https://www.moneycontrol.com/news/business/goldman-restr...
2•vismit2000•27m ago•0 comments

Flight Explainer: Live charts of your Python pipelines

https://motherduck.com/blog/flight-explainer/
1•jonbaer•27m ago•0 comments

Cops bust botnet of 1.3M infected Android TV boxes

https://www.theregister.com/cyber-crime/2026/11/02/cops-bust-botnet-of-13m-infected-android-tv-bo...
3•entryleveljobsc•27m ago•1 comments

Inside Musk's plan to upend the wireless phone industry

https://www.washingtonpost.com/technology/2026/11/02/inside-elon-musks-plan-upend-wireless-phone-...
3•bookofjoe•29m ago•1 comments

Show HN: Project Wisteria-A BYOK chatbot that saves thoughts and memory locally

https://negativeabsence.com/wisteria/
1•NegativeAbsence•29m ago•1 comments

Quitting jobs: The two-week notice is dying. Maybe it should

https://slate.com/life/2026/11/jobs-job-work-quit-two-weeks-notice.html
2•tekdude•31m ago•0 comments

Blades CSS v3.1.0 released – a modern drop‑in successor to Pico CSS

1•anydigital•33m ago•0 comments

Speridlabs/Idol · Hugging Face

https://huggingface.co/speridlabs/idol
2•yukim198•36m ago•0 comments

Dartmouth's provost warned us about AI cheating–but his AI use cost him his job

https://arstechnica.com/tech-policy/2026/10/dartmouths-provost-warned-us-about-ai-cheating-but-hi...
1•poopcat•38m ago•0 comments

Programming Language Research by David Walker

https://dl.acm.org/doi/10.1145/2837614.2843896
1•efren6•42m ago•0 comments

Stolen AI API keys generated nearly $1M in charges for a single company

https://cloud.google.com/blog/topics/threat-intelligence/llmjacking-monetizing-compromised-cloud-...
4•khalidkhair•45m ago•2 comments

Audience Capture

https://www.seangoedecke.com/audience-capture/
1•gfysfm•47m ago•0 comments

Show HN: Flick – A sports scores app without spoilers

https://flick.kawaicheung.io/appstart.html
1•kiwigod17•50m ago•0 comments

What Are the US Midterms

https://www.bbc.com/news/articles/c6wyz223j19po
5•teleforce•50m ago•0 comments

Reading Is Not Steering: Symbol-Readers Concept-Controllers in SAE's

https://github.com/CharacterCraftAI/Gemma-SAE-Research
1•justinhernandez•52m ago•0 comments

Salesforce Signs Definitive Agreement to Acquire Cresta

https://www.salesforce.com/news/stories/salesforce-signs-definitive-agreement-to-acquire-cresta/?...
2•johnbatch•53m ago•0 comments