Re: [HACKERS] CLUSTER command progress monitor
Kyotaro HORIGUCHI <horiguchi.kyotaro@lab.ntt.co.jp>
From: Kyotaro HORIGUCHI <horiguchi.kyotaro@lab.ntt.co.jp>
To: yamada.tatsuro@lab.ntt.co.jp
Cc: rafia.pghackers@gmail.com, robertmhaas@gmail.com,
alvherre@2ndquadrant.com,
9erthalion6@gmail.com, pg@bowt.ie, pgsql-hackers@postgresql.org,
jeff.janes@gmail.com, thomas.munro@enterprisedb.com,
michael.paquier@gmail.com
Date: 2019-03-19T10:00:20Z
Lists: pgsql-hackers
At Tue, 19 Mar 2019 11:02:57 +0900, Tatsuro Yamada <yamada.tatsuro@lab.ntt.co.jp> wrote in <dc0dd07c-f185-0cf9-ba54-c5c31f6514f2@lab.ntt.co.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.tatsuro@lab.ntt.co.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
Commits
-
Fix progress reporting of CLUSTER / VACUUM FULL
- 6212276e4343 13.0 landed
- da47e43dc32e 12.0 landed
-
Fix thinko when ending progress report for a backend
- f4b91a50e9e6 9.6.16 landed
- 4950f09e7ae2 10.11 landed
- af28744288b1 11.6 landed
- 4c3e750ab4b5 12.0 landed
- ae060a52b288 13.0 landed
-
Report progress of REINDEX operations
- 03f9e5cba0ee 12.0 cited
-
Add progress reporting for CLUSTER and VACUUM FULL.
- 6f97457e0ddd 12.0 landed
-
Un-hide most cascaded-drop details in regression test results.
- 940311e4bb32 12.0 cited
-
Fix memory leak in printtup.c.
- f2004f19ed9c 12.0 cited
-
Remove unused macro
- fb5806533f9f 12.0 cited