Re: list of extended statistics on psql - Mailing list pgsql-hackers

From Tomas Vondra
Subject Re: list of extended statistics on psql
Date
Msg-id 20200829215458.ca6pnchavgfhs2pf@development
Whole thread Raw
In response to Re: list of extended statistics on psql  (Alvaro Herrera <alvherre@2ndquadrant.com>)
Responses Re: list of extended statistics on psql
List pgsql-hackers
On Thu, Aug 27, 2020 at 11:26:17PM -0400, Alvaro Herrera wrote:
>On 2020-Aug-28, Tatsuro Yamada wrote:
>
>> > IMO the per-type columns should show both the type being enabled as
>> > well as it being built.
>>
>> Hmm. I'm not sure how to get the status (enabled or disabled) of
>> extended stats. :(
>> Could you explain it more?
>
>pg_statistic_ext_data.stxdndistinct is not null if the stats have been
>built.  (I'm not sure whether there's an easier way to determine this.)
>

It's the only way, I think. Which types were requested is stored in

    pg_statistic_ext.stxkind

and what was built is in pg_statistic_ext_data. But if we want the
output to show both what was requested and which types were actually
built, that'll effectively double the number of columns needed :-(

Also, it might be useful to show the size of the statistics built, just
like we show for \d+ etc.


regards

-- 
Tomas Vondra                  http://www.2ndQuadrant.com
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services



pgsql-hackers by date:

Previous
From: Tomas Vondra
Date:
Subject: Re: list of extended statistics on psql
Next
From: Tomas Vondra
Date:
Subject: Re: [EXTERNAL] Re: WIP: WAL prefetch (another approach)