Re: a verbose option for autovacuum
Michael Paquier <michael@paquier.xyz>
From: Michael Paquier <michael@paquier.xyz>
To: Masahiko Sawada <sawada.mshk@gmail.com>
Cc: Euler Taveira <euler@eulerto.com>, Tommy Li <tommy@coffeemeetsbagel.com>, Stephen Frost <sfrost@snowman.net>, Tom Lane <tgl@sss.pgh.pa.us>, pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2021-03-19T06:14:10Z
Lists: pgsql-hackers
Attachments
- v5-index_stats_log.patch (text/x-diff) patch v5
On Thu, Mar 18, 2021 at 11:30:46PM +0900, Masahiko Sawada wrote: > Sorry, I attached the wrong version patch. So attached the right one. Thanks. I have been hacking aon that, and I think that we could do more in terms of integration of the index stats into LVRelStats to help with debugging issues, mainly, but also to open the door at allowing autovacuum to use the parallel path in the future. Hence, for consistency, I think that we should change the following things in LVRelStats: - Add the number of indexes. It looks rather unusual to not track down the number of indexes directly in the structure anyway, as the stats array gets added there. - Add all the index names, for parallel and non-parallel mode. - Replace the index name in the error callback by an index number, pointing back to its location in indstats and indnames. As lazy_vacuum_index() requires the index number to be set internally to it, this means that we need to pass it down across vacuum_indexes_leader(), lazy_parallel_vacuum_indexes(), but that seems like an acceptable compromise to me for now. I think that it would be good to tighten a bit more the relationship between the index stats in the DSM for the parallel case and the ones in local memory, but what we have here looks enough to me so we could figure out that as a future step. Sawada-san, what do you think? Attached is the patch I have finished with. -- Michael
Commits
-
Add per-index stats information in verbose logs of autovacuum
- 5aed6a1fc214 14.0 landed
-
VACUUM ANALYZE: Always update pg_class.reltuples.
- 5f8727f5a679 14.0 cited