Re: Making autovacuum logs indicate if insert-based threshold was the triggering condition

From: Justin Pryzby <pryzby(at)telsasoft(dot)com>
To: Peter Geoghegan <pg(at)bowt(dot)ie>
Cc: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: Making autovacuum logs indicate if insert-based threshold was the triggering condition
Date: 2022-09-09 18:11:24
Message-ID: 20220909181124.GQ31833@telsasoft.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sat, Aug 06, 2022 at 04:09:28PM -0700, Peter Geoghegan wrote:
> What are the chances that both thresholds will be crossed at *exactly*
> (not approximately) the same time in a real world case, where the
> table isn't tiny (tiny relative to the "autovacuum_naptime quantum")?
> This is a very narrow case.

The threshold wouldn't need to be crossed within autovacuum_naptime, since all
the workers might be busy. Consider autovacuum delay, analyze on long/wide
tables, multiple extended stats objects, or autovacuum parameters which are
changed off-hours by a cronjob.

> It might make sense to *always* show how close we were to hitting each
> of the thresholds, including the ones that we didn't end up hitting
> (we may come pretty close quite often, which seems like it might
> matter). But showing multiple conditions together just because the
> planets aligned (we hit multiple thresholds together) emphasizes the
> low-level mechanism, which is pretty far removed from anything that
> matters. You might as well pick either threshold at random once this
> happens -- even an expert won't be able to tell the difference.

I don't have strong feelings about it; I'm just pointing out that the
two of the conditions aren't actually exclusive.

It seems like it could be less confusing to show both. Consider someone who is
trying to *reduce* how often autovacuum runs, or give priority to some tables
by raising the thresholds for other tables.

--
Justin

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Mark Dilger 2022-09-09 18:17:12 Re: why can't a table be part of the same publication as its schema
Previous Message Alvaro Herrera 2022-09-09 17:58:13 Re: cataloguing NOT NULL constraints