Re: stats reset during pg_restore? - Mailing list pgsql-performance

From Alvaro Herrera
Subject Re: stats reset during pg_restore?
Date
Msg-id 20060827024554.GD30132@alvh.no-ip.org
Whole thread Raw
In response to stats reset during pg_restore?  ("George Pavlov" <gpavlov@mynewplace.com>)
Responses Re: stats reset during pg_restore?
List pgsql-performance
George Pavlov wrote:
> This did not have any takers in pgsql-general. Maybe
> performance-oriented folks can shed light? The basic question is if
> there is a way to preserve stats during pg_restore?

No, there isn't.

> Can someone share what exatly happens with stats upon restore? Also is
> there anything one can do to keep them intact during a dump/restore?

These stats are not stored in tables, only in memory and saved to a
special file on disk to be able to preserve it across server stop/start.
But pg_dump does not make the slightest attempt to save it.

Also, you can't save it yourself -- while you could save the values it
returns on queries to the stats views, there is no way to feed those
saved values back to the system after a dump/restore.

--
Alvaro Herrera                                http://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.

pgsql-performance by date:

Previous
From: Hayes
Date:
Subject: [8.1.4] Help optimizing query
Next
From: "George Pavlov"
Date:
Subject: Re: Related to Inserting into the database from XML file