Re: Skip index cleanup if autovacuum did not do any work

Peter Geoghegan <pg@bowt.ie>

From: Peter Geoghegan <pg@bowt.ie>
To: Feike Steenbergen <feikesteenbergen@gmail.com>
Cc: PostgreSQL mailing lists <pgsql-hackers@postgresql.org>
Date: 2017-11-28T22:17:48Z
Lists: pgsql-hackers
On Tue, Nov 28, 2017 at 1:36 PM, Feike Steenbergen
<feikesteenbergen@gmail.com> wrote:
> On a server with a very frequent xid wraparound I can see that the
> anti-wraparound vacuum is finished very quickly with the heap, yet it still
> scans all the indexes, which causes it to still have to read a lot of data,
> which takes a considerable amount of time.

BTW, a good short term solution for you might be to change the vacuum
cost delay settings. They're pretty conservative by default.

There is a good chance that your indexes are mostly in memory even on
large tables, and B-Tree indexes are read sequentially during VACUUM.
Often, autovacuum runs at a much slower rate than is actually
possible, which isn't necessarily the right trade-off.

-- 
Peter Geoghegan