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 1jELkJ-00030R-DN for pgsql-hackers@arkaria.postgresql.org; Tue, 17 Mar 2020 23:35:39 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1jELkH-0005yd-WD for pgsql-hackers@arkaria.postgresql.org; Tue, 17 Mar 2020 23:35:37 +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 1jELhC-0001KS-Uu for pgsql-hackers@lists.postgresql.org; Tue, 17 Mar 2020 23:32:27 +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 1jELh8-0007nI-Jn for pgsql-hackers@lists.postgresql.org; Tue, 17 Mar 2020 23:32:25 +0000 Received: by mail-qk1-x742.google.com with SMTP id j4so19187807qkc.11 for ; Tue, 17 Mar 2020 16:32:22 -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=sguBwzNG7XNvnCu9D4ZdKA874YgawOiMRsRKW920QKU=; b=v/LVZNHN4uQ+Izv2pZQ870+wUJfFivMzznpC0UgUTiryLLrnevz+Qq57innjPhURvF /bsyIqIFfHtGN5nuC8mLvpK+nspT0BEMacKwJoQcEtuo61lslG84iQgPoVaVjQlZBKzQ W8az3vBFwvCPht/k/0PM8rYyYS72pezrfafV6CC8ey0iGk3tbIhfrDEvYlVIUiUXXYU1 KV5bmXP9dpvW7MdzlsyJAAJNOToeaxylo6s17S40W9SxGTOeBpyX/8ivz7x2kfvAHoKu 94Kfp3iyRN+gdN213vKEzN3mX6EGftfs5/HGXmO/PcVFdWSiwpTopKyV6KWLJhmCIJ/K xpBQ== 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=sguBwzNG7XNvnCu9D4ZdKA874YgawOiMRsRKW920QKU=; b=jfE9h+uBhQTue0j6HMZq0OQVXJabmCTiHlxcGkqepPZkEOeMtuj2fPYi5WWw1oormI jylqGW/mXGmKBJu8CaStp/ctmpBCG6/nzZjqXTI4hMKGcDXYz/qaqF+1aWmMT3t13VOA WMJDxbchILxk3qMIKMb8esgGLg9gEwsO70L5xAJJ6DyoUATt822/0Xw1+wXfC24cJoj3 DbiJPZHZ6OGv0e7j/mgp1LLOE1/GinWXv/hre16GkyaE+53o+Zw7g4uh1j1XfKdClZM3 j6FmeyIFQ4991fCzhC5K/SDDRw03ziSRRGkx4UTuZ8RQHf0P4pzfM5RxVzmbyPYaYtco IHZQ== X-Gm-Message-State: ANhLgQ2DZ/TUMIIOK+/p8PdMvtoGXB8jV2avmAGdClF74zI1q7tfYyMo 2wjJwFZT8GaFcsmbsB1FpHMDgw== X-Google-Smtp-Source: ADFU+vsS3zS5adgE41213riJNAi4J1a7LSAubqRgMv1M7IEvdmMEqigSMOFhk5N3ppTSltKTrh130Q== X-Received: by 2002:a05:620a:21d2:: with SMTP id h18mr1376083qka.270.1584487941615; Tue, 17 Mar 2020 16:32:21 -0700 (PDT) Received: from pryzbyj (charmander.telsasoft.com. [50.244.222.1]) by smtp.gmail.com with ESMTPSA id x11sm2834056qkf.67.2020.03.17.16.32.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 17 Mar 2020 16:32:20 -0700 (PDT) Received: by pryzbyj (Postfix, from userid 1000) id B7B96800831; Tue, 17 Mar 2020 18:32:18 -0500 (CDT) Date: Tue, 17 Mar 2020 18:32:18 -0500 From: Justin Pryzby To: Masahiko Sawada Cc: David Rowley , Laurenz Albe , Tomas Vondra , Amit Kapila , Masahiko Sawada , Darafei =?utf-8?Q?Kom=D1=8Fpa?= Praliaskouski , Andres Freund , PostgreSQL Developers , Alvaro Herrera , Michael Banck Subject: Re: Berserk Autovacuum (let's save next Mandrill) Message-ID: <20200317233218.GD26184@telsasoft.com> References: <9c312999bb8e0495b88d1422980ecc0abc1b1b86.camel@cybertec.at> <20200316124713.GH26184@telsasoft.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200316124713.GH26184@telsasoft.com> 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 16, 2020 at 07:47:13AM -0500, Justin Pryzby wrote: > Normally, when someone complains about bad plan related to no index-onlyscan, > we tell them to run vacuum, and if that helps, then ALTER TABLE .. SET > (autovacuum_vacuum_scale_factor=0.005). > > If there's two thresholds (4 GUCs and 4 relopts) for autovacuum, then do we > have to help determine which one was being hit, and which relopt to set? I don't think we came to any resolution on this. Right now, to encourage IOS, we'd tell someone to set autovacuum_vacuum_scale_factor=0.005. That wouldn't work for an insert-only table, but I've never heard back from someone that it didn't work. So with this patch, we'd maybe tell them to do this, to also get IOS on insert-only tables ? |ALTER TABLE .. SET (autovacuum_vacuum_scale_factor=0.005, autovacuum_vacuum_insert_threshold=50000); > I wonder if the new insert GUCs should default to -1 (disabled)? And the > insert thresholds should be set by new insert relopt (if set), or by new insert > GUC (default -1), else normal relopt, or normal GUC. The defaults would give > 50 + 0.20*n. When someone asks about IOS, we'd tell them to set > autovacuum_vacuum_scale_factor=0.005, same as now. > > vac_ins_scale_factor = > (relopts && relopts->vacuum_ins_scale_factor >= 0) ? relopts->vacuum_ins_scale_factor : > autovacuum_vac_ins_scale >= 0 ? autovacuum_vac_ins_scale : > (relopts && relopts->vacuum_scale_factor >= 0) ? relopts->vacuum_scale_factor : > autovacuum_vac_scale; -- Justin