pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Murthy Nunna <mnunna@fnal.gov>
Cc: pgsql-admin@postgresql.org <pgsql-admin@postgresql.org>
Subject: Re: pg_dump -Are statistics saved?
Date: Mon, 27 Nov 2023 19:45:45 -0500
Message-ID: <4040678.1701132345@sss.pgh.pa.us> (raw)
In-Reply-To: <DM8PR09MB6677154B85D10BF16F8379CBB8BCA@DM8PR09MB6677.namprd09.prod.outlook.com>
References: <DM8PR09MB6677154B85D10BF16F8379CBB8BCA@DM8PR09MB6677.namprd09.prod.outlook.com>

Murthy Nunna <mnunna@fnal.gov> writes:
> The pg_dump (used verbose) log said "pg_dump: reading extended statistics".

> Does it mean it saved statistics and they can be restored with pg_restore?

What that means is that it will output clones of any CREATE STATISTICS
commands you may have issued.

> If not, is it necessary to run ANALYZE after pg_restore?

That has always been necessary after a dump/restore, and still is.
The pg_dump man page makes this clear enough, I should think:

    The dump file produced by pg_dump does not contain the statistics used
    by the optimizer to make query planning decisions. Therefore, it is
    wise to run ANALYZE after restoring from a dump file to ensure optimal
    performance; see Section 25.1.3 and Section 25.1.6 for more
    information.

			regards, tom lane





view thread (4+ messages)  latest in thread

Message-ID: <4040678.1701132345@sss.pgh.pa.us>
Permalink:  ../4040678.1701132345@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/4040678.1701132345@sss.pgh.pa.us

 · 

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 using the --to and --cc options:
  reply via email

  To: pgsql-admin@postgresql.org
  Cc: tgl@sss.pgh.pa.us, mnunna@fnal.gov
  Subject: Re: pg_dump -Are statistics saved?
  In-Reply-To: <4040678.1701132345@sss.pgh.pa.us>

* 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