Re: Add index scan progress to pg_stat_progress_vacuum

From: Peter Geoghegan <pg(at)bowt(dot)ie>
To: "Bossart, Nathan" <bossartn(at)amazon(dot)com>
Cc: "Imseih (AWS), Sami" <simseih(at)amazon(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Add index scan progress to pg_stat_progress_vacuum
Date: 2021-12-20 18:37:05
Message-ID: CAH2-Wzmz4Z+UYqRgYHuyxYHha4Gn-aBprydmG0n+m6J2J_ABSA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Dec 15, 2021 at 2:10 PM Bossart, Nathan <bossartn(at)amazon(dot)com> wrote:
> nitpick: Shouldn't index_blks_scanned be index_blks_vacuumed? IMO it
> is more analogous to heap_blks_vacuumed.

+1.

> This will tell us which indexes are currently being vacuumed and the
> current progress of those operations, but it doesn't tell us which
> indexes have already been vacuumed or which ones are pending vacuum.

VACUUM will process a table's indexes in pg_class OID order (outside
of parallel VACUUM, I suppose). See comments about sort order above
RelationGetIndexList().

Anyway, it might be useful to add ordinal numbers to each index, that
line up with this processing/OID order. It would also be reasonable to
display the same number in log_autovacuum* (and VACUUM VERBOSE)
per-index output, to reinforce the idea. Note that we don't
necessarily display a distinct line for each distinct index in this
log output, which is why including the ordinal number there makes
sense.

> I wish option #1 was cleaner, because I think it would be really nice
> to have all this information in a single row.

I do too. I agree with the specific points you raise in your remarks
about what you've called options #2 and #3, but those options still
seem unappealing to me.

--
Peter Geoghegan

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2021-12-20 18:50:37 Re: sqlsmith: ERROR: XX000: bogus varno: 2
Previous Message Tom Lane 2021-12-20 18:13:51 Re: sqlsmith: ERROR: XX000: bogus varno: 2