Subject: Vacuuming System DBs like postgres, template1

From: OMPRAKASH SAHU <[email-masked]>
Date: Mon, 4 Aug 2025 09:15:08 +0530

Hi Team,

We have multitenant architecture in our postgresql servers where we have
more than 200DBs on every server.

On few large DBs we run vacuum analyze manually as well, and I do see few
people vacuuming the template1 db or postgres db also

So just wanted to know vacuum system dbs is required or not?

Regards,
OM

---

From: "David G. Johnston" <[email-masked]>
Date: Sun, 3 Aug 2025 21:47:48 -0700

On Sun, Aug 3, 2025 at 8:45 PM OMPRAKASH SAHU <[email-masked]> wrote:

> Pretty sure the answer is yes - though letting auto-vacuum do it is
sufficient - since something has to update the catalog column that
indicates the oldest transaction the database is aware of.  There isn't a
value for that which means "everything has been frozen" since it doesn't
get updated in the normal course of activity.

David J.

---

From: Ron Johnson <[email-masked]>
Date: Mon, 4 Aug 2025 01:53:12 -0400

> get updated in the normal course of activity.

template1 needs to be regularly vacuumed?

-- 
Death to <Redacted>, and butter sauce.
Don't boil me, I'm still alive.
<Redacted> lobster!