pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Justin Pryzby <pryzby@telsasoft.com>
To: Michael Paquier <michael@paquier.xyz>
Cc: Tomas Vondra <tomas.vondra@2ndquadrant.com>
Cc: Fabrízio de Royes Mello <fabriziomello@gmail.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: David G. Johnston <david.g.johnston@gmail.com>
Cc: pgsql-hackers@lists.postgresql.org, Nikolay Samokhvalov <samokhvalov@gmail.com>
Subject: Re: Add important info about ANALYZE after create Functional Index
Date: Fri, 30 Oct 2020 22:30:13 -0500
Message-ID: <20201031033013.GE3080@telsasoft.com> (raw)
In-Reply-To: <20201030062252.GG1693@paquier.xyz>
References: <CAKFQuwb9GFe4oM3k9bsn7GOk5_jfow-9SpWocAG4xAYVp9nLjg@mail.gmail.com>
	<20201028185538.fzux2lhim472h46o@development>
	<CAKFQuwYGj-P3un2rGbj8Yc8oUohf_kUkDCnO5ap57bO85e56dQ@mail.gmail.com>
	<20201028191201.wh5ldvhsiqy2vknu@development>
	<1443542.1603912732@sss.pgh.pa.us>
	<20201028193546.ayzxua26od3qnbzt@development>
	<CAFcNs+qgLOZWJ=iugTME-UqcLOmGLVS_ioPpvGS87mJ=j8oLZw@mail.gmail.com>
	<20201028230211.dxbjw6mffq37mudu@development>
	<20201029015952.GB2671@paquier.xyz>
	<20201030062252.GG1693@paquier.xyz>

On Fri, Oct 30, 2020 at 03:22:52PM +0900, Michael Paquier wrote:
> On Thu, Oct 29, 2020 at 10:59:52AM +0900, Michael Paquier wrote:
> > REINDEX CONCURRENTLY is by design wanted to provide an experience
> > transparent to the user similar to what a plain REINDEX would do, at
> > least that's the idea behind it, so..  This qualifies as a bug to me,
> > in spirit.
> 
> And in spirit, it is possible to address this issue with the patch
> attached which copies the set of stats from the old to the new index.
> For a non-concurrent REINDEX, this does not happen because we keep the
> same base relation, while we replace completely the relation with a
> concurrent operation.  We have a RemoveStatistics() in heap.c, but I
> did not really see the point to invent a copy flavor for this
> particular case.  Perhaps others have an opinion on that?

+1

The implementation of REINDEX CONCURRENTLY is "CREATE INDEX CONCURRENTLY
followed by internal index swap".  But the command is called "reindex", and so
the user experience is that the statistics are inexplicably lost.

(I'm quoting from the commit message of the patch I wrote, which is same as
your patch).

-- 
Justin





view thread (40+ messages)  latest in thread

Message-ID: <20201031033013.GE3080@telsasoft.com>
Permalink:  ../20201031033013.GE3080@telsasoft.com/
Also on:    postgresql.org/message-id/20201031033013.GE3080@telsasoft.com

 · 

reply

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: pryzby@telsasoft.com, michael@paquier.xyz, tomas.vondra@2ndquadrant.com, fabriziomello@gmail.com, tgl@sss.pgh.pa.us, david.g.johnston@gmail.com, samokhvalov@gmail.com
  Subject: Re: Add important info about ANALYZE after create Functional Index
  In-Reply-To: <20201031033013.GE3080@telsasoft.com>

* 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