Re: [HACKERS] CLUSTER command progress monitor

From: Kyotaro HORIGUCHI <horiguchi(dot)kyotaro(at)lab(dot)ntt(dot)co(dot)jp>
To: yamada(dot)tatsuro(at)lab(dot)ntt(dot)co(dot)jp
Cc: rafia(dot)pghackers(at)gmail(dot)com, robertmhaas(at)gmail(dot)com, alvherre(at)2ndquadrant(dot)com, 9erthalion6(at)gmail(dot)com, pg(at)bowt(dot)ie, pgsql-hackers(at)postgresql(dot)org, jeff(dot)janes(at)gmail(dot)com, thomas(dot)munro(at)enterprisedb(dot)com, michael(dot)paquier(at)gmail(dot)com
Subject: Re: [HACKERS] CLUSTER command progress monitor
Date: 2019-03-19 10:00:20
Message-ID: 20190319.190020.57440837.horiguchi.kyotaro@lab.ntt.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

At Tue, 19 Mar 2019 11:02:57 +0900, Tatsuro Yamada <yamada(dot)tatsuro(at)lab(dot)ntt(dot)co(dot)jp> wrote in <dc0dd07c-f185-0cf9-ba54-c5c31f6514f2(at)lab(dot)ntt(dot)co(dot)jp>
> On 2019/03/19 10:43, Tatsuro Yamada wrote:
> > Hi Rafia!
> > On 2019/03/18 20:42, Rafia Sabih wrote:
> >> On Fri, 8 Mar 2019 at 09:14, Tatsuro Yamada
> >> <yamada(dot)tatsuro(at)lab(dot)ntt(dot)co(dot)jp> wrote:
> >>> Attached file is rebased patch on current HEAD.
> >>> I changed a status. :)
> >>>
> >>>
> >> Looks like the patch needs a rebase.
> >> I was on the commit fb5806533f9fe0433290d84c9b019399cd69e9c2
> >>
> >> PFA reject file in case you want to have a look.
> > Thanks for testing it. :)
> > I rebased the patch on the current head:
> > f2004f19ed9c9228d3ea2b12379ccb4b9212641f.
> > Please find attached file.
> > Also, I share my test case of progress monitor below.
>
>
> Attached patch is a rebased document patch. :)

The monitor view has four columns:

heap_tuples_scanned
: used while the "seq scan" and "index scan" phases.

heap_blks_total, heap_blks_scanned
: used only while the "seq scan" phase.

index_rebuild_count:
: used only while the "rebuilding index" phase.

Couldn't we change the view like the following?

.. | phase | heap tuples scanned | progress indicator | value
..-+------------+---------------------+---------------------+--------
.. | seq scan ..| 2134214 | heap blocks pct | 23.5%
.. | index sc ..| 5453395 | (null) | (null)
.. | sorting ..| <the last value> | (null) | (null)
.. | swapping ..| <the last value> | (null) | (null)
.. | rebuildi ..| <the last value> | index count | 2
.. | performi ..| <the last value> | (null) | (null)

Only seq scan phase has two kind of progress indicator so if we
choose "heap blks pct" as the only indicator for the phase, it
could be simplified as:

.. | phase | progress indicator | value
..-+-------------+---------------------+--------
.. | seq scan .. | heap blocks pct | 23.5%
.. | index sc .. | heap tuples scanned | 2398457
.. | sorting .. | (null) | (null)
.. | swapping .. | (null) | (null)
.. | rebuildi .. | index count | 2
.. | performi .. | (null) | (null)

A downside of the view is that it looks quite differently from
pg_stat_progress_vacuum. Since I'm not sure it's a good design,
feel free to oppose/reject this.

finish_heap_swap is also called in matview code path but the
function doesn't seem to detect that situation. Is it right
behavior? (I didn't confirm what happens when it is called from
matview refresh path, though.)

regards.

--
Kyotaro Horiguchi
NTT Open Source Software Center

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Masahiko Sawada 2019-03-19 10:01:06 Re: [HACKERS] Block level parallel vacuum
Previous Message Chris Travers 2019-03-19 09:59:38 Re: [HACKERS] Custom compression methods