Re: Copy Statistics Tables During Upgrade

From: Pierre Forstmann <pierre(dot)forstmann(at)gmail(dot)com>
To: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: Copy Statistics Tables During Upgrade
Date: 2021-04-02 07:06:59
Message-ID: 01d84d64-99e1-d19c-1262-922f9fc15d0a@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hello,

This is a pg_upgrade known limitation that has been summarized by Greg
Sabino Mullane on
https://www.endpoint.com/blog/2016/12/07/postgres-statistics-and-pain-of-analyze

this way:

The nominal reason for not copying the data is that the table format may
change from version to version. The real reason is that nobody has
bothered to write the conversion logic yet, for pg_upgrade could
certainly copy the pg_statistics information: the table has not changed
for many years.

Regards

Pierre Forstmann

Le 31/03/2021 à 20:15, Virendra Kumar a écrit :
> Hello Team,
>
> I was doing an upgrade of one of our PG (9.6.11 to 11.9) database and
> came across the question that what is reason PostgreSQL is not doing
> copy of stats and we have to analyze right after upgrade. There are
> two situations where this will help when we use this DB as our
> enterprise database:
>
> 1. If DB is in magnitude of hundreds of TB and we have to do analyze
> it might take several hours before we handover this to application
> services.
>
> 2. We are loosing critical information like most common values and
> most common freqs because these values are populated over time when
> many-many sessions hit table and queries with different values of a
> column.
>
> Any input on this is higly appreciated.
>
>
> Regards,
> Virendra Kumar
>

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Bertrand Mamasam 2021-04-02 07:35:25 Re: Primary keys and composite unique keys(basic question)
Previous Message Hemil Ruparel 2021-04-02 06:56:54 Re: Primary keys and composite unique keys(basic question)