From 6b3c1cc4332ec4ff30184c00b0f5530aec9bf89b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Bombeck?= Date: Sun, 25 Oct 2026 10:54:50 +0100 Subject: [PATCH] docs(ops): gather planner statistics after restoring into the new major --- docs/ops/postgres-major-upgrade.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/docs/ops/postgres-major-upgrade.md b/docs/ops/postgres-major-upgrade.md index cfb9b9745..744213f28 100644 --- a/docs/ops/postgres-major-upgrade.md +++ b/docs/ops/postgres-major-upgrade.md @@ -62,7 +62,13 @@ docker compose ps db docker compose exec -T db pg_restore -U healthlog -d healthlog --no-owner \ < healthlog-pg16-.dump -# 7. Start the app (and app-worker, if you run it) and confirm it. +# 7. Gather the planner statistics. A restore brings the rows but not the +# statistics, and until autovacuum gets round to every table the planner +# guesses at their sizes, which can turn a sub-second page into one that +# takes many seconds. +docker compose exec -T db vacuumdb -U healthlog -d healthlog --analyze-in-stages + +# 8. Start the app (and app-worker, if you run it) and confirm it. docker compose up -d app curl -s http://localhost:3000/api/version ```