Re: pg_dump: VACUUM and REINDEXING

From: Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>
To: Guillaume Lelarge <guillaume(at)lelarge(dot)info>, Ron <ronljohnsonjr(at)gmail(dot)com>
Cc: "pgsql-generallists(dot)postgresql(dot)org" <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Re: pg_dump: VACUUM and REINDEXING
Date: 2022-05-09 06:50:56
Message-ID: 90e562bcf112ba3adacf1c39a160d3680d3b714d.camel@cybertec.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Sat, 2022-05-07 at 12:06 +0200, Guillaume Lelarge wrote:
> Le sam. 7 mai 2022 à 10:21, Ron <ronljohnsonjr(at)gmail(dot)com> a écrit :
> >  On 5/6/22 21:35, Hasan Marzooq wrote:
> > > I've some questions around Backup & Restore.
> > >
> > >  1: Is it necessary to perform a VACUUM and REINDEXING operation after restoring the
> > > dump from Postgres 9.6 to Postgres 13? The dump size could be 1/2 TB to 1 TB.
> >
> > Perform VACUUM after there have been many updates and deletes.  There have been zero
> > updates and deleted after pg_restore; therefore, no need to vacuum.
>
> I disagree. You're right about the "zero updates and deletes", so no need to vacuum for bloat.
> But you need vacuum to get the visibility map of each relation, so that the planner can use index-only scans.

But from PostgreSQL v13 on, autovacuum is also triggered by INSERTs.
So I'd say that there is nothing to do after restoring a pg_dump, except
to wait until autovacuum is done.

Yours,
Laurenz Albe

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Bharath Rupireddy 2022-05-09 07:16:09 Re: Support logical replication of DDLs
Previous Message Rajamoorthy-CW, Thirumurugan 8361 2022-05-09 06:46:36 Need to install Postgres Version 14 in Linux server with Client and migration steps.