Re: Statistics Import and Export

From: Corey Huinker <corey(dot)huinker(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Jeff Davis <pgsql(at)j-davis(dot)com>, 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>, Matthias van de Meent <boekewurm+postgres(at)gmail(dot)com>, Peter Smith <smithpb2250(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Tomas Vondra <tomas(dot)vondra(at)enterprisedb(dot)com>
Subject: Re: Statistics Import and Export
Date: 2024-04-11 19:54:07
Message-ID: CADkLM=eE2BD-40uGMOpJs19inYJ2PSY+21srXT0K49NseBe30w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sat, Apr 6, 2024 at 5:23 PM Corey Huinker <corey(dot)huinker(at)gmail(dot)com>
wrote:

>
>>
>> I think it'll be a serious, serious error for this not to be
>> SECTION_DATA. Maybe POST_DATA is OK, but even that seems like
>> an implementation compromise not "the way it ought to be".
>>
>
> We'd have to split them on account of when the underlying object is
> created. Index statistics would be SECTION_POST_DATA, and everything else
> would be SECTION_DATA. Looking ahead, statistics data for extended
> statistics objects would also be POST. That's not a big change, but my
> first attempt at that resulted in a bunch of unrelated grants dumping in
> the wrong section.
>

At the request of a few people, attached is an attempt to move stats to
DATA/POST-DATA, and the TAP test failure that results from that.

The relevant errors are confusing, in that they all concern GRANT/REVOKE,
and the fact that I made no changes to the TAP test itself.

$ grep 'not ok' build/meson-logs/testlog.txt
not ok 9347 - section_data: should not dump GRANT INSERT(col1) ON TABLE
test_second_table
not ok 9348 - section_data: should not dump GRANT SELECT (proname ...) ON
TABLE pg_proc TO public
not ok 9349 - section_data: should not dump GRANT SELECT ON TABLE
measurement
not ok 9350 - section_data: should not dump GRANT SELECT ON TABLE
measurement_y2006m2
not ok 9351 - section_data: should not dump GRANT SELECT ON TABLE test_table
not ok 9379 - section_data: should not dump REVOKE SELECT ON TABLE pg_proc
FROM public
not ok 9788 - section_pre_data: should dump CREATE TABLE test_table
not ok 9837 - section_pre_data: should dump GRANT INSERT(col1) ON TABLE
test_second_table
not ok 9838 - section_pre_data: should dump GRANT SELECT (proname ...) ON
TABLE pg_proc TO public
not ok 9839 - section_pre_data: should dump GRANT SELECT ON TABLE
measurement
not ok 9840 - section_pre_data: should dump GRANT SELECT ON TABLE
measurement_y2006m2
not ok 9841 - section_pre_data: should dump GRANT SELECT ON TABLE test_table
not ok 9869 - section_pre_data: should dump REVOKE SELECT ON TABLE pg_proc
FROM public

Attachment Content-Type Size
v18-0001-Create-pg_set_relation_stats-pg_set_attribute_st.patch text/x-patch 109.9 KB
v18-0002-Enable-dumping-of-table-index-stats-in-pg_dump.patch text/x-patch 18.7 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2024-04-11 20:00:26 Re: Issue with the PRNG used by Postgres
Previous Message Andres Freund 2024-04-11 19:52:11 Re: Issue with the PRNG used by Postgres