Re: [PROPOSAL] VACUUM Progress Checker.

From: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
To: Rahila Syed <rahilasyed90(at)gmail(dot)com>
Cc: Jim Nasby <Jim(dot)Nasby(at)bluetreble(dot)com>, PostgreSQL mailing lists <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [PROPOSAL] VACUUM Progress Checker.
Date: 2015-07-31 18:21:09
Message-ID: 20150731182109.GY2441@postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Joshua D. Drake 2015-07-31 18:43:35 Re: [PROPOSAL] VACUUM Progress Checker.
Previous Message Jesper Pedersen 2015-07-31 18:10:01 Re: RequestAddinLWLocks(int n)