pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Pierre Forstmann <pierre.forstmann@gmail.com>
To: pgsql-general@lists.postgresql.org
Subject: Re: Copy Statistics Tables During Upgrade
Date: Fri, 2 Apr 2021 09:06:59 +0200
Message-ID: <01d84d64-99e1-d19c-1262-922f9fc15d0a@gmail.com> (raw)
In-Reply-To: <1042003030.2667942.1617214523822@mail.yahoo.com>
References: <1042003030.2667942.1617214523822.ref@mail.yahoo.com>
	<1042003030.2667942.1617214523822@mail.yahoo.com>

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
>

view thread (2+ messages)

Message-ID: <01d84d64-99e1-d19c-1262-922f9fc15d0a@gmail.com>
Permalink:  ../01d84d64-99e1-d19c-1262-922f9fc15d0a@gmail.com/
Also on:    postgresql.org/message-id/01d84d64-99e1-d19c-1262-922f9fc15d0a@gmail.com

 · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: pierre.forstmann@gmail.com
  Subject: Re: Copy Statistics Tables During Upgrade
  In-Reply-To: <01d84d64-99e1-d19c-1262-922f9fc15d0a@gmail.com>
  References: <1042003030.2667942.1617214523822.ref@mail.yahoo.com> <1042003030.2667942.1617214523822@mail.yahoo.com> <01d84d64-99e1-d19c-1262-922f9fc15d0a@gmail.com>

* 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