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 1tIX9f-00EvUN-PE for pgsql-general@arkaria.postgresql.org; Tue, 03 Dec 2024 17:57:47 +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 1tIX9c-00BeW8-Op for pgsql-general@arkaria.postgresql.org; Tue, 03 Dec 2024 17:57:45 +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 1tIX9c-00BeTT-CW for pgsql-general@lists.postgresql.org; Tue, 03 Dec 2024 17:57:45 +0000 Received: from mail-oi1-x22c.google.com ([2607:f8b0:4864:20::22c]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1tIX9Z-000rqj-HV for pgsql-general@lists.postgresql.org; Tue, 03 Dec 2024 17:57:44 +0000 Received: by mail-oi1-x22c.google.com with SMTP id 5614622812f47-3ea36b05654so2957838b6e.1 for ; Tue, 03 Dec 2024 09:57:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1733248660; x=1733853460; darn=lists.postgresql.org; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :from:to:cc:subject:date:message-id:reply-to; bh=aXg+I0SIx8Z51L44BmCuUfCKho9aqVZ8JJHoIjqVHGQ=; b=WScRILvjysOGoKvTn8ojEVJun5JZyc0HyvWoRLXGdHtauaoWxAjJx3f1qXKXubOXq4 S1RkU/lhhS2/FuXVHv1Ufl90OPwN9/8QSBp1u6eO10RKHr3fNrnixZeB+gq4eosLU5Ws 1R7Oq7mTfuK2MgEVznRYoU7Fe08GFfuCnBWm3RAaSIUThaQtMwWopDo5/rFdR4zmQdKh gXpL8ZOSmT0lgbtvOvFjf6WiKCNs+BD/6+Wmq8w/KQiToYekOhBK4NzSCMaxmE52tfAC jo6qYs7cUPlFM1a2XsCZBweMcE4mrPoFFTDLJ3nXVoXIdN81+NWXsNeZfDX+7JR+l4+F dcTQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733248660; x=1733853460; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=aXg+I0SIx8Z51L44BmCuUfCKho9aqVZ8JJHoIjqVHGQ=; b=povJB1eMe6JWnzuIFVfUADh07PAOt9/rWX9c7MSD7DLy+Vbcpj2YmWoqpUluOtowL/ XEiaUlbnrZjCy47MVbC1Jy1TnP560gaFn0Iv7XVO1E04WNVp7SALH7KjZB63aObIIAVq h6tljMU19SjJOxJ+I+SYDf984Es41sFuzjKq6hTSR3Uu62xAYXW+6aMXfNlKp0jnpzP1 z+ywNKDVT8+TuP6f4whWp4ZD4xQDXeyxZOp++MvA9bHHVoUSWrRSjMY7Uotv1FsJTzs2 CrGhDIZp2dVTFkuYjW1sXU4BAzN6MLjnIr+8J7xA4RPJ1qto+SYj1CUGbUlOO18g4qH8 6luA== X-Gm-Message-State: AOJu0YzOdI60nVtJ2xv8NRAC3XvephTAJttvOZbhvzncBrKe/oezdgmh uTkGQRUuOeexHrIvei0qP/c2yMktAwmOrIURw7hEL8OdYKn+1ZZygsXBbGijvuFhDl03hu6JvyS 4FtjNke5CBtOVBbHxDogdmreKoW1HLdLx X-Gm-Gg: ASbGnctxS6xRGRqlE6rMuEEn64xQlHEcxYgVqJb2tbiZHqdlSvAmLLBwOY1JCbdp0Xi 33p52RpcnAiDSBYTD6aemtzHz8YRiQrbihzsUTTHAvM7ayyuJuBLrcODVUUNx3ZsCHA== X-Google-Smtp-Source: AGHT+IFlpYeo9u7tgZuotD+p0oLpBsjdYmNyBTXKCXujMYB8qMu1kgL8wtZVf0WDtExGvihRbd9NL+jxWcUNzocvq0E= X-Received: by 2002:a05:6808:2385:b0:3e6:5b8c:d95a with SMTP id 5614622812f47-3eaf02ae42emr880555b6e.20.1733248659837; Tue, 03 Dec 2024 09:57:39 -0800 (PST) MIME-Version: 1.0 References: <341dd184-9096-4d1f-a74c-7db02cd1004c@aklaver.com> In-Reply-To: <341dd184-9096-4d1f-a74c-7db02cd1004c@aklaver.com> From: Ron Johnson Date: Tue, 3 Dec 2024 12:57:28 -0500 Message-ID: Subject: Re: Autovacuum and visibility maps To: "pgsql-general@lists.postgresql.org" Content-Type: multipart/alternative; boundary="000000000000ad5ad806286166aa" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --000000000000ad5ad806286166aa Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Tue, Dec 3, 2024 at 11:57=E2=80=AFAM Adrian Klaver wrote: [snip] > > I have to believe it is due to this: > > > https://www.postgresql.org/docs/current/routine-vacuuming.html#VACUUM-FOR= -SPACE-RECOVERY > > "If you have a table whose entire contents are deleted on a periodic > basis, consider doing it with TRUNCATE rather than using DELETE followed > by VACUUM. TRUNCATE removes the entire content of the table immediately, > without requiring a subsequent VACUUM or VACUUM FULL to reclaim the > now-unused disk space. The disadvantage is that strict MVCC semantics > are violated." > > Combined with this: > > > https://www.postgresql.org/docs/current/runtime-config-autovacuum.html#GU= C-AUTOVACUUM-VACUUM-INSERT-THRESHOLD > > "autovacuum_vacuum_threshold > > Specifies the minimum number of updated or deleted tuples needed to > trigger a VACUUM in any one table. ... > > " > > I'm going to say the TRUNCATE itself does not trigger an autovacuum. I > would suggest throwing a manual VACUUM in the table population script. > Shouldn't autovacuum_vacuum_insert_threshold kick off an autovacuum if you're doing a lot of inserts? --=20 Death to , and butter sauce. Don't boil me, I'm still alive. lobster! --000000000000ad5ad806286166aa Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Tue, Dec 3, 2024 at 11:57=E2=80=AFAM A= drian Klaver <adrian.klaver= @aklaver.com> wrote:
[snip]=C2= =A0

I have to believe it is due to this:

https://www.= postgresql.org/docs/current/routine-vacuuming.html#VACUUM-FOR-SPACE-RECOVER= Y

"If you have a table whose entire contents are deleted on a periodic <= br> basis, consider doing it with TRUNCATE rather than using DELETE followed by VACUUM. TRUNCATE removes the entire content of the table immediately, without requiring a subsequent VACUUM or VACUUM FULL to reclaim the
now-unused disk space. The disadvantage is that strict MVCC semantics
are violated."

Combined with this:

https://www.postgresql.org/docs/current/runtime-config-autovacuum.= html#GUC-AUTOVACUUM-VACUUM-INSERT-THRESHOLD

"autovacuum_vacuum_threshold

Specifies the minimum number of updated or deleted tuples needed to
trigger a VACUUM in any one table. ...

"

I'm going to say the TRUNCATE itself does not trigger an autovacuum. I =
would suggest throwing a manual VACUUM in the table population script.
<= /blockquote>

Shouldn't=C2=A0autovacuum_vacuum_insert_threshold=C2=A0kick off an= autovacuum if you're doing a lot of inserts?

--
Death to <Redacted>, and butte= r sauce.
Don't boil me, I'm still alive.
<Redac= ted> lobster!
--000000000000ad5ad806286166aa--