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.