Re: Statistics Import and Export - Mailing list pgsql-hackers

From Corey Huinker
Subject Re: Statistics Import and Export
Date
Msg-id CADkLM=fMuVwcxr2aocz4H=LVf2PZsvTNenqEod2PoY1OyCU+kw@mail.gmail.com
Whole thread Raw
In response to Re: Statistics Import and Export  (Jeff Davis <pgsql@j-davis.com>)
Responses Re: Statistics Import and Export
List pgsql-hackers


On Mon, Jan 20, 2025 at 3:22 AM jian he <jian.universality@gmail.com> wrote:
On Thu, Jan 16, 2025 at 4:56 AM Corey Huinker <corey.huinker@gmail.com> wrote:
>>
>>
>>
>> I do like the idea of a "Statistics for ..." prefix, and I think it's
>> doable.
>
>
> And that's now implemented.
>
>
>> The caller needs some knowledge about that anyway, to correctly output
>> the statistics dump when the schema is not requested. Tests should
>> cover those cases, too.
>
>
> Tests for pg_dump --no-statistics and pg_dump --schema-only were added. Rebased to master as of today.
>
> I'm not completely happy with this patch, as I had to comment out one check in pg_backup_archiver that seemed necessary, but perhaps another set of eyes will set me straight.
>
> Attached is just the pg_dump stuff, and only for relation/attribute stats. The extended stats and vacuumdb work will be in their own threads going forward.

hi
The current v38 implementation allows statistics to be placed in
either SECTION_DATA or SECTION_POST_DATA.
IMHO, moving all statistics to the SECTION_POST_DATA section would
simplify things.
Attached is a patch that implements this change, (based on your patch,
obviously)

That is where all statistics were previously. Others felt very strongly that they should be mixed in to SECTION_DATA and SECTION_POST_DATA.

 
* repairDependencyLoop, repairMatViewBoundaryMultiLoop is quite hard
to comprehend.

I don't disagree.
 

* There are many REQ_DATA or REQ_SCHEMA occurrences, for each
occurrence, we may need to consider REQ_STATS.

That is already in the works. Hoping to get that patch out soon.

pgsql-hackers by date:

Previous
From: Sami Imseih
Date:
Subject: Re: Bug in detaching a partition with a foreign key.
Next
From: jian he
Date:
Subject: Re: Non-text mode for pg_dumpall