Re: pg_dump -Are statistics saved?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Murthy Nunna <mnunna(at)fnal(dot)gov>
Cc: "pgsql-admin(at)postgresql(dot)org" <pgsql-admin(at)postgresql(dot)org>
Subject: Re: pg_dump -Are statistics saved?
Date: 2023-11-28 00:45:45
Message-ID: 4040678.1701132345@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Murthy Nunna <mnunna(at)fnal(dot)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

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Nikhil Ingale 2023-11-28 04:00:20 idle in transaction
Previous Message David G. Johnston 2023-11-28 00:31:47 Re: pg_dump -Are statistics saved?