From: Tomas Vondra <tomas.vondra@2ndquadrant.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: David G. Johnston <david.g.johnston@gmail.com>
Cc: FabrÃzio Mello <fabriziomello@gmail.com>
Cc: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Subject: Re: Add important info about ANALYZE after create Functional Index
Date: Wed, 28 Oct 2020 20:35:46 +0100
Message-ID: <20201028193546.ayzxua26od3qnbzt@development> (raw)
In-Reply-To: <1443542.1603912732@sss.pgh.pa.us>
References: <CAFcNs+qpFPmiHd1oTXvcPdvAHicJDA9qBUSujgAhUMJyUMb+SA@mail.gmail.com>
<CAKFQuwb9GFe4oM3k9bsn7GOk5_jfow-9SpWocAG4xAYVp9nLjg@mail.gmail.com>
<20201028185538.fzux2lhim472h46o@development>
<CAKFQuwYGj-P3un2rGbj8Yc8oUohf_kUkDCnO5ap57bO85e56dQ@mail.gmail.com>
<20201028191201.wh5ldvhsiqy2vknu@development>
<1443542.1603912732@sss.pgh.pa.us>
On Wed, Oct 28, 2020 at 03:18:52PM -0400, Tom Lane wrote:
>Tomas Vondra <tomas.vondra@2ndquadrant.com> 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-hackers@postgresql.org
Cc: tomas.vondra@2ndquadrant.com, tgl@sss.pgh.pa.us, david.g.johnston@gmail.com, fabriziomello@gmail.com, pgsql-hackers@lists.postgresql.org
Subject: Re: Add important info about ANALYZE after create Functional Index
In-Reply-To: <20201028193546.ayzxua26od3qnbzt@development>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox