Re: error context for vacuum to include block number

Michael Paquier <michael@paquier.xyz>

From: Michael Paquier <michael@paquier.xyz>
To: Justin Pryzby <pryzby@telsasoft.com>
Cc: Alvaro Herrera <alvherre@2ndquadrant.com>, Andres Freund <andres@anarazel.de>, pgsql-hackers@postgresql.org
Date: 2019-12-15T13:07:08Z
Lists: pgsql-hackers
On Fri, Dec 13, 2019 at 04:47:35PM -0600, Justin Pryzby wrote:
> It's related code which I cleaned up before adding new stuff.  Not essential,
> thus separate (0002 should be backpatched).

The issue just causes some extra work and that's not a bug, so applied
without a backpatch.

>> The refactoring in 0003 is interesting, so I would be tempted to merge
>> it.  Now you have one small issue in it:
>> -    /*
>> -     * Forget the now-vacuumed tuples, and press on, but be careful
>> -     * not to reset latestRemovedXid since we want that value to be
>> -     * valid.
>> -     */
>> +     lazy_vacuum_heap_index(onerel, vacrelstats, Irel, nindexes, indstats);
>>       vacrelstats->num_dead_tuples = 0;
>> -     vacrelstats->num_index_scans++;
>> You are moving this comment within lazy_vacuum_heap_index, but it
>> applies to num_dead_tuples and not num_index_scans, no?  You should
>> keep the incrementation of num_index_scans within the routine though.
> 
> Thank you, fixed.

For 0003, I think that lazy_vacuum_heap_index() can be confusing as
those indexes are unrelated to heap.  Why not naming it just
lazy_vacuum_all_indexes()?  The routine should also have a header
describing it.
--
Michael

Commits

  1. Avoid calls to RelationGetRelationName() and RelationGetNamespace() in

  2. Introduce vacuum errcontext to display additional information.

  3. Fix mesurement of elapsed time during truncating heap in VACUUM.

  4. Allow vacuum command to process indexes in parallel.

  5. Refactor code dedicated to index vacuuming in vacuumlazy.c

  6. Remove duplicated progress reporting during heap scan of VACUUM