agora inbox for pgsql-committers@postgresql.org  
help / color / mirror / Atom feed
From: Álvaro Herrera <alvherre@kurilemu.de>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Allow index_create to suppress index_build progress reporting
Date: Sun, 05 Apr 2026 11:34:38 +0000
Message-ID: <E1w9LkT-0034QA-26@gemulon.postgresql.org> (raw)

Allow index_create to suppress index_build progress reporting

A future REPACK patch wants a way to suppress index_build doing its
progress reports when building an index, because that would interfere
with repack's own reporting; so add an INDEX_CREATE_SUPPRESS_PROGRESS
bit that enables this.

Furthermore, change the index_create_copy() API so that it takes flag
bits for index_create() and passes them unchanged.  This gives its
callers more direct control, which eases the interface -- now its
callers can pass the INDEX_CREATE_SUPPRESS_PROGRESS bit directly.  We
use it for the current caller in REINDEX CONCURRENTLY, since it's also
not interested in progress reporting, since it doesn't want
index_build() to be called at all in the first place.

One thing to keep in mind, pointed out by Mihail, is that we're not
suppressing the index-AM-specific progress report updates which happen
during ambuild().  At present this is not a problem, because the values
updated by those don't overlap with those used by commands other than
CREATE INDEX; but maybe in the future we'll want the ability to suppress
them also.  (Alternatively we might want to display how each
index-build-subcommand progresses during REPACK and others.)

Author: Antonin Houska <ah@cybertec.at>
Author: Álvaro Herrera <alvherre@kurilemu.de>
Reviewed-by: Mihail Nikalayeu <mihailnikalayeu@gmail.com>
Discussion: https://postgr.es/m/102906.1773668762@localhost

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/caec9d9fadf1b04741ac554470c46bc1f8e89d19

Modified Files
--------------
src/backend/bootstrap/bootstrap.c |  2 +-
src/backend/catalog/heap.c        |  3 ++-
src/backend/catalog/index.c       | 27 ++++++++++++++++-----------
src/backend/commands/indexcmds.c  |  4 +++-
src/include/catalog/index.h       |  6 ++++--
5 files changed, 26 insertions(+), 16 deletions(-)



Message-ID: <E1w9LkT-0034QA-26@gemulon.postgresql.org>
Permalink:  ../E1w9LkT-0034QA-26@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1w9LkT-0034QA-26@gemulon.postgresql.org

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-committers@postgresql.org
  Cc: alvherre@kurilemu.de, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Allow index_create to suppress index_build progress reporting
  In-Reply-To: <E1w9LkT-0034QA-26@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox