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.96) (envelope-from ) id 1w8zZJ-0015zZ-34 for pgsql-hackers@arkaria.postgresql.org; Sat, 04 Apr 2026 11:53:38 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1w8zZG-00G7PK-2p for pgsql-hackers@arkaria.postgresql.org; Sat, 04 Apr 2026 11:53:35 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1w8zZG-00G7P3-1q for pgsql-hackers@lists.postgresql.org; Sat, 04 Apr 2026 11:53:34 +0000 Received: from mail-yw1-x1135.google.com ([2607:f8b0:4864:20::1135]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1w8zZE-00000000Vyv-3rXn for pgsql-hackers@postgresql.org; Sat, 04 Apr 2026 11:53:33 +0000 Received: by mail-yw1-x1135.google.com with SMTP id 00721157ae682-79a60975dc5so24483407b3.0 for ; Sat, 04 Apr 2026 04:53:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1775303612; cv=none; d=google.com; s=arc-20240605; b=Wg2i1d7VYweUbpXsgMxmW5RWan7bQj7rWwxEsf8Mib1VSVSgmXkd6dKhncwi4qTZK9 dPRAvxxrw3WZ67XjWpXPtBdPYnQaKen57IAZ3I6hIjnoE7LaTSeHYZdyKuQGaIYDiNCC ijUS3ecPvoIdN0mIiLGmAtS9XuBuHqPFzaMlopFP33325nfnrOEU8OKapEAglsxUo1Y1 XI8f7MeAhksylk+7l8RMT7R6J9eMoVyI6IC1NKG2Nr1r+TdrSzt80PagnLcz7wofAtak QDwMcHl0hD1jepuyfeKYo7w0WTD9RK9qelM0ldo7VlbQ8/yT3l9iOeh/rkJHsdPDLw89 HrmQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=pYbDGqiOzGz6B1IfCmd3MjAK8y2t7Q5nJRiOtXesuvU=; fh=1FYET0vHiXuvj60mKhDRbBhEtXrm2f/0MbiHw5IghHE=; b=TKYQ+3E4SgZlhzTepMw+bTvtwsN0ItJ7SmZzz9g/ZZEW8PdR5nZAmk10T/Jf/kj7FH tP6bRRkIj/P+3X/p/2x9R2Ib+1Y7lQUxXohYsSivKjRUgUtS32arK0+emfBVUZ6xs16f v7jJoUKf6bOF/5f+hEqPURSwcnUk8qsiXb/WAumfBKw68UpH1kiR481O5wKcMtKNBnzC 7nP/V2cjteXZd/mUllSvKxIBPOahuJwfbtGR6oRYerlhaSxn6gnp1KLcfJElAVLTU1Fn nE/VmQsjKs1V1eoukYsFv9EhwIAi2BSQHn704L+SuLBLZFTVM8+2MeEiNWvjYt2wRpyV N4og==; darn=postgresql.org ARC-Authentication-Results: i=1; mx.google.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xzilla-net.20251104.gappssmtp.com; s=20251104; t=1775303612; x=1775908412; darn=postgresql.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=pYbDGqiOzGz6B1IfCmd3MjAK8y2t7Q5nJRiOtXesuvU=; b=fDQLXm2HKmi8tN5/ICu+0cW1U1QOcAVIfnHrXTmC2bG2LjnOasjBUmZMBYhO+LLq2Q d2s+D2xzkWIukTe+QfrKGzhdmJmP42+atZAx4P4o1oSTbvRHIqpk8m/KaZtqMVHS6JSW kFJf457FLpfphOjSxKBaLQYFcZ8gqiCmCBVTUd4rkpNIqHh5VyoomK/BARxR9AKvGfXS LAW19qK7++R9oy+Q245+bhrzh00l3D63zmUK4mSYu4NMY77m3AsJTjpiKI88ZeAaHn/8 EXQ4BIW7bIfk9RXkfaIbyoO3h9xT7nUJ62FZRTauuh6iVV6gMy37V7XMjoVzSxxK6dll WsLQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1775303612; x=1775908412; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=pYbDGqiOzGz6B1IfCmd3MjAK8y2t7Q5nJRiOtXesuvU=; b=GqwRkso6Cc1QR0T8k+jz9XuB62Aozfw1vO9BCOFW3nie74QJBYrD9LqjBLjRvwUrLA 0+xHRHAaLzW0qzFizVhjMLw02GPr2z3k1acnbQvcDsW6pbUjW9J0R2N/d5jztfxBWYGK X9UkOBFXwf4vxmz62Ul+NNRWaya4ajpHZS2mdLHklg2e7GBApVZuGQ6F4lAd99Os9ac2 gjoGmx1PI3IQLVcHOVoF09JwDhWPqgiDTCeM3bA6uLDBFhmUYj/juPPjUOYoIpBZ5ZaS xJpx63H+YbwEspE5g7LsmVSsEVjLNLD0gJZhg243cKNmF6i0gjGVYOEft0S06qYOGzGw y/ew== X-Forwarded-Encrypted: i=1; AJvYcCVIkebVpx9BUa5JUhd+JpjQTw4xkgTjJntUw54zHGCHCDqbkkx3KlPeJYJhvKF3sk57AsIwR1wkupk4Q4ga@postgresql.org X-Gm-Message-State: AOJu0YwvIGCIDvXPnCaCNo+OUgEpPifa7ARixIOisoFoKDQ/O4RSENpO Gs0S6F5LprizA80o9kvFO8zu2tjhMZ0kPRgLtbQRhEEJTvbKS8hCk7dPJc34A7InNfWETdOH8uN kiJuJzC4wIuGG43UW1WSDfYfi34Kx82gqxseA//RO7Q== X-Gm-Gg: AeBDieutdIv30oNNimeDjwhidfsi3rohd7Rs+m6HOgSN7UFHT6Gnvl0ZFWx77LcAI0z F311Ua6+rQwnAekNe5zcykGuNXfzK8f0YH/S+a+wLacLAe20ArCRAT1B8RmW41M3wSqfguRsj/H IoZJ9JQAKB9k7eQjioEUrqKKxV+npXYjx7rXsmGxzzYPjcDvL8O8Zj8YVS7hQrnhzNxCCE6fByZ 8ZRPcm31QFaTZlhtJGEEB+st0oIEVqV76Q+XQJGVXgQexdr6aYBOyuQc1TPVmCV0wlRBBU3TZ+X p82zFtw= X-Received: by 2002:a05:690c:c50e:b0:79c:1984:3114 with SMTP id 00721157ae682-7a4d38ccdf6mr64175257b3.13.1775303612245; Sat, 04 Apr 2026 04:53:32 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Robert Treat Date: Sat, 4 Apr 2026 07:53:21 -0400 X-Gm-Features: AQROBzBwiqyS5ywKShnDhTkdj6Ao0hEzJOsGsKlOJJHbE-hAqEyvKAe7PfnRzYA Message-ID: Subject: Re: remove autoanalyze corner case To: Nathan Bossart Cc: Sami Imseih , Bharath Rupireddy , satyanarlapuram@gmail.com, pgsql-hackers Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Fri, Apr 3, 2026 at 10:55=E2=80=AFPM Nathan Bossart wrote: > > (new thread from [0]) > > On Fri, Apr 03, 2026 at 02:13:16PM -0500, Sami Imseih wrote: > >> * I noticed that if autovacuum decides to force a vacuum for > >> anti-wraparound purposes, it might also decide to analyze the table ev= en if > >> autovacuum is disabled for it. AFAICT this is accidental, but since i= t's > >> behaved this way since commit 48188e1621 (2006) [0], I am slightly wor= ried > >> that this bug may have become a feature. In 0002, I separated this ed= ge > >> case in the code and added a comment, and I intend to start a new thre= ad > >> about removing it. > > > > hmm yeah, I think this just needs to be documented clearly. I always > > thought it was expected for auto-analyze to run in this case, and I don= 't > > see why it shouldn't. If this needs to be clarified in docs, we should > > do that in a separate discussion. > > Well, autoanalyze only runs in this case if autovacuum is disabled via th= e > table's autovacuum_enabled reloption and _not_ disabled via the autovacuu= m > or track_counts GUCs. I think this is pretty clearly unintentional, as I > can find no mention in the code, archives, or docs. And unless I'm missi= ng > something, it's completely unnecessary. So IMHO we should just remove it= . > > [0] https://postgr.es/m/CAA5RZ0sCRjH3xkHFdSXnKysdMZXFyaS_094%2BK-O_rr4Fkm= wc%3DQ%40mail.gmail.com > AFAICS, near misses on wraparound in and of itself have no correlation with statistical changes in your data, so I'd agree it isn't necessary, and the fact that it behaves differently in this more narrow case than it would in the more general case, when these two cases are (as far as I've ever known) supposed to behave the same way, I'd be +1 to remove this. Robert Treat https://xzilla.net