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 1tkTib-004M74-3S for pgsql-hackers@arkaria.postgresql.org; Tue, 18 Feb 2025 19:57:21 +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 1tkTha-000NPo-Q0 for pgsql-hackers@arkaria.postgresql.org; Tue, 18 Feb 2025 19:56:18 +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 1tkTha-000NPf-FM for pgsql-hackers@lists.postgresql.org; Tue, 18 Feb 2025 19:56:18 +0000 Received: from mail-il1-x133.google.com ([2607:f8b0:4864:20::133]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1tkThX-001cgC-37 for pgsql-hackers@postgresql.org; Tue, 18 Feb 2025 19:56:18 +0000 Received: by mail-il1-x133.google.com with SMTP id e9e14a558f8ab-3d19f5ce8a0so486365ab.1 for ; Tue, 18 Feb 2025 11:56:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1739908573; x=1740513373; darn=postgresql.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=acXp18qJD7saPHkmcNcMX357LcBvbjxRaWrN9jJdRtM=; b=C5lbqWfXNQfsWRjFg6aD9AP7X9CB6Ot+3zNP0gCWgZg+7lqZFKhY9lJsiH4ZBXCMMj 6gQLJljDyxn1gtD8atikPg2XkV4OBKlCsAuYv/2dBAZ+TZQbP2brAzHyZV6cKaI8hgrI ZrwkEF9wyvwhd8w47djbn+V2oxA1vJ8XLETu7lKFwC0AG9l7R1ZneU7SWf5Np7IQ1K/e pDKrFqzYiYjX6dZ9X25aOh5+WylTmR7wfcW1dBa6FwTyJSzMoq6yd6kbCHfmmYEyocv7 OFDQ/kdvzrHgG5McI8TQKFqrMMHeehyNj5lTBf13fZjqmi0avxo1BLm4Tug1/HLQzIxJ Jzvg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1739908573; x=1740513373; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=acXp18qJD7saPHkmcNcMX357LcBvbjxRaWrN9jJdRtM=; b=trl+ceUMQHke9tzecWYsDTVVij4+7kh5dbq67l8x3tEglPp7Pt4I0p1Ec+dkBMt03j 3dOA6ciN1boSedB+XhBXplmvJaotTL+mtsOeZPU2E9ZHZ0/Yh/imI8uhPrlSkfz2tiHt tQKSvjQ92MLQCtXjYrWNZVPUfshcr8g/Jm4+oJggsG54vivTqWbWjMH0VDNMBaZFfKq+ jfH+ZGR8VApHIkouanTFN0/Ke7CUZdNF7oi1j+2dB6kjLaeplMVtEYKzFkRHJqYGCaD/ TBOdH0k/KaKMO6qoj/KcfIhHK6ntkYrTCAdAJ9AtnGSbMBVigHXrWurYLsxhR5fz0kI5 cTdw== X-Forwarded-Encrypted: i=1; AJvYcCWPfq71yEIMnh2S3x4LmNr5X43m3bzWaDTQCfSMG4pkUPsZ8KFP5TUWDJLkSzcCRe1oLLJ8LfD+gXYbIzE2@postgresql.org X-Gm-Message-State: AOJu0YwwS24iiwa24ZhqpWbMG/ygwWRJ8f+3EtBBCirRADBLZOc9x/td pCuGSZW5oiVcwo5UhtTP96b3+FIhwce5tEGdssJqXcFaJzk+fXu9 X-Gm-Gg: ASbGnctW6Gkms5KtCV/VUQ8CW5O/HZicbexElNIxORBl0ec7+n+HAVxBRJZq3YheKzM JB3zs0O4BWIwmbz9shE0SysdBWvjJh5+L1sL6WtEMRwzaFwjeUNYYUIQ4sq1AEQ3ZsXOMxzbqFj gm45eNA4nKqkXA7EEtyg/8qIj1F133w5QIbr+JxN/u3tn0nOQWBIUK/9HqbCqAhjevEbWPIAmAA BQQQ77yJhsxWeKkCMB2GNjVcPSwczsX8i+cL2U7RDQ8Z+W4g+viV1s/4AXkhHWmxkWi9/qszXrA 5QZdCb92T+YLewqOS0XvuDfmyh6Xw3BR9+zW9t+PiTfbE0DVzQZ0mVu1z4TZ1JH7SXMHr4TAygg mV4UbDQ== X-Google-Smtp-Source: AGHT+IEb4dgKY/xjeXkTYuTpJJiD97o396JSONzUt3i2uhyE/W+fvz/EW0/tsAaL4AA7MegdkPlRcw== X-Received: by 2002:a92:c8c4:0:b0:3d1:9bca:cf28 with SMTP id e9e14a558f8ab-3d2b4ba787emr10098425ab.8.1739908573080; Tue, 18 Feb 2025 11:56:13 -0800 (PST) Received: from nathan (162-195-168-172.lightspeed.stlsmo.sbcglobal.net. [162.195.168.172]) by smtp.gmail.com with ESMTPSA id 8926c6da1cb9f-4ee8b86d9d0sm1568884173.136.2025.02.18.11.56.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 18 Feb 2025 11:56:11 -0800 (PST) Date: Tue, 18 Feb 2025 13:56:09 -0600 From: Nathan Bossart To: Robert Haas Cc: Laurenz Albe , Gurjeet Singh , Postgres Hackers , Will Storey Subject: Re: Disabling vacuum truncate for autovacuum Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Mon, Jan 27, 2025 at 03:38:39PM -0500, Robert Haas wrote: > Also, how sure are we that turning this off globally is a solid idea? > Off-hand, it doesn't sound that bad: there are probably situations in > which autovacuum never truncates anything anyway just because the tail > blocks of the relations always contain at least 1 tuple. But we should > be careful not to add a setting that is far more likely to get people > into trouble than to get them out of it. It would be good to hear what > other people think about the risk vs. reward tradeoff in this case. My first reaction is that a global setting is probably fine most of the time. I'm sure it's possible to get into bad situations if you try hard enough, but that's not a unique characteristic. There are probably many situations where the truncation is wasted effort because we'll just end up extending the relation shortly afterwards, anyway. In any case, it's already possible to achieve $SUBJECT with a trivial script that sets storage parameters on all tables, so IMHO it would be silly to withhold a global setting that does the same thing just on principle. Of course, ideally we'd "fix" truncation on standbys, but that's at least v19 work at this point, and past discussion from many years ago [0] leads me to believe it's a difficult problem. That's not to say we should shy away from difficult problems... [0] https://postgr.es/m/flat/CAHGQGwE5UqFqSq1%3DkV3QtTUtXphTdyHA-8rAj4A%3DY%2Be4kyp3BQ%40mail.gmail.com -- nathan