Re: Autovacuum fails to keep visibility map up-to-date in mostly-insert-only-tables

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Alexey Bashtanov <bashtanov(at)imap(dot)cc>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Autovacuum fails to keep visibility map up-to-date in mostly-insert-only-tables
Date: 2014-10-09 20:58:51
Message-ID: 20141009205851.GC19877@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Oct 9, 2014 at 02:34:17PM +0400, Alexey Bashtanov wrote:
> Hello!
>
> Autovacuum daemon performs vacuum when the number of rows
> updated/deleted (n_dead_tuples) reaches some threshold.
> Similarly it performs analyze when the number of rows changed in any
> way (incl. inserted).
> When a table is mostly insert-only, its visibility map is not
> updated as vacuum threshold is almost never reached, but analyze
> does not update visibility map.
>
> Why could it be a bad idea to run vacuum after some number of any
> changes including inserts, like analyze?
> Or at least make it tunable by user (add a second bunch of paramters
> to control second vacuum threshold, disabled by default)?

I agree this is a serious problem. We have discussed various options,
but have not decided on anything. The TODO list has:

https://wiki.postgresql.org/wiki/Todo

Improve setting of visibility map bits for read-only and insert-only
workloads

http://www.postgresql.org/message-id/20130906001437.GA29264@momjian.us

--
Bruce Momjian <bruce(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://enterprisedb.com

+ Everyone has their own god. +

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2014-10-09 21:02:02 Re: Deferring some AtStart* allocations?
Previous Message Bruce Momjian 2014-10-09 20:46:11 Re: pg_upgrade, locale and encoding