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 1jH7cc-0007Zx-CE for pgsql-hackers@arkaria.postgresql.org; Wed, 25 Mar 2020 15:07:10 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1jH7cb-0005hy-85 for pgsql-hackers@arkaria.postgresql.org; Wed, 25 Mar 2020 15:07:09 +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 1jH7ca-0005go-O8 for pgsql-hackers@lists.postgresql.org; Wed, 25 Mar 2020 15:07:09 +0000 Received: from mail-qv1-xf33.google.com ([2607:f8b0:4864:20::f33]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1jH7cT-0008KB-U4 for pgsql-hackers@lists.postgresql.org; Wed, 25 Mar 2020 15:07:07 +0000 Received: by mail-qv1-xf33.google.com with SMTP id p60so1200660qva.5 for ; Wed, 25 Mar 2020 08:07:01 -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=At5vm0kGr3HL97/h8PDZpw3iqCSYIkcDu5d1Y74n5kU=; b=WK6Rr5V5+FvNb2wZjSRABZmym7NKRc9xt3uNQwSXQHqE4vkxkBP96mCtudBUALjxeB 2jDHNwiLv79a3xPFSD2jcfJp/ZSgEOULqhQt5sw8M5GNgvV0f0NKxKNnxn6DPqmlAdul jg67VDDiuYELnbTTA0MQcy+NqawK8oWvo1r2HbscOrBc8noGavmF0jjN6th0PD537Ypu +vl/IOnr52fRyLfci9LrmhX7RQ5gDUjAKkIkjs3G0tZ5HbC7H4AdMTht2NGL6n8v3/za b70FNUcFsdDUEXdJj/9hk0kKW+TS7ihs+9lDKkimSpcASzZCa71r2lkX1WgVSkmdx7WO 3NKw== 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=At5vm0kGr3HL97/h8PDZpw3iqCSYIkcDu5d1Y74n5kU=; b=frtbeZWW9TOvYqTqit6fIvM1FehU/L1CFQ9N34H5MxnflFnpwcVQ8eHQQJH58MtGWZ ch++3BA0d28Mk0hlglY6B1cricIZvt/ttF+7ahmxHAkfVsiYFLYDHlrZBbKhTIVjpT+z CJ9MTZm0RPi9wVD/IFukUIEXTmz3vmAcQCz35IXrPWMwCNiG1vFTdDrprg+DaVwMVezS 6TN1eVB4WUFGlXwLk9jZDZ2AYWF4kyZt7yYh8XcdlIjDUsUtrKX8kqRNxF36BicxRicc BVKYmP5KfZ3KcSrawdPKl8EgHAb2v9DzWWHMzGiluW8pLekuq7j8JtTk9qaYfzCcRz70 O3+g== X-Gm-Message-State: ANhLgQ38/uyGE202kpG2s6Jyc1Uk7+ItnULFcMQKqUk/sjox5fVbZSaV iQvVmYVf68Hsf+eCNX9BxuJKsQ== X-Google-Smtp-Source: ADFU+vvndfoOLQDQ30uZMIybRD9lZVmWwrtc3QWUfC7DY90EygoxjsOUS3CCNbh9ke2gJTI2fv8SUQ== X-Received: by 2002:ad4:45e9:: with SMTP id q9mr3540350qvu.199.1585148820922; Wed, 25 Mar 2020 08:07:00 -0700 (PDT) Received: from pryzbyj (charmander.telsasoft.com. [50.244.222.1]) by smtp.gmail.com with ESMTPSA id f16sm17548600qtk.61.2020.03.25.08.06.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 25 Mar 2020 08:06:59 -0700 (PDT) Received: by pryzbyj (Postfix, from userid 1000) id D2FE4800C28; Wed, 25 Mar 2020 10:06:56 -0500 (CDT) Date: Wed, 25 Mar 2020 10:06:56 -0500 From: Justin Pryzby To: Laurenz Albe Cc: Andres Freund , Masahiko Sawada , David Rowley , Tomas Vondra , Amit Kapila , Masahiko Sawada , Darafei =?utf-8?Q?Kom=D1=8Fpa?= Praliaskouski , pgsql-hackers@lists.postgresql.org, Alvaro Herrera , Michael Banck Subject: Re: Berserk Autovacuum (let's save next Mandrill) Message-ID: <20200325150656.GX21443@telsasoft.com> References: <19be41199e7b303bbecc1066bd9f011d95882aa8.camel@cybertec.at> <20200316213459.kh6xln3z35hgjodd@alap3.anarazel.de> <7c132215f0e947af7d9ccb7a340ad6e81b369c24.camel@cybertec.at> <20200317152409.GW26184@telsasoft.com> <20200318010254.sra6fldiqz7ey6is@alap3.anarazel.de> <20200320062031.uwagypenawujwajx@alap3.anarazel.de> <1a5a8273535742114b776ab60b0cc0a48e5bfaa3.camel@cybertec.at> <7f4c22e2ddd742b083c71683b00f29bbd13a9b9d.camel@cybertec.at> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <7f4c22e2ddd742b083c71683b00f29bbd13a9b9d.camel@cybertec.at> User-Agent: Mutt/1.9.4 (2018-02-28) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Mon, Mar 23, 2020 at 02:27:29PM +0100, Laurenz Albe wrote: > Here is version 10 of the patch, which uses a scale factor of 0.2. Thanks > Any table that has received more inserts since it was > last vacuumed (and that is not vacuumed for another > reason) will be autovacuumed. Since this vacuum doesn't trigger any special behavior (freeze), you can remove the parenthesized part: "(and that is not vacuumed for another reason)". Maybe in the docs you can write this with thousands separators: 10,000,000 It looks like the GUC uses scale factor max=1e10, but the relopt is still max=100, which means it's less possible to disable for a single rel. > +++ b/src/backend/access/common/reloptions.c > @@ -398,6 +407,15 @@ static relopt_real realRelOpts[] = > }, > -1, 0.0, 100.0 > }, > + { > + { > + "autovacuum_vacuum_insert_scale_factor", > + "Number of tuple inserts prior to vacuum as a fraction of reltuples", > + RELOPT_KIND_HEAP | RELOPT_KIND_TOAST, > + ShareUpdateExclusiveLock > + }, > + -1, 0.0, 100.0 > + }, > { > { > "autovacuum_analyze_scale_factor", > +++ b/src/backend/utils/misc/guc.c > @@ -3549,6 +3558,17 @@ static struct config_real ConfigureNamesReal[] = > 0.2, 0.0, 100.0, > NULL, NULL, NULL > }, > + > + { > + {"autovacuum_vacuum_insert_scale_factor", PGC_SIGHUP, AUTOVACUUM, > + gettext_noop("Number of tuple inserts prior to vacuum as a fraction of reltuples."), > + NULL > + }, > + &autovacuum_vac_ins_scale, > + 0.2, 0.0, 1e10, > + NULL, NULL, NULL > + }, > + > { > {"autovacuum_analyze_scale_factor", PGC_SIGHUP, AUTOVACUUM, > gettext_noop("Number of tuple inserts, updates, or deletes prior to analyze as a fraction of reltuples."),