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>, Andres Freund <andres(at)anarazel(dot)de>, 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>, 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-24 22:26:47
Message-ID: CADkLM=doAYLmDCv_q0WgRgAjf3gCNzVfvk3f4wWTsZV6sO+QRg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Feb 24, 2025 at 4:30 PM Corey Huinker <corey(dot)huinker(at)gmail(dot)com>
wrote:

>
>>
>> After a bit of playing around, it seemed messy to make it into
>> a join, but we could replace the two array_agg sub-selects with
>> a single one:
>>
>> (SELECT pg_catalog.array_agg(ROW(attname, attstattarget) ORDER BY attnum)
>> FROM pg_catalog.pg_attribute WHERE attrelid = i.indexrelid)
>>
>> and then what we need could be pulled out of that, although
>> I'm not sure if pg_dump has logic at hand for deconstructing an
>> array of composite.
>
>
>
Digging some more on this, I see that we populate indxinfo[j].indkey as if
it's an array of Oids, but it's an array of AttrNumber/int2. Shouldn't have
caused any problems given that we're dealing with small integers, but it
didn't help discoverability just now. Is there some history there that I'm
not aware of?

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2025-02-24 22:33:08 Re: Fix logging for invalid recovery timeline
Previous Message Nathan Bossart 2025-02-24 22:11:03 Re: Statistics Import and Export