Re: Database-wide VACUUM ANALYZE

From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: Steven Flatt <steven(dot)flatt(at)gmail(dot)com>
Cc: Jim Nasby <decibel(at)decibel(dot)org>, Bill Moran <wmoran(at)collaborativefusion(dot)com>, Francisco Reyes <lists(at)stringsutils(dot)com>, pgsql-performance(at)postgresql(dot)org
Subject: Re: Database-wide VACUUM ANALYZE
Date: 2007-06-26 18:49:06
Message-ID: 20070626184906.GE11609@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Steven Flatt escribió:

> Most of our large (partitioned) tables are insert-only (truncated
> eventually) so will not be touched by autovacuum until wraparound prevention
> kicks in. However the tables are partitioned by timestamp so tables will
> cross the 1.9 billion marker at different times (some not at all, as the
> data will have been truncated).

Note that as of 8.3, tables that are truncated do not need vacuuming for
Xid wraparound purposes, because the counter is updated on TRUNCATE (as
it is on CLUSTER and certain forms of ALTER TABLE).

> Do you still think the 250 million transactions away from shutdown is
> cutting it too close? Recall that the unintentional db-wide vacuum analyze
> that was going on last week on our system took less than two days to
> complete.

Is this 8.1 or 8.2? In the latter you don't ever need db-wide vacuums
at all, because Xid wraparound is tracked per table, so only tables
actually needing vacuum are processed. To answer your question, the
followup question is how many transactions normally take place in two
days. If they are way less than 250 million then you don't need to
worry. Otherwise, the database may shut itself down to protect from Xid
wraparound.

--
Alvaro Herrera http://www.flickr.com/photos/alvherre/
"La soledad es compañía"

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Josh Berkus 2007-06-26 19:26:05 Re: PostgreSQL Configuration Tool for Dummies
Previous Message Greg Smith 2007-06-26 18:14:24 Re: PostgreSQL Configuration Tool for Dummies