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

From: Andres Freund <andres(at)2ndquadrant(dot)com>
To: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
Cc: Bruce Momjian <bruce(at)momjian(dot)us>, Alexey Bashtanov <bashtanov(at)imap(dot)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 21:19:41
Message-ID: 20141009211941.GJ29124@awork2.int
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2014-10-09 18:16:46 -0300, Alvaro Herrera wrote:
> Andres Freund wrote:
> > On 2014-10-09 18:03:00 -0300, Alvaro Herrera wrote:
> > > Bruce Momjian wrote:
> > >
> > > > 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
> > >
> > > I hate to repeat myself, but I think autovacuum could be modified to run
> > > actions other than vacuum and analyze. In this specific case we could
> > > be running a table scan that checks only pages that don't have the
> > > all-visible bit set, and see if it can be set.
> >
> > Isn't that *precisely* what a plain vacuum run does?
>
> Well, it also scans for dead tuples, removes them, and needs to go
> through indexes to remove their references.

IIRC it doesn't do most of that if that there's no need. And if it's a
insert only table without rollbacks. I *do* think there's some
optimizations we could make in general.

> I'm thinking in something
> very lightweight. Otherwise, why don't we just reduce the
> vacuum_scale_factor default to something very small, so that vacuum is
> triggered more often?

The problem here is that that doesn't trigger for inserts. Just for
updates/deletes or rollbacks.

Greetings,

Andres Freund

--
Andres Freund http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Jim Nasby 2014-10-09 21:52:46 Re: Wait free LW_SHARED acquisition - v0.9
Previous Message Josh Berkus 2014-10-09 21:19:18 Re: schema-only -n option in pg_restore fails