Re: vacuuming template0

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Jeff Janes <jeff(dot)janes(at)gmail(dot)com>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: vacuuming template0
Date: 2013-01-27 22:27:21
Message-ID: 3084.1359325641@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Jeff Janes <jeff(dot)janes(at)gmail(dot)com> writes:
> I thought that template0 did not need vacuuming because everything in
> it was frozen. But it looks like it does need vacuuming, and no one
> but autovac can connect in order to do that vacuum.

Everything in it *should* be frozen, typically. My recollection is that
we used to exclude it from autovacuuming, but decided to treat it the
same as every other database on the grounds that somebody might've
connected to it and modified something, then restored the normal
not-datallowconn marking. (A valid reason for doing that would be to
apply some maintenance correction to the system catalogs, as we've
occasionally had to recommend in update release notes.)

> Is this a real problem? Presumably no one systematically crashes
> their database shortly after start up on a production system; but that
> doesn't mean there are not other ways to get into the situation.

I can't get excited about this scenario. Given that template0 should be
(a) small and (b) all-frozen already, it should not take a noticeable
amount of time for autovac to look through it once per freeze cycle.
If your database is under such stress that that can't get done, you've
got *serious* problems, probably much worse than whether template0
itself is getting processed.

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Jeff Davis 2013-01-27 22:28:50 Re: Enabling Checksums
Previous Message Simon Riggs 2013-01-27 21:29:56 Re: autovacuum not prioritising for-wraparound tables