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 1pB0ae-0004Zs-0y for pgsql-hackers@arkaria.postgresql.org; Thu, 29 Dec 2022 21:37:28 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pB0ac-00055y-R5 for pgsql-hackers@arkaria.postgresql.org; Thu, 29 Dec 2022 21:37:26 +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 1pB0ac-00055p-FT for pgsql-hackers@lists.postgresql.org; Thu, 29 Dec 2022 21:37:26 +0000 Received: from mail-pj1-x1030.google.com ([2607:f8b0:4864:20::1030]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1pB0aZ-00073n-Qj for pgsql-hackers@lists.postgresql.org; Thu, 29 Dec 2022 21:37:26 +0000 Received: by mail-pj1-x1030.google.com with SMTP id h7-20020a17090aa88700b00225f3e4c992so11462410pjq.1 for ; Thu, 29 Dec 2022 13:37:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; 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=KmZlz7UMjxCg+sNfIIxNYA3wV8dqlpa3ek5pyhgMDMA=; b=nIhxyqSc87hoA6JnmwJYD2NBGlDWVVFoWkjRvG/UR7c7kvwYb5Lf5IwqZK3uI4bwGB zCBOEgTIPFprmyVNdNbeSYuJ5YufIXcGkgjOyTAqYAPDg/VzCVYSCCSiaZPs6jsx5qUL dRjWcFIXWshDBB5wMjpyuiQaHwde5xdUrwHlXZyuAw4QF+xXaa8M3S4Ol7GygPjcQE7o n+kcMy1yzfVmKzjOlZ2wxaDf+fP9byX2JTXZhXje0gw7nj6cWAVHTKIY/mUjLr+6HEcZ //JtmRZ8+m7EzWAcxTMZj66L7022cAjrrcu4KIaIrO/TkA5oiK+njne4CG/7snhym9qw Ur7A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=KmZlz7UMjxCg+sNfIIxNYA3wV8dqlpa3ek5pyhgMDMA=; b=hPP6tonc4XxbU/i0BIMTljRC9OJfVAFFp22gVuLMZ9DpdrfCAFD8Ys2Jf+amvrvOPB qPmBSQbrMcspf/QlfycMMQJRQoIPJJt9na3yvx5SB0Q6le9bCPoPLmjm5V3U/Ru4dE5F jmXcBoWEtbhrl43mRyHVOyNopIECaKTJS7vpWDKnsQpgdpmvUAled3A+SztvpDVygHlM ox9+gV2eFXbw7jbCG4X0VKJHwsoKmaMwrfqu1qiiAKz6cSQWxEUEeBCAyX6Q4qSCXEf/ VTCncxt3ZorJVl/5BAHx4qaD4LhtJK2fHT2DtdIB7Nk3o2ROUbjnRT3EFuaTslqYfLra enog== X-Gm-Message-State: AFqh2koHoOYsdFvsQVvuFLwSzeAWjKe/rOlpX2rn/SYuHQZ/1xnNbHnu UZAgGgljAb/NjZAaxb4tOgTfUVVOXOs= X-Google-Smtp-Source: AMrXdXsdhb3Ap4iWTR0tUvvv+Q5TP8S5EKphe+IWNiH3hgqw5HCodMdBvlAZBhnWux7dtZjOwquJ5w== X-Received: by 2002:a17:902:9a0b:b0:185:441f:709c with SMTP id v11-20020a1709029a0b00b00185441f709cmr34723200plp.33.1672349841432; Thu, 29 Dec 2022 13:37:21 -0800 (PST) Received: from nathanxps13 ([50.47.162.83]) by smtp.gmail.com with ESMTPSA id k5-20020a170902694500b00186cf82717fsm12352846plt.165.2022.12.29.13.37.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Dec 2022 13:37:20 -0800 (PST) Date: Thu, 29 Dec 2022 13:37:19 -0800 From: Nathan Bossart To: Tom Lane Cc: Justin Pryzby , Peter Geoghegan , postgresql@taljaren.se, pgsql-hackers@lists.postgresql.org, Michael Paquier Subject: Re: BUG #17717: Regression in vacuumdb (15 is slower than 10/11 and possible memory issue) Message-ID: <20221229213719.GA301584@nathanxps13> References: <3544447.1671141436@sss.pgh.pa.us> <3672943.1671202149@sss.pgh.pa.us> <407579.1672258403@sss.pgh.pa.us> <20221229012354.GF1153@telsasoft.com> <451605.1672280274@sss.pgh.pa.us> <576868.1672334578@sss.pgh.pa.us> <20221229182657.GA165622@nathanxps13> <599741.1672345755@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <599741.1672345755@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Thu, Dec 29, 2022 at 03:29:15PM -0500, Tom Lane wrote: > Nathan Bossart writes: >> On Thu, Dec 29, 2022 at 12:22:58PM -0500, Tom Lane wrote: >>> Justin Pryzby writes: >>>> VACUUM (UPDATE_DATABASE_STATS {yes,no,only}) >>>>> VACUUM (DATABASE_STATS {UPDATE,SKIP,ONLY}) > >> +1 for only introducing one option. IMHO UPDATE_DATABASE_STATS fits a >> little better since it states the action like most of the other options, >> but I think both choices are sufficiently clear. > > I tried to make a patch along these lines, and soon hit a stumbling > block: ONLY is a fully-reserved SQL keyword. I don't think this > syntax is attractive enough to justify requiring people to > double-quote the option, so we are back to square one. Anybody > have a different suggestion? Hm. I thought about using PreventInTransactionBlock() for the function, but that probably won't work for a few reasons. AFAICT we'd need to restrict it to only be callable via "SELECT update_database_stats()", which feels a bit unnatural. There was some discussion elsewhere [0] about adding a PROCESS_MAIN_RELATION option or expanding PROCESS_TOAST to simplify vacuuming the TOAST table directly. If such an option existed, you could call VACUUM (PROCESS_MAIN_RELATION FALSE, PROCESS_TOAST FALSE, UPDATE_DATABASE_STATES TRUE) pg_class; to achieve roughly what we need. I'll admit this is hacky, though. So, adding both SKIP_DATABASE_STATS and ONLY_DATABASE_STATS might be the best bet. [0] https://postgr.es/m/20221215191246.GA252861%40nathanxps13 -- Nathan Bossart Amazon Web Services: https://aws.amazon.com