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 1uffnf-00AI7h-HT for pgsql-hackers@arkaria.postgresql.org; Sat, 26 Jul 2025 14:23:00 +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 1uffnd-009h0f-O3 for pgsql-hackers@arkaria.postgresql.org; Sat, 26 Jul 2025 14:22:58 +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 1uffnd-009h0X-Cn for pgsql-hackers@lists.postgresql.org; Sat, 26 Jul 2025 14:22:57 +0000 Received: from momjian.us ([72.94.173.45]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1uffna-000y6y-1A for pgsql-hackers@lists.postgresql.org; Sat, 26 Jul 2025 14:22:57 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=momjian.us; s=2025010100; h=In-Reply-To:Content-Transfer-Encoding:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-ID:Content-Description; bh=YZGjUT/jcuiNVwaIZdRXk1f4oORlqFt2nPgM7xRODtE=; b=MUrNs50OXZCPUQxogb9LGt+sq5 PXpT6tzH0lMah4Vj1jICMoPNWtmzxq1aVYnt7LaMxBH0s51z975o9JN7lmAocvQd4KNP0i0/tEvl4 hKZA1vknW4u9yo8EG6Ir+914mqU+b6tFHCxpT7w1AfPJDPi51DH0m4l3wRbqvuuZ2yvwMcHdLC7cZ 2qdljkZd+T+Oss56Cn+0hXoPWt8L1h9z0CiOljK1JMWRXEzg8rjzl52oGsvaBa81HwTjvlxpqQKrQ d/7BEluL6t28ag/3qo1jN4cuTg5G+As5D+gCuSzNfXZBzXJIZQCqTr47L9Qb1geMt2eA2UF5CxsTO RPUH6hFA==; Received: from bruce by momjian.us with local (Exim 4.96) (envelope-from ) id 1uffnV-00G9wG-1a; Sat, 26 Jul 2025 10:22:49 -0400 Date: Sat, 26 Jul 2025 10:22:49 -0400 From: Bruce Momjian To: =?utf-8?B?RnLDqWTDqXJpYw==?= Yhuel Cc: Nathan Bossart , Corey Huinker , John Naylor , Masahiko Sawada , Jeff Davis , jian he , Matthias van de Meent , Tom Lane , Magnus Hagander , Stephen Frost , Ashutosh Bapat , Peter Smith , PostgreSQL Hackers , alvherre@alvh.no-ip.org Subject: Re: vacuumdb changes for stats import/export Message-ID: References: <4b94ca16-7a6d-4581-b2aa-4ea79dbc082a@dalibo.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <4b94ca16-7a6d-4581-b2aa-4ea79dbc082a@dalibo.com> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Wed, Jul 23, 2025 at 02:45:10PM +0200, Frédéric Yhuel wrote: > > > On 3/18/25 22:37, Nathan Bossart wrote: > > Committed with the following small changes: > > Hi, I don't really understand this sentence in > doc/src/sgml/ref/vacuumdb.sgml: > > > This option prevents vacuumdb from deleting existing statistics so that > the query optimizer's choices do not become transiently worse. > > I thought that the point was to avoid unnecessary post-upgrade analyzes? So, the full paragraph is: + Only analyze relations that are missing statistics for a column, index + expression, or extended statistics object. This option prevents + vacuumdb from deleting existing statistics + so that the query optimizer's choices do not become transiently worse. What it is trying to say is that if you run vacuumedb without this option, not only will it analyze all tables, including ones that already have statistics, but will drop statistics on this tables that already have statistics for a brief period while it installs new statistics. During that period, the optimizer will not have any statistics for the table. Is there a clearer way to state this? -- Bruce Momjian https://momjian.us EDB https://enterprisedb.com Do not let urgent matters crowd out time for investment in the future.