public inbox for [email protected]  
help / color / mirror / Atom feed
From: Jeff Davis <[email protected]>
To: Corey Huinker <[email protected]>
Cc: Michael Paquier <[email protected]>
Cc: jian he <[email protected]>
Cc: Nathan Bossart <[email protected]>
Cc: Bruce Momjian <[email protected]>
Cc: Matthias van de Meent <[email protected]>
Cc: Tom Lane <[email protected]>
Cc: Magnus Hagander <[email protected]>
Cc: Stephen Frost <[email protected]>
Cc: Ashutosh Bapat <[email protected]>
Cc: Peter Smith <[email protected]>
Cc: PostgreSQL Hackers <[email protected]>
Cc: [email protected]
Subject: Re: Statistics Import and Export
Date: Wed, 12 Feb 2025 19:00:55 -0800
Message-ID: <[email protected]> (raw)
In-Reply-To: <CADkLM=cALMHZkXU+xZw9-WeR4XSXzDYj_-xERHg8haYq1zbjhg@mail.gmail.com>
References: <CADkLM=fe4f=YVGHbOGiXV+W2SoJZtcNw1Ta8gYh5UUhxndaVgw@mail.gmail.com>
	<CACJufxGuRPfd70NwogkRE26cZcKGrR9gjG4OiH18tu=BnyezHA@mail.gmail.com>
	<CADkLM=fMuVwcxr2aocz4H=LVf2PZsvTNenqEod2PoY1OyCU+kw@mail.gmail.com>
	<[email protected]>
	<CADkLM=cQi+sYpLY6BqybZ8ZWffSU4+1-aEQsShSGbrh3M=Dtcg@mail.gmail.com>
	<[email protected]>
	<CACJufxG6K4EAUROhdr0wkzMh5QyFLmdLZeAoh7Vh0-VbuAtHcw@mail.gmail.com>
	<CADkLM=fihosVw7fJak6Jq1AdCX8fuZ+7s1_-+AUZR=sdD13zAQ@mail.gmail.com>
	<CADkLM=cnYxaNFbAQRMLeOOga0j5pY_V6Tfcn+vjm_rXL=WOF7Q@mail.gmail.com>
	<[email protected]>
	<[email protected]>
	<CADkLM=fzX7QX6r78fShWDjNN3Vcr4PVAnvXxQ4DiGy6V=0bCUA@mail.gmail.com>
	<[email protected]>
	<CADkLM=cALMHZkXU+xZw9-WeR4XSXzDYj_-xERHg8haYq1zbjhg@mail.gmail.com>

On Tue, 2025-02-11 at 14:02 -0500, Corey Huinker wrote:
> 
> 
> The previous 0001 is now committed (thanks!) so only one remains.
>  

Summary of the decisions made in this thread:

  * pg_dump --data-only does not include stats[1]. This behavior was
    not fully resolved, but I didn't see a reasonable set of options
    where (a) --data-only would include stats; and (b) we could
    specify what pg_upgrade needs, which is schema+stats. Jian seemed
    to agree. However, this leaves us with the behavior where
    --data-only doesn't get everything in SECTION_DATA, which might be
    undesirable.
  * stats are in SECTION_DATA[2], except for stats on objects that
    are created in SECTION_POST_DATA, in which case the stats are
    also in SECTION_POST_DATA
    - indexes are created in SECTION_POST_DATA, and though plain
      indexes don't have stats, expression indexes do
    - MVs are normally created in SECTION_PRE_DATA, in which case
      the stats are in SECTION_DATA; but MVs can be deferred to
      SECTION_POST_DATA due to dependency on a primary key
  * SECTION_NONE was proposed, but rejected[2]
  * The default is to include the stats.[3]
  * pg_dump[all] options are designed to allow specifying any
    combination of schema[4], data, and stats:
      --schema-only (schema), --no-schema (data+stats)
      --data-only (data), --no-data (schema+stats)
      --stats-only (stats), --no-stats (schema+data)
  * A SECTION_STATS was proposed and rejected due to complexity[5]
  * The prefix in the dump output will be "Statistics for " (instead
    of "Data for ")[6]
  * The TOC description will be "STATISTICS DATA", differentiating
    it from an extended statistics object[6]
  * pg_upgrade will now pass --no-data (schema+stats) to pg_dump
    instead of --schema-only, thereby transferring the stats to the
    new cluster[7]

It's been a long thread, so please tell me if I missed something or if
something needs more discussion.

I'm still reviewing v48, but I intend to commit something soon.

Regards,
	Jeff Davis

[1]
https://www.postgresql.org/message-id/[email protected]

[2] 
https://www.postgresql.org/message-id/1798867.1712376328%40sss.pgh.pa.us

[3]
https://www.postgresql.org/message-id/3228677.1713844341%40sss.pgh.pa.us

[4]
https://www.postgresql.org/message-id/CACJufxG6K4EAUROhdr0wkzMh5QyFLmdLZeAoh7Vh0-VbuAtHcw%40mail.gma...

[5]
https://www.postgresql.org/message-id/3156140.1713817153%40sss.pgh.pa.us

[6] 
https://www.postgresql.org/message-id/[email protected]

[7]
https://www.postgresql.org/message-id/[email protected]








view thread (60+ messages)  latest in thread

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 using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected]
  Subject: Re: Statistics Import and Export
  In-Reply-To: <[email protected]>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox