Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mzX9C-0004Yd-O4 for pgsql-hackers@arkaria.postgresql.org; Tue, 21 Dec 2021 04:53:10 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mzX9B-0003W6-IL for pgsql-hackers@arkaria.postgresql.org; Tue, 21 Dec 2021 04:53:09 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mzX9B-0003Td-5l for pgsql-hackers@lists.postgresql.org; Tue, 21 Dec 2021 04:53:09 +0000 Received: from mail-ed1-x534.google.com ([2a00:1450:4864:20::534]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1mzX98-0001SQ-Du for pgsql-hackers@lists.postgresql.org; Tue, 21 Dec 2021 04:53:08 +0000 Received: by mail-ed1-x534.google.com with SMTP id w16so18623496edc.11 for ; Mon, 20 Dec 2021 20:53:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bowt-ie.20210112.gappssmtp.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=eTg1hCke/FdWcCwGYLW1uFpTXOlX7CDY9KjRYr9FpeI=; b=xKSgkSn7YwRKdp6JOZlTCPB1g6KsgRfDgIzGV3askBJOdPobo9LvdArsPvwt8H1yoZ 31saC/FIDvvOw+NGwpev407kT/vT+x/X965M4fAIoHwRpsKujAUlCahCd0SiQbNvPoCn FbNHD1e8yUeJtYWjtbQv6VGb2lKsY5fkVvmZb9Dq1K580v+iye9UDkmqEwWKIaouxfUH dlKN/mTX5/mHO0A201L0WaKri9kyNXXLFB5HlNUhEzenSfcVO9yjw30sM8ZqWgXh5zlo hpq/Cfa6g/M09gl/ER4M3h1nlElZGsFP91+q1/zBaEcBe12AX/oFfndfxccXrAyWcKN+ nXIg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=eTg1hCke/FdWcCwGYLW1uFpTXOlX7CDY9KjRYr9FpeI=; b=qyfV2VyCFzDEO3uxIdQAGHHtdjZMz8Jm16CoS+VXloaVLnEhZk6DbJjc6Lj9cV7u1t /NwUmTPwxuZ0hdPukmu5nziYIaYNtN7SkwknS0lOPWCwmT4kox4uvkMlEEpGri/kvLFw mXUxBbWqTJl3BQy/y7bmQKJn4S4V/K840NxqG7pXgufwz1/SISM0ZN+TJao7i/ll9AcC 6zARqwk0uG7IeMQ6qAX5PTbVoqDxMq9elfhESAskZf76mEne6hOmjoM/BIetynfeiySY b6FYyeM+V+n55X+q2wuSwdS16acrHEF4JT9RUBo4+luqYMnNNNXLjZ9tw+QYrHHZfRQY LPWg== X-Gm-Message-State: AOAM533NRK15TYMNFpqiGDX4PTnDfvxpCzfq5HDBKQfoxFIs+UJ6ccEQ y18KOG1XeOvogEV+GCh59QWXMUdzqDb0uqcUYpYBVg== X-Google-Smtp-Source: ABdhPJz+d9L64hr7u2eakeZ9XDi0GF+GCHDS16CfTcdcNTJSJWeFEj1p2C3ujcoOLpk8vlVmfcGhlovy2jt64RrhQHU= X-Received: by 2002:a05:6402:908:: with SMTP id g8mr1505006edz.59.1640062384979; Mon, 20 Dec 2021 20:53:04 -0800 (PST) MIME-Version: 1.0 References: <3F7FD826-36EF-4991-AB37-81675AFEBF54@amazon.com> <0544901A-0FC5-46B5-801B-F30AC0B81A19@amazon.com> <20211221034630.maoteglpjqpgh62g@alap3.anarazel.de> In-Reply-To: From: Peter Geoghegan Date: Mon, 20 Dec 2021 20:52:39 -0800 Message-ID: Subject: Re: do only critical work during single-user vacuum? To: Masahiko Sawada Cc: Andres Freund , "Bossart, Nathan" , John Naylor , PostgreSQL Hackers Content-Type: text/plain; charset="UTF-8" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Mon, Dec 20, 2021 at 8:40 PM Masahiko Sawada wrote: > BTW a vacuum automatically enters failsafe mode under the situation > where the user has to run a vacuum in the single-user mode, right? Only for the table that had the problem. Maybe there are no other tables that a database level "VACUUM" will need to spend much time on, or maybe there are, and they will make it take much much longer (it all depends). The goal of the patch is to make sure that when we're in single user mode, we'll consistently trigger the failsafe, for every VACUUM against every table -- not just the table (or tables) whose relfrozenxid is very old. That's still naive, but much less naive than simply telling users to VACUUM the whole database in single user mode while vacuuming indexes, etc. -- Peter Geoghegan