pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Laurenz Albe <laurenz.albe@cybertec.at>
To: Guillaume Lelarge <guillaume@lelarge.info>
To: Ron <ronljohnsonjr@gmail.com>
Cc: pgsql-generallists.postgresql.org <pgsql-general@lists.postgresql.org>
Subject: Re: pg_dump: VACUUM and REINDEXING
Date: Mon, 09 May 2022 08:50:56 +0200
Message-ID: <90e562bcf112ba3adacf1c39a160d3680d3b714d.camel@cybertec.at> (raw)
In-Reply-To: <CAECtzeXtrwxGgiWNb_qsTG-tm8fyTsgLdfguWNhjni+1_H8qDg@mail.gmail.com>
References: <CANvhf8JViXsNYOvWEecZ_3dHq4shNFeby+W7u2jerEqnD+4Gpw@mail.gmail.com>
	<3336352b-f97a-86e3-585b-207a98f56d4d@gmail.com>
	<CAECtzeXtrwxGgiWNb_qsTG-tm8fyTsgLdfguWNhjni+1_H8qDg@mail.gmail.com>

On Sat, 2022-05-07 at 12:06 +0200, Guillaume Lelarge wrote:
> Le sam. 7 mai 2022 à 10:21, Ron <ronljohnsonjr@gmail.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





view thread (8+ messages)  latest in thread

Message-ID: <90e562bcf112ba3adacf1c39a160d3680d3b714d.camel@cybertec.at>
Permalink:  ../90e562bcf112ba3adacf1c39a160d3680d3b714d.camel@cybertec.at/
Also on:    postgresql.org/message-id/90e562bcf112ba3adacf1c39a160d3680d3b714d.camel@cybertec.at

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: laurenz.albe@cybertec.at, guillaume@lelarge.info, ronljohnsonjr@gmail.com
  Subject: Re: pg_dump: VACUUM and REINDEXING
  In-Reply-To: <90e562bcf112ba3adacf1c39a160d3680d3b714d.camel@cybertec.at>
  References: <CANvhf8JViXsNYOvWEecZ_3dHq4shNFeby+W7u2jerEqnD+4Gpw@mail.gmail.com> <3336352b-f97a-86e3-585b-207a98f56d4d@gmail.com> <CAECtzeXtrwxGgiWNb_qsTG-tm8fyTsgLdfguWNhjni+1_H8qDg@mail.gmail.com> <90e562bcf112ba3adacf1c39a160d3680d3b714d.camel@cybertec.at>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox