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

From Corey Huinker
Subject Re: Statistics Import and Export
Date
Msg-id CADkLM=f6f+VkpQykYLoD1Jjph_7wvNvKW+2FU8QeKjbSzxsDbA@mail.gmail.com
Whole thread Raw
In response to Re: Statistics Import and Export  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Statistics Import and Export
Re: Statistics Import and Export
List pgsql-hackers


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. 

From what I can see, it doesn't. Moreover, the attstattarget array agg is only done in version 11 and higher, and we need to go as far back as we've got expression indexes.

 
Or we could leave it as two array_aggs,
aggregating attname and attstattarget separately but removing
the attstattarget filter.

That's what I was thinking, thanks for the confirmation.
 

pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Statistics Import and Export
Next
From: Andres Freund
Date:
Subject: Re: Statistics Import and Export