From: | Jeff Davis <pgsql(at)j-davis(dot)com> |
---|---|
To: | Corey Huinker <corey(dot)huinker(at)gmail(dot)com> |
Cc: | Michael Paquier <michael(at)paquier(dot)xyz>, jian he <jian(dot)universality(at)gmail(dot)com>, Nathan Bossart <nathandbossart(at)gmail(dot)com>, Bruce Momjian <bruce(at)momjian(dot)us>, Matthias van de Meent <boekewurm+postgres(at)gmail(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Magnus Hagander <magnus(at)hagander(dot)net>, Stephen Frost <sfrost(at)snowman(dot)net>, Ashutosh Bapat <ashutosh(dot)bapat(dot)oss(at)gmail(dot)com>, Peter Smith <smithpb2250(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, alvherre(at)alvh(dot)no-ip(dot)org |
Subject: | Re: Statistics Import and Export |
Date: | 2025-02-13 03:00:55 |
Message-ID: | 26e55538fa8c47d660642f367cd8a19333420789.camel@j-davis.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
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/b40b81d38c3a87fdef61e4f7abfbc7f27c7fbcd9.camel@j-davis.com
[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
[5]
https://www.postgresql.org/message-id/3156140.1713817153%40sss.pgh.pa.us
[6]
https://www.postgresql.org/message-id/d8df5339cab25b5720667beaaed8a8bb8e11578c.camel@j-davis.com
[7]
https://www.postgresql.org/message-id/c2bc08dfec336c03f7a7165d1347e2b52cf98b17.camel@j-davis.com
From | Date | Subject | |
---|---|---|---|
Next Message | Shubham Khanna | 2025-02-13 03:27:49 | Re: Enhance 'pg_createsubscriber' to retrieve databases automatically when no database is provided. |
Previous Message | Anton A. Melnikov | 2025-02-13 02:58:07 | Re: Change GUC hashtable to use simplehash? |