pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Dmitry Dolgov <9erthalion6@gmail.com>
To: Alvaro Herrera <alvherre@alvh.no-ip.org>
Cc: Pg Hackers <pgsql-hackers@lists.postgresql.org>
Cc: Michael Paquier <michael@paquier.xyz>
Cc: James Coleman <jtc331@gmail.com>
Subject: Re: {CREATE INDEX, REINDEX} CONCURRENTLY improvements
Date: Fri, 4 Dec 2020 12:38:32 +0100
Message-ID: <20201204113832.yuneqs6t4fhjo6k3@localhost> (raw)
In-Reply-To: <20201130195439.GA24598@alvherre.pgsql>
References: <20201130195439.GA24598@alvherre.pgsql>

> On Mon, Nov 30, 2020 at 04:54:39PM -0300, Alvaro Herrera wrote:
>
> In a previous thread [1], we added smarts so that processes running
> CREATE INDEX CONCURRENTLY would not wait for each other.
>
> One is adding the same to REINDEX CONCURRENTLY.  I've attached patch
> 0002 here which does that.
>
> Why 0002, you ask?  That's because preparatory patch 0001 simplifies the
> ReindexRelationConcurrently somewhat by adding a struct to be used of
> indexes that are going to be processed, instead of just a list of Oids.
> This is a good change in itself because it let us get rid of duplicative
> open/close of the index rels in order to obtain some info that's already
> known at the start.

Thanks! The patch looks pretty good to me, after reading it I only have
a few minor comments/questions:

* ReindexIndexInfo sounds a bit weird for me because of the repeating
  part, although I see there is already a similar ReindexIndexCallbackState
  so probably it's fine.

* This one is mostly for me to understand. There are couple of places
  with a commentary that 'PROC_IN_SAFE_IC is not necessary, because the
  transaction only takes a snapshot to do some catalog manipulation'.
  But for some of them I don't immediately see in the relevant code
  anything related to snapshots. E.g. one in DefineIndex is followed by
  WaitForOlderSnapshots (which seems to only do waiting, not taking a
  snapshot), index_set_state_flags and CacheInvalidateRelcacheByRelid.
  Is taking a snapshot hidden somewhere there inside?





view thread (19+ messages)  latest in thread

Message-ID: <20201204113832.yuneqs6t4fhjo6k3@localhost>
Permalink:  ../20201204113832.yuneqs6t4fhjo6k3@localhost/
Also on:    postgresql.org/message-id/20201204113832.yuneqs6t4fhjo6k3@localhost

 · 

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: 9erthalion6@gmail.com, alvherre@alvh.no-ip.org, pgsql-hackers@lists.postgresql.org, michael@paquier.xyz, jtc331@gmail.com
  Subject: Re: {CREATE INDEX, REINDEX} CONCURRENTLY improvements
  In-Reply-To: <20201204113832.yuneqs6t4fhjo6k3@localhost>

* 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