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 1mvP5r-0006Kq-7y for pgsql-hackers@arkaria.postgresql.org; Thu, 09 Dec 2021 19:28:39 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mvP5p-0005jb-Qv for pgsql-hackers@arkaria.postgresql.org; Thu, 09 Dec 2021 19:28:37 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mvP5p-0005jS-71 for pgsql-hackers@lists.postgresql.org; Thu, 09 Dec 2021 19:28:37 +0000 Received: from mail-ot1-x330.google.com ([2607:f8b0:4864:20::330]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1mvP5l-0002ur-2E for pgsql-hackers@lists.postgresql.org; Thu, 09 Dec 2021 19:28:36 +0000 Received: by mail-ot1-x330.google.com with SMTP id n104-20020a9d2071000000b005799790cf0bso7308194ota.5 for ; Thu, 09 Dec 2021 11:28:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=enterprisedb.com; s=google; h=mime-version:from:date:message-id:subject:to; bh=kE+H1lfLeEKFQOcyhV6yhH2T74A9iuUzCVkYFTQ4LXI=; b=SwKx3XlsOzyuoagTFVewo3iOo8b0i8exNTSQMafHtlx/5J0SgIp6bG0AZ4TNIPiBrV 2jWD4PZojcPtAJi8PpsjlWM6SUuFmDFQbUBHb4+GI5YrwtlUbIk/w02+VJWtdh5xVF7N LcOp4SQGrtXyqs3O/el550YDySIkwW2sgtCHKy4JEcpwSzQB+n2VkYxshrSKMDGJmu8A FYkLNOC+hNGJxCofbDcYdjLp+vXAWUAUENjS4dbJfRCQNW5wC6Vg/O/bM7ke4HzV9qP8 3/KWtPBnEZAlf+7535GdBCOlmPVJH52hKluscXdUG1/56YkEyAIE7oq31mSM/cOrUqvZ O9Zw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=kE+H1lfLeEKFQOcyhV6yhH2T74A9iuUzCVkYFTQ4LXI=; b=mz7iqiV04WpWRCdH5Ew1P/iDhu7aOVjYXHXUqKATsi10LZ/dsZTXcc3wvwwDt90j/b sbvGShtY7aDT4+Rop4yuaHCSPRr5BfOlImAgt64QLiJVTnhBzPiHueUPu+JTjWdFko/9 LQpWpyHdUpA4m+kJ7f4rfFyHSAuUHBD1EERc6Pa38CBfYTM/XkQgWDM6cuKWjJsl6wRn vPNDlb8fMcvr5oNpHUOV1jTHHaJS4elxZQIQRupTOrk7vsrSVPHKAITe7x/RWXvwCF12 spSVkD0ZEbvo4mM0D6J54bg1Pj354HHr4Z/ywGlGP0pxLY41F8qR1kLx9vA8aMVYxSuS ui+A== X-Gm-Message-State: AOAM531dbhQc/gsfjDaE2mApYqPjCFFygBAGeCtktwc+yucQv5B8QtfI Et0wAXqVqbrl2P2iEinNjD0SI1aI1rkpuCu5NgUzknQrVZKuw9uGZ0X6ruaUj2+8ETnY/Xfivd1 Fz4wxZMMIdo+CRzl2+VkI6wpZFi16/qcf5eRFFmkvy4O3pK6vXXarwSoDCqm9bvicsZtr0MTYyY UmOizyu5jsM6nkOXzQeB00VQaHeKQdlvbSPLCr4ic2K1Zx+b+lwoblvln1cqwPN5feuSuJorLjL Pe/ X-Google-Smtp-Source: ABdhPJzt6rsWAtPRAC3Xcd5JoFG3dUNyas9/17LO+/A2BiV1Z52oE+fNS56NwtljJqy5Stj+PFr/GbLlG2MEqWy/F28= X-Received: by 2002:a9d:77c6:: with SMTP id w6mr7402275otl.155.1639078109815; Thu, 09 Dec 2021 11:28:29 -0800 (PST) MIME-Version: 1.0 From: John Naylor Date: Thu, 9 Dec 2021 15:28:18 -0400 Message-ID: Subject: do only critical work during single-user vacuum? To: PostgreSQL Hackers Content-Type: text/plain; charset="UTF-8" X-CLOUD-SEC-AV-Info: enterprisedb,google_mail,monitor X-CLOUD-SEC-AV-Sent: true X-Gm-Spam: 0 X-Gm-Phishy: 0 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk When a user must shut down and restart in single-user mode to run vacuum on an entire database, that does a lot of work that's unnecessary for getting the system online again, even without index_cleanup. We had a recent case where a single-user vacuum took around 3 days to complete. Now that we have a concept of a fail-safe vacuum, maybe it would be beneficial to skip a vacuum in single-user mode if the fail-safe criteria were not met at the beginning of vacuuming a relation. This is not without risk, of course, but it should be much faster than today and once up and running the admin would have a chance to get a handle on things. Thoughts? -- John Naylor EDB: http://www.enterprisedb.com