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 1mza0v-0002UM-La for pgsql-hackers@arkaria.postgresql.org; Tue, 21 Dec 2021 07:56:49 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mza0u-0003fx-Bc for pgsql-hackers@arkaria.postgresql.org; Tue, 21 Dec 2021 07:56:48 +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 1mza0u-0003fo-0v for pgsql-hackers@lists.postgresql.org; Tue, 21 Dec 2021 07:56:48 +0000 Received: from mail-pj1-x1031.google.com ([2607:f8b0:4864:20::1031]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1mza0r-0002wV-Eb for pgsql-hackers@lists.postgresql.org; Tue, 21 Dec 2021 07:56:46 +0000 Received: by mail-pj1-x1031.google.com with SMTP id v13-20020a17090a088d00b001b0e3a74cf7so1497645pjc.1 for ; Mon, 20 Dec 2021 23:56:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=I+avo/6p8e+iQrgfVRUCDS21aR37adMEeM1dkzLFwH8=; b=HB5iPcimkvUX0bqr9/xF3QKM5Yltno267Mb/7+ZXu9miHmcjXCbqZfurSgYX269/J4 deIwIfbZ8ZON2L4ekf2yFEjv3ot5KFV/2wZILnrkMwyVFKVkv5M04FgrUueO3gHr8LhI 9zu8yofy/gSYLsbFaFTO01PkKhIwGLv0at/uk+J5Kw8gKlvQAKdp2N8NeyGQiXciVWby fXgrjJouuSy3WtH99An4x8GPS5I6xtxm3RbMU0FCmvb1jXF75h+PGGcyQdBiWSoMaDYH p8ie6j5nEcPIrTzh6Iw5bXZTG1C+m+gUOHUdXnHjli+xQBRs/Cxw5hB+sJM3pHJWYrHX MJ9Q== 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=I+avo/6p8e+iQrgfVRUCDS21aR37adMEeM1dkzLFwH8=; b=MWMh67KIJH7Hq9Mfr1/0qTetkRr4BvSdK08AyfP8KMuR80Oo6B9aq2CdXeYvgwqcSd 0BeMzncBC0oQwPFhtsORM9yQVp0aKDnVF3m9s2rAIvCuEcnKy1/vC6Y44ngJu9VmdT3E aiVowZtF2ThXogE6ty0p+TicyFulcbw5z9XUdapwXUScXLZLHUHC4ehwZSXUb73r2bED xCBT4lT9EKa4/6GFxCEle1EieSS3tVntJ6YQjhDPARQTVS6g+5Gnkay43AWLEZYMBGV9 d2i02xD7BdeFahNXHPFNUduMyBQdMiTu79FSmIuG1L6T4VYkzmLPDlvbsukrT1ecLz1Q HkNw== X-Gm-Message-State: AOAM5323p7E0GhF8rbTWk9FarGysScwjqx0COVN8ztIUmyJyd0hvdUCB jgTGxDdE9SofvQFUVTjU7QilvuomN+pVYla4eEM= X-Google-Smtp-Source: ABdhPJweYk+w9VeFx5QgVA8s9/k5Q5I4xdBpZw80IopIE4Ju1+By74q8HOfDA7aGtL0jL34VUWvuc+e8Mhj8ngjKCsM= X-Received: by 2002:a17:902:cec4:b0:149:346b:cb8b with SMTP id d4-20020a170902cec400b00149346bcb8bmr1711955plg.87.1640073404131; Mon, 20 Dec 2021 23:56:44 -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: Masahiko Sawada Date: Tue, 21 Dec 2021 16:56:07 +0900 Message-ID: Subject: Re: do only critical work during single-user vacuum? To: Peter Geoghegan 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 Tue, Dec 21, 2021 at 1:53 PM Peter Geoghegan wrote: > > 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. I understand the patch, thank you for the explanation! I remember Simon proposed a VACUUM command option[1], called FAST_FREEZE, to turn off index cleanup and heap truncation. Now that we have failsafe mechanism probably we can have a VACUUM command option to turn on failsafe mode instead. Regards, [1] https://commitfest.postgresql.org/32/2908/ -- Masahiko Sawada EDB: https://www.enterprisedb.com/