Re: monitoring CREATE INDEX [CONCURRENTLY]

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
Cc: Rahila Syed <rahila(dot)syed(at)2ndquadrant(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: monitoring CREATE INDEX [CONCURRENTLY]
Date: 2019-03-11 19:12:00
Message-ID: CA+TgmoYF4uzqP+S5OQ84S-dqkHHcP7qv=4_ha8ONviPHc0q_sw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Mar 11, 2019 at 8:41 AM Alvaro Herrera <alvherre(at)2ndquadrant(dot)com> wrote:
> > I wonder how is the phase 'building index(3 of 8): initializing(1/5)' when
> > the blocks_done count is increasing. Shouldn't it have
> > changed to reflect PROGRESS_BTREE_PHASE_INDEXBUILD_HEAPSCAN as building
> > index(3 of 8): table scan(2/5) ?
> > Although I think it has been rectified in the latest patch as I now get
> > 'table scan' phase in output as I do CREATE INDEX on table with 1000000
> > records
>
> Yeah, this was a bug that I fixed in v5. (It was a misunderstanding
> about how parallel scanning is set up, IIRC). For v5, I tested both
> parallel and non-parallel builds, with and without sync seqscans, and
> everything seemed to behave correctly.
>
>
> Thanks for looking! I intend to post a new version later this week.

I don't think that I much like this (3 of 8) and (2 of 5) stuff. It's
inconsistent with what we've got already and it doesn't add much.
Someone who wants to know which phase it is can look at the underlying
numbers directly instead of going through the view, but most people
probably won't care, and given that the phases may be of dramatically
unequal length, I don't think it's adding much.

Another reason why I think this is a bad idea is that there may be
some operations where we don't transit all the phases in all cases;
the pending patch for CLUSTER progress reporting works like that.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2019-03-11 19:18:29 Re: monitoring CREATE INDEX [CONCURRENTLY]
Previous Message Alexander Korotkov 2019-03-11 17:42:27 Re: [PATCH] kNN for btree