pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Alvaro Herrera <alvherre@alvh.no-ip.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Report progress of CREATE INDEX operations
Date: Tue, 02 Apr 2019 18:23:39 +0000
Message-ID: <E1hBO4R-00005E-0l@gemulon.postgresql.org> (raw)

Report progress of CREATE INDEX operations

This uses the progress reporting infrastructure added by c16dc1aca5e0,
adding support for CREATE INDEX and CREATE INDEX CONCURRENTLY.

There are two pieces to this: one is index-AM-agnostic, and the other is
AM-specific.  The latter is fairly elaborate for btrees, including
reportage for parallel index builds and the separate phases that btree
index creation uses; other index AMs, which are much simpler in their
building procedures, have simplistic reporting only, but that seems
sufficient, at least for non-concurrent builds.

The index-AM-agnostic part is fairly complete, providing insight into
the CONCURRENTLY wait phases as well as block-based progress during the
index validation table scan.  (The index validation index scan requires
patching each AM, which has not been included here.)

Reviewers: Rahila Syed, Pavan Deolasee, Tatsuro Yamada
Discussion: https://postgr.es/m/20181220220022.mg63bhk26zdpvmcj@alvherre.pgsql

Branch
------
master

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

Modified Files
--------------
contrib/amcheck/verify_nbtree.c          |   2 +-
contrib/bloom/blinsert.c                 |   2 +-
contrib/bloom/blutils.c                  |   1 +
doc/src/sgml/indexam.sgml                |  13 ++
doc/src/sgml/monitoring.sgml             | 224 ++++++++++++++++++++++++++++++-
src/backend/access/brin/brin.c           |   5 +-
src/backend/access/gin/gininsert.c       |   2 +-
src/backend/access/gin/ginutil.c         |   1 +
src/backend/access/gist/gist.c           |   1 +
src/backend/access/gist/gistbuild.c      |   2 +-
src/backend/access/hash/hash.c           |   7 +-
src/backend/access/hash/hashsort.c       |   6 +
src/backend/access/heap/heapam_handler.c | 107 +++++++++++++++
src/backend/access/nbtree/nbtree.c       |   9 ++
src/backend/access/nbtree/nbtsort.c      |  56 +++++++-
src/backend/access/nbtree/nbtutils.c     |  24 ++++
src/backend/access/spgist/spginsert.c    |   2 +-
src/backend/access/spgist/spgutils.c     |   1 +
src/backend/catalog/index.c              |  57 +++++++-
src/backend/catalog/system_views.sql     |  27 ++++
src/backend/commands/indexcmds.c         |  72 ++++++++--
src/backend/storage/ipc/standby.c        |   2 +-
src/backend/storage/lmgr/lmgr.c          |  46 ++++++-
src/backend/storage/lmgr/lock.c          |   7 +-
src/backend/utils/adt/amutils.c          |  23 ++++
src/backend/utils/adt/pgstatfuncs.c      |   2 +
src/include/access/amapi.h               |   4 +
src/include/access/genam.h               |   1 +
src/include/access/nbtree.h              |  11 ++
src/include/access/tableam.h             |   7 +
src/include/catalog/catversion.h         |   2 +-
src/include/catalog/pg_proc.dat          |  10 +-
src/include/commands/progress.h          |  37 ++++-
src/include/pgstat.h                     |   5 +-
src/include/storage/lmgr.h               |   4 +-
src/include/storage/lock.h               |   2 +-
src/test/regress/expected/rules.out      |  30 ++++-
37 files changed, 768 insertions(+), 46 deletions(-)



view thread (5+ messages)  latest in thread

Message-ID: <E1hBO4R-00005E-0l@gemulon.postgresql.org>
Permalink:  ../E1hBO4R-00005E-0l@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1hBO4R-00005E-0l@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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: alvherre@alvh.no-ip.org
  Subject: Re: pgsql: Report progress of CREATE INDEX operations
  In-Reply-To: <E1hBO4R-00005E-0l@gemulon.postgresql.org>
  References: <E1hBO4R-00005E-0l@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 DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox