Re: [PROPOSAL] VACUUM Progress Checker. - Mailing list pgsql-hackers

From Alvaro Herrera
Subject Re: [PROPOSAL] VACUUM Progress Checker.
Date
Msg-id 20150731182109.GY2441@postgresql.org
Whole thread Raw
In response to Re: [PROPOSAL] VACUUM Progress Checker.  (Rahila Syed <rahilasyed90@gmail.com>)
Responses Re: [PROPOSAL] VACUUM Progress Checker.
Re: [PROPOSAL] VACUUM Progress Checker.
Re: [PROPOSAL] VACUUM Progress Checker.
List pgsql-hackers
I think the only way to produce usable estimates is to report more than
one number.  And in the particular case of lazy vacuuming, ISTM the way
to do it is to consider heap scanning as one phase, index cleanup as
another phase; these two phases can be interleaved.  And there's a final
heap scan which is a third phase, which can only run after phases one
and two are complete.

So you would report either "we're in phases one/two" or "we're in phase
three".  If we're in phases one/two, then we need to report

1. what's the page number of heap scan (i.e. how much more do we have to  go yet?)
2. how many index scans have we done so far
3. if phase two, how many index pages have we scanned (total, i.e.  across all indexes).

The total number of heap pages is known, and the total number of index
pages is also known, so it's possible to derive a percentage out of
this part.  Maybe it would be useful to report how much time it's been
in phases one and two respectively; with that, I think it is possible to
extrapolate the total time.

If we're in third phase, we report the heap page number we're in.

This looks pretty complicated to understand from the user POV, but
anything other than this seems to me too simplistic to be of any use.

-- 
Álvaro Herrera                http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services



pgsql-hackers by date:

Previous
From: Jesper Pedersen
Date:
Subject: Re: RequestAddinLWLocks(int n)
Next
From: "Joshua D. Drake"
Date:
Subject: Re: [PROPOSAL] VACUUM Progress Checker.