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 1w8rAc-000wnm-2u for pgsql-hackers@arkaria.postgresql.org; Sat, 04 Apr 2026 02:55:35 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1w8rAb-00F8o5-1D for pgsql-hackers@arkaria.postgresql.org; Sat, 04 Apr 2026 02:55:33 +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.96) (envelope-from ) id 1w8rAb-00F8no-0I for pgsql-hackers@lists.postgresql.org; Sat, 04 Apr 2026 02:55:33 +0000 Received: from mail-ot1-x32c.google.com ([2607:f8b0:4864:20::32c]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1w8rAY-00000000UDX-24Na for pgsql-hackers@postgresql.org; Sat, 04 Apr 2026 02:55:32 +0000 Received: by mail-ot1-x32c.google.com with SMTP id 46e09a7af769-7d9bba96f7dso1202873a34.1 for ; Fri, 03 Apr 2026 19:55:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1775271328; x=1775876128; darn=postgresql.org; h=content-disposition:mime-version:message-id:subject:cc:to:from:date :from:to:cc:subject:date:message-id:reply-to; bh=886jhW0XrfsL/mHqBcmwVnVpIJOm2rAhlsCccGgHVC4=; b=siuUcPDoqzF+X0738PNGX9OtaamIFZFiNhALrbPj9b3YtettRyfzLzPzFjxCqpWCgD nLg7rsY+aQQGOmuw8GK+LbMTAL9PM1RVWS/ybIHHp+fVBHPIqgrgIhm/CKlOX/VrdkGK bdT15vPs6EYhwOt3dOtqEmovwZCRXHZiSD3dVs+4uylfDtCps79h0U0qjplsloKnwQcX 27nsS0QeHK7/nIbxr7BzZDhmTrTra86pvPA241SQzLsmK4mljpQ/b2b7MzELKp0pX8Yq XD5mHN8Bx4Rk4g5KUvbGPkUv0bAZ3BkgIOwmNPDJcNGM1rXoYX/R+t1WNY1uWh6Tv82V EF5w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1775271328; x=1775876128; h=content-disposition:mime-version:message-id:subject:cc:to:from:date :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=886jhW0XrfsL/mHqBcmwVnVpIJOm2rAhlsCccGgHVC4=; b=S+WIS+ITyCqsRjxbowqAMzlq5VA7IaV6gv4dMqT9Cu5ZfaVrWtOetXNflBU0Pu6ZOz EIzyuaN2GfIBpCv8L+YvETFUbVHyhfE0kKCJwXt8ui72XKv5mzCkbVfCcBulw+7bEjoP RVD8Nv1WnGzNYt3p3sXpaMZCobztHzP8ZEEBv0NDxkmB9jzPCseBpLz4agbOil1rvBit yb5P/12cdHA+bIcpTULwNx3thLJKdHgmWQ3gq6HBcmWV7upWORh8cUAT7Pqaff5p2qd3 OsR2M4dke3+3FZg+BLQEv6aM4wdRYgav/VdxMzv8SfPZQ+8M4yIzVNKB/mj1m4xbPQHv PqIg== X-Forwarded-Encrypted: i=1; AJvYcCWBqE3bHyV6UtmyytFM4k4cTnklw+d5QmJrLolrKLs2MNliIwx23nRvKrozaiL4qSIHnluDp9YJGgeEqeHH@postgresql.org X-Gm-Message-State: AOJu0YxCoaba15mTOPVV3Hy83Q+zwO8vPE6dMtbNePmvXvRmDbEO+raN oKVKKUsWHNBOkteii97H83+LPXgK6dwFgUb6js8bLk7rLX2ockqFprqo X-Gm-Gg: ATEYQzzDDGdLKVfZyR4XoWdZXyVofAtLYFBINtw3axP4ljC5dMyTVwDtZsbL864VFCX noyuTE3/Ora5Bze0r2ohlIPjnuKlxvhwLnnuLxFrB7GiKWSYbjbHuHmnzjL01IkhGj74O1v0tHg DNJsu2GLklOyLPT/dT/jE9agdqOVMdz5MMgubm4FLcQ+qVgOVavHuzbu1d1KQOSbrWVfiiU/f9p UAf3+aAKQBG2FXrloqtS7dVnglSwTAJJZZwAui7l1nlcS15BEZpYuuwhfVjzQMoUZbukYs5QBr+ iR2hceATINdwiE18YOxhwQB8Ef3kp6IMYsNbcS92EEQn+QHPhaPGfYYeNX5hx4rpqEMYzk0H8vt RyVUE10R32FxQKgv0j4vMR/VTMN/2ah+UIxV55RfHHkReAe0U2ZMssbsgNB6vd365n+Aus3nHbL jLuchmKEcdu9V6SGXEzuSXge17aGf+Y+OzueWdlZ5ymBlotHHaSYPeQs2W+XPNM01hPK7A5eOXY IZ9dPx4BKz2i7aR1bniiw== X-Received: by 2002:a05:6830:6acd:b0:7d7:e245:d5ad with SMTP id 46e09a7af769-7dbb7112edfmr3275202a34.16.1775271328567; Fri, 03 Apr 2026 19:55:28 -0700 (PDT) Received: from nathan (162-195-168-172.lightspeed.stlsmo.sbcglobal.net. [162.195.168.172]) by smtp.gmail.com with ESMTPSA id 46e09a7af769-7dba7126322sm5669998a34.3.2026.04.03.19.55.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Apr 2026 19:55:28 -0700 (PDT) Date: Fri, 3 Apr 2026 21:55:25 -0500 From: Nathan Bossart To: Sami Imseih Cc: Bharath Rupireddy , Robert Treat , satyanarlapuram@gmail.com, pgsql-hackers Subject: remove autoanalyze corner case Message-ID: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="7UU721Dt33Uo3+cq" Content-Disposition: inline List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --7UU721Dt33Uo3+cq Content-Type: text/plain; charset=us-ascii Content-Disposition: inline (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 even if >> autovacuum is disabled for it. AFAICT this is accidental, but since it's >> behaved this way since commit 48188e1621 (2006) [0], I am slightly worried >> that this bug may have become a feature. In 0002, I separated this edge >> case in the code and added a comment, and I intend to start a new thread >> 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 the table's autovacuum_enabled reloption and _not_ disabled via the autovacuum 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 missing something, it's completely unnecessary. So IMHO we should just remove it. [0] https://postgr.es/m/CAA5RZ0sCRjH3xkHFdSXnKysdMZXFyaS_094%2BK-O_rr4Fkmwc%3DQ%40mail.gmail.com -- nathan --7UU721Dt33Uo3+cq Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v1-0001-remove-autoanalyze-corner-case.patch