Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1u7afW-002AnR-Ft for pgsql-hackers@arkaria.postgresql.org; Wed, 23 Apr 2025 14:01:42 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1u7afU-006fZ9-K0 for pgsql-hackers@arkaria.postgresql.org; Wed, 23 Apr 2025 14:01:41 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1u7afU-006fXs-9Z for pgsql-hackers@lists.postgresql.org; Wed, 23 Apr 2025 14:01:41 +0000 Received: from mout-p-201.mailbox.org ([80.241.56.171]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1u7afQ-001btU-2i for pgsql-hackers@lists.postgresql.org; Wed, 23 Apr 2025 14:01:40 +0000 Received: from smtp2.mailbox.org (smtp2.mailbox.org [IPv6:2001:67c:2050:b231:465::2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-201.mailbox.org (Postfix) with ESMTPS id 4ZjLPW05Gdz9tKM; Wed, 23 Apr 2025 16:01:35 +0200 (CEST) Date: Wed, 23 Apr 2025 16:01:33 +0200 From: Christoph Berg To: Nathan Bossart , Corey Huinker Cc: pgsql-hackers@lists.postgresql.org Subject: vacuumdb --missing-stats-only and pg_upgrade from PG13 Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Rspamd-Queue-Id: 4ZjLPW05Gdz9tKM List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Re: To Nathan Bossart > > Update guidance for running vacuumdb after pg_upgrade. > > > > Now that pg_upgrade can carry over most optimizer statistics, we > > should recommend using vacuumdb's new --missing-stats-only option > > to only analyze relations that are missing statistics. > > I've been looking at vacuumdb --missing-stats-only because Debian's > pg_upgradecluster is using that now. The reason I was looking closely yesterday is because Debian's regression tests were tripping over it, but I only figured out the problem today: If I create a table in a PG13-or-earlier cluster, never ANALYZE it, and then pg_upgrade to 18 and run vacuumdb --analyze-only --missing-stats-only, the table will not get analyzed. The only table visited there is pg_largeobject. Upgrades from 14..17 are fine. Christoph