From: | Corey Huinker <corey(dot)huinker(at)gmail(dot)com> |
---|---|
To: | Jeff Davis <pgsql(at)j-davis(dot)com> |
Cc: | "Shinoda, Noriyoshi (SXD Japan FSIP)" <noriyoshi(dot)shinoda(at)hpe(dot)com>, jian he <jian(dot)universality(at)gmail(dot)com>, Matthias van de Meent <boekewurm+postgres(at)gmail(dot)com>, Bruce Momjian <bruce(at)momjian(dot)us>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Nathan Bossart <nathandbossart(at)gmail(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>, 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" <alvherre(at)alvh(dot)no-ip(dot)org> |
Subject: | Re: Statistics Import and Export |
Date: | 2024-10-15 23:36:10 |
Message-ID: | CADkLM=fgMQDbXWX3JYuQNGw6ATda2goNp5gc1BUa=ebZMvbf6w@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
On Tue, Oct 15, 2024 at 2:50 PM Corey Huinker <corey(dot)huinker(at)gmail(dot)com>
wrote:
>
> Oh, I see. It appears that there's a special case for partitioned
>> tables that sets relpages=-1 in do_analyze_rel() around line 680. It's
>> a bit inconsistent, though, because even partitioned indexes have
>> relpages=0. Furthermore, the parameter is of type BlockNumber, so
>> InvalidBlockNumber would make more sense.
>>
>> Not the cleanest code, but if the value exists, we need to be able to
>> import it.
>>
>>
> Thanks for tracking that down. I'll have a patch ready shortly.
>
Code fix with comment on why nobody expects a relpages -1. Test case to
demonstrate that relpages -1 can happen, and updated doc to reflect the new
lower bound.
Attachment | Content-Type | Size |
---|---|---|
v1-0001-Allow-pg_set_relation_stats-to-set-relpages-to-1.patch | text/x-patch | 5.2 KB |
From | Date | Subject | |
---|---|---|---|
Next Message | Bruce Momjian | 2024-10-15 23:39:01 | Re: Doc: typo in config.sgml |
Previous Message | David Rowley | 2024-10-15 23:25:38 | Re: Proposal to Enable/Disable Index using ALTER INDEX |