On Tue, Feb 7, 2023 at 6:47 PM Andres Freund <and...@anarazel.de> wrote: > One thing I'm not quite sure what to do about is that we atm use a hardcoded > DEBUG2 (not controlled by VERBOSE) in a bunch of places: > > ereport(DEBUG2, > (errmsg("table \"%s\": removed %lld dead item > identifiers in %u pages", > vacrel->relname, (long long) index, > vacuumed_pages))); > > ivinfo.message_level = DEBUG2; > > I find DEBUG2 hard to use to run the entire regression tests, it results in a > lot of output. Lots of it far less important than these kinds of details > here. So I'd like to use a different log level for them - but without further > complications that'd mean they'd show up in VACUUUM VERBOSE.
I think that these DEBUG2 traces are of limited value, even for experts. I personally never use them -- I just use VACUUM VERBOSE/autovacuum logging for everything, since it's far easier to read, and isn't missing something that the DEBUG2 traces have. In fact I wonder if we should even have them at all. I generally don't care about the details when VACUUM runs out of space for dead_items -- these days the important thing is to just avoid it completely. I also generally don't care about how many index tuples were deleted by each index's ambulkdelete() call, since VACUUM VERBOSE already shows me the number of LP_DEAD stubs encountered/removed in the heap. I can see the size of indexes and information about page deletion in VACUUM VERBOSE these days, too. Don't get me wrong. It *would* be useful to see more information about each index in VACUUM VERBOSE output -- just not the number of tuples deleted. Tuples really don't matter much at this level. But seeing something about the number of WAL records written while vacuuming each index is another story. That's a cost that is likely to vary in possibly-interesting ways amongst indexes on the table, unlike IndexBulkDeleteResult.tuples_removed, which is very noisy, and signifies almost nothing important on its own. -- Peter Geoghegan