Re: Is it ever necessary to vacuum a table that only gets inserts/updates?

From: Craig Ringer <ringerc(at)ringerc(dot)id(dot)au>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: PostgreSQL <pgsql-general(at)postgresql(dot)org>, Jason Buberel <jason(at)altosresearch(dot)com>, John R Pierce <pierce(at)hogranch(dot)com>
Subject: Re: Is it ever necessary to vacuum a table that only gets inserts/updates?
Date: 2011-11-17 11:01:42
Message-ID: CAD2md3GxFaaiwDURVpyqdAumnHMecHjKZL5BZFcfMNZoPW52dw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Nov 17, 2011 1:32 PM, "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>
> John R Pierce <pierce(at)hogranch(dot)com> writes:
> > On 11/16/11 4:24 PM, Jason Buberel wrote:
> >> Just wondering if there is ever a reason to vacuum a very large table
> >> (> 1B rows) containing rows that never has rows deleted.
>
> > no updates either?
>
> To clarify: in Postgres, an "update" means an insert and a delete.
> So unless you mean that this table is insert-only, you certainly
> still need vacuum.
>
> > you still want to do a vacuum analyze every so often to update the
> > statistics used by the planner.
>
> If it's purely an insert-only table, such as a logging table, then in
> principle you only need periodic ANALYZEs and not any VACUUMs.
>

Won't a VACUUM FREEZE (or autovac equivalent) be necessary eventually, to
handle xid wraparound? If so, doing it pre-emptively might help avoid a
giant I/O load and work pause when its forced.

Or am I just confused?

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Yan Chunlu 2011-11-17 11:18:24 Re: how could duplicate pkey exist in psql?
Previous Message Emanuel Araújo 2011-11-17 10:34:15 connection manager pgpool... help