Re: autovacuum not prioritising for-wraparound tables

Robert Haas <robertmhaas@gmail.com>

From: Robert Haas <robertmhaas@gmail.com>
To: Andres Freund <andres@2ndquadrant.com>
Cc: Alvaro Herrera <alvherre@2ndquadrant.com>, Christopher Browne <cbbrowne@gmail.com>, Tom Lane <tgl@sss.pgh.pa.us>, Heikki Linnakangas <hlinnakangas@vmware.com>, Pg Hackers <pgsql-hackers@postgresql.org>
Date: 2013-02-02T19:54:10Z
Lists: pgsql-hackers
On Sat, Feb 2, 2013 at 1:49 PM, Andres Freund <andres@2ndquadrant.com> wrote:
> You're right, this doesn't work superbly well, especially for
> insert-only tables... But imo the place to fix it is not the
> priorization logic but relation_needs_vacanalyze, since fixing it in
> priorization won't prevent the BAM just the timing of it.

Agreed.

> I think scheduling a table for a partial vacuum every min_freeze * 2
> xids, even if its insert only, would go a long way of reducing the
> impact of full-table vacuums. Obviously that would require to retain the
> last xid a vacuum was executed in...

I'm not sure that min_freeze * 2 is the right value, but otherwise agreed.

I keep coming back to the idea that vacuum should have a high-priority
queue and a low-priority queue.  When stuff meets the current
thresholds, it goes into the high-priority queue.  But then there
should be a low-priority queue where we do partial vacuums of things
that meet some lower threshold - like the unfrozen portions of
insert-only tables.

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


Commits

  1. COPY FREEZE and mark committed on fresh tables.

  2. Add vacuum_freeze_table_age GUC option, to control when VACUUM should