Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.92) (envelope-from ) id 1jDhSX-00038u-EX for pgsql-hackers@arkaria.postgresql.org; Mon, 16 Mar 2020 04:34:37 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1jDhSW-00004v-2F for pgsql-hackers@arkaria.postgresql.org; Mon, 16 Mar 2020 04:34:36 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1jDhSV-0008WU-I3 for pgsql-hackers@lists.postgresql.org; Mon, 16 Mar 2020 04:34:35 +0000 Received: from mail-qk1-x742.google.com ([2607:f8b0:4864:20::742]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1jDhSO-0004XW-Ds for pgsql-hackers@lists.postgresql.org; Mon, 16 Mar 2020 04:34:34 +0000 Received: by mail-qk1-x742.google.com with SMTP id f28so23934294qkk.13 for ; Sun, 15 Mar 2020 21:34:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telsasoft-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=Bl1CWhN1twKinLqm4gYh+jUOURca/vXhl4t0e2AQB/Q=; b=KweL6Djy/npKVAIBVNgLzSITMAfD1abOAzzOeFcI1OL+4h6sR2rmw6/Zvq6AKkdnWK XmMaTp0B4CAGw6llInqAzljShoBZ7GTTvTaXqFDJwzbapBYrsjNUw9ckvEmL58hyRd/k S5GdQptJYjmzQfge5Aes5hkkcOw54z5QvKz+stmt9bVRrAQ32tQ0wqOEuIEg/ZSvwD3E zlQ9PQ6PhRtUAz1fwHTpgaMDkDqfxWI2EU+G31jCJZ1HgD7qvAaOfz46thQbYP5OoiJh rRl7POHcsNTdzvRGZY/zKTEJapclqCHsTUVypv8rYqKUkW3vbIpooPvc/gfuqT3voVLe 3H7w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=Bl1CWhN1twKinLqm4gYh+jUOURca/vXhl4t0e2AQB/Q=; b=Wc+io/zMf3AIJIZix50cdMlyMDHDOGRgGo0TvPG1adSoMBQdYm3SPh+vrleOVh5Y/u ceqcCWeHGBfAQ+jfKQr15ji8ahyDnTbJQcysxbvjUzrZVATUyZuQqQoYmOcbuSG10qR+ 8a+S57UvBTy96FTTN8MG/m4HucUe6usHf+eyqwBB2c9nTcQZtn29+ybUE3M5FLyNwGnS uz3FRf7Ooob3SEtze0OaqXIM6NebQM5mCbwGi604OtzBbvRSpIkE9c7DVYMCCPeOWHGd NTmYKvhDfEqtlAooEWHSxBSYJ0djUfoeYomh4uf/Ui6He3ftQT66OsZkHGrpM2kE1YeX G48g== X-Gm-Message-State: ANhLgQ2xTgMGAsrLeBDhtww8C/zbWtS9sZt2XSYndL88zZaX9imOkZyU MF/lJV8nd5vC/tqWZcPnkLu3bQ== X-Google-Smtp-Source: ADFU+vtDfohxR3iWKmoDVULyh7P9Spa80ibCVVO1QrGGDFJh0/3V4HZh39kEIpXBUCF7y7SU2CIQEA== X-Received: by 2002:a05:620a:681:: with SMTP id f1mr24181473qkh.148.1584333267485; Sun, 15 Mar 2020 21:34:27 -0700 (PDT) Received: from pryzbyj (charmander.telsasoft.com. [50.244.222.1]) by smtp.gmail.com with ESMTPSA id r15sm17840653qtr.40.2020.03.15.21.34.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 15 Mar 2020 21:34:26 -0700 (PDT) Received: by pryzbyj (Postfix, from userid 1000) id 2B85E800F98; Sun, 15 Mar 2020 23:34:25 -0500 (CDT) Date: Sun, 15 Mar 2020 23:34:25 -0500 From: Justin Pryzby To: Laurenz Albe Cc: David Rowley , Tomas Vondra , Amit Kapila , Masahiko Sawada , Darafei =?utf-8?Q?Kom=D1=8Fpa?= Praliaskouski , Andres Freund , pgsql-hackers@lists.postgresql.org, Alvaro Herrera , Michael Banck Subject: Re: Berserk Autovacuum (let's save next Mandrill) Message-ID: <20200316043424.GF26184@telsasoft.com> References: <0cd8685047ac86fdf9c5446a24ff3aed8755e290.camel@cybertec.at> <2207744f6cc70813d9000510b6bf03ce85db6675.camel@cybertec.at> <602873766faa0e9200a60dcc26dc10c636761d5d.camel@cybertec.at> <91c110aad4b8653d6433d42fd707bd16074c79a5.camel@cybertec.at> <20200313184442.GS29065@telsasoft.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Fri, Mar 13, 2020 at 10:48:27PM +0100, Laurenz Albe wrote: > On Fri, 2020-03-13 at 13:44 -0500, Justin Pryzby wrote: > > Possible it would be better to run VACUUM *without* freeze_min_age=0 ? (I get > > confused and have to spend 20min re-reading the vacuum GUC docs every time I > > deal with this stuff, so maybe I'm off). > > > > As I understand, the initial motivation of this patch was to avoid disruptive > > anti-wraparound vacuums on insert-only table. But if vacuum were triggered at > > all, it would freeze the oldest tuples, which is all that's needed; especially > > since fd31cd2651 "Don't vacuum all-frozen pages.", those pages would never need > > to be vacuumed again. Recently written tuples wouldn't be frozen, which is ok, > > they're handled next time. > > Freezing tuples too early is wasteful if the tuples get updated or deleted > soon after, but based on the assumption that an autovacuum triggered by insert > is dealing with an insert-mostly table, it is not that wasteful. You're right that it's not *that* wasteful. If it's a table that gets 90% inserts/10% updates, then only 10% of its tuples will be frozen. In the worst case, it's the same tuples every time, and that's somewhat wasteful. In the best case, those tuples are clustered on a small number of pages. -- Justin