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 1kXrEi-0004z8-6H for pgsql-hackers@arkaria.postgresql.org; Wed, 28 Oct 2020 19:35:56 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kXrEg-0002xw-Sk for pgsql-hackers@arkaria.postgresql.org; Wed, 28 Oct 2020 19:35:54 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kXrEg-0002xl-M6 for pgsql-hackers@lists.postgresql.org; Wed, 28 Oct 2020 19:35:54 +0000 Received: from mail-ej1-x644.google.com ([2a00:1450:4864:20::644]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1kXrEe-000744-Db for pgsql-hackers@lists.postgresql.org; Wed, 28 Oct 2020 19:35:53 +0000 Received: by mail-ej1-x644.google.com with SMTP id t25so490520ejd.13 for ; Wed, 28 Oct 2020 12:35:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=2ndquadrant-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=SSBn76HC974DaCNaUBnIhrB1ZOSgMc5/MMVbv3U2y1c=; b=pDoMjmGs219W6YjoYYO+BxUdvSf7TONB3PocadxUvOkNrXHgEsAaAOlgkX1k3uhWeJ G5KTVN/Twgi210WPUr6Mw4MY9bC+isZ/P3lgT/L/WP7qLeyIz2h/5QTovXFPEZap+2XI 0aQxs03YJLb+nAh9t8LDioX9adpQTIGkFYB5e6hrpwzEo5Zgwykr5tf0AgATXuPa10hw d9SQ5S06/S3pQhy1a+DwvLJP2B9RTff6inA4qtoXOy+UTZkwx92EG+D/0zA1yzqiuNqI Jw6UIN+6n6tmAIdhr9MeksWObuMoXWL3nzOrPtvbL7rUjc6kO2wHVZ5HTF8wl0I//7ku p6ig== 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; bh=SSBn76HC974DaCNaUBnIhrB1ZOSgMc5/MMVbv3U2y1c=; b=CgHTPLDlQJoodVb6GgWxb/nU16X68lQelK5RMuZD+fuLltRVX59vLLzVSZXbrAgZf8 8STtFM2lurQrlAn/2nGiuKc+2a1wPdCu/nzS+WPEJ3JwZJpRUwmaqGyExn+gT2qyawLK UrOYUSN/arksUl/pYMnpjjHag6LAUzVR82RXPsCcfi3EBdH/m59FEb3Vmh7VgOpsM4hV NSlia3jnMJOZa9H/BAJL23z8HWB3i5Na/teJ/AKCDKUkvvP03V7mIGZFFjFp8KiMRVb7 VDnpedZeEWE3TNNq0nMRjcgBsN8iCBh1FtuipQFio5SGpztB/yWXOGM1cu3gDmXhjhd3 uOhA== X-Gm-Message-State: AOAM533+ZlU5K4k5KfumQlpMMThh2Hhjxch2LNHQXn+T1/1JYUwLCh1P Uz9OAPqk7LpDh6fld5sHUBJfUQ== X-Google-Smtp-Source: ABdhPJxal8iAk6I9vd97BvfgV+sbZPyA3p7Pv3joi73LNGUVNn9plYQ3hdbPbDSYSgi8+92QaWZjDQ== X-Received: by 2002:a17:906:3c03:: with SMTP id h3mr680548ejg.78.1603913749962; Wed, 28 Oct 2020 12:35:49 -0700 (PDT) Received: from localhost (ip-86-49-245-76.net.upcbroadband.cz. [86.49.245.76]) by smtp.gmail.com with ESMTPSA id ao17sm290207ejc.18.2020.10.28.12.35.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Oct 2020 12:35:49 -0700 (PDT) Date: Wed, 28 Oct 2020 20:35:46 +0100 From: Tomas Vondra To: Tom Lane Cc: "David G. Johnston" , =?utf-8?B?RmFicsOtemlv?= Mello , PostgreSQL Hackers Subject: Re: Add important info about ANALYZE after create Functional Index Message-ID: <20201028193546.ayzxua26od3qnbzt@development> References: <20201028185538.fzux2lhim472h46o@development> <20201028191201.wh5ldvhsiqy2vknu@development> <1443542.1603912732@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <1443542.1603912732@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Wed, Oct 28, 2020 at 03:18:52PM -0400, Tom Lane wrote: >Tomas Vondra writes: >> On Wed, Oct 28, 2020 at 12:00:54PM -0700, David G. Johnston wrote: >>> Given how simple the manual workaround is not having it be manual seems >>> like it would be safe and straight-forward to implement. > >> Maybe, but I wouldn't be surprised if it was actually a bit trickier in >> practice, particularly for the CONCURRENTLY case. But I haven't tried. > >> Anyway, I think there's an agreement it'd be valuable to do this after >> CREATE INDEX in the future, so if someone wants to implement it that'd >> be great. We can consider backpatching only once we have an actual patch >> anyway. > >Just to be clear, I'm entirely *not* on board with that. IMV it's >intentional that we do not force auto-analyze activity after CREATE >INDEX or CREATE STATISTICS. If we change that, people will want a >way to opt out of it, and then your "simple" patch isn't so simple >anymore. True. Some users may have reasons to not want the analyze, I guess. > (Not that it was simple anyway. What if the CREATE is >inside a transaction block, for instance? There's no use in >kicking autovacuum before commit.) > I don't think anyone proposed to do this through autovacuum. There was a reference to auto-analyze but I think that was meant as 'run analyze automatically.' Which would work in transactions just fine, I think. But I agree it'd likely be a more complicated patch than it might seem at first glance. regards -- Tomas Vondra http://www.2ndQuadrant.com PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services