Re: Fix to not check included columns in ANALYZE on indexes

From: Andres Freund <andres(at)anarazel(dot)de>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)lists(dot)postgresql(dot)org,Yugo Nagata <nagata(at)sraoss(dot)co(dot)jp>,pgsql-hackers(at)postgresql(dot)org
Subject: Re: Fix to not check included columns in ANALYZE on indexes
Date: 2018-06-28 23:39:15
Message-ID: 7143F4FA-66DB-47E7-A2BE-AF838B490110@anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On June 28, 2018 4:28:39 PM PDT, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>Andres Freund <andres(at)anarazel(dot)de> writes:
>> On June 28, 2018 4:18:36 PM PDT, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>>> Also, is it really true that we don't support included expression
>>> columns now? In what way would that not be a bug?
>
>> I don't think IOS supports expression columns, right? Away from code
>for a bit, so can't check. If indeed true, there'd be little point in
>allowing it, right?
>
>The point of ANALYZE on an expression column is that you can direct
>ANALYZE to collect stats on that expression. This is potentially
>valuable
>for rowcount estimation whether or not the planner notices that it can
>fetch the expression value from the index, or chooses to do so even if
>it
>did notice.

The whole point of including additional columns in the index is that they allow IOSs. It seems more likely that people will expect that included expressions actually are usable, than enlarging the index just to get a bit better stats.

>(In principle, CREATE STATISTICS might someday obsolete this use-case
>for expression indexes, but it hasn't done so yet AFAIK.)

You mean stats on them, or the feature entirely? If the latter, how?

Andres
--
Sent from my Android device with K-9 Mail. Please excuse my brevity.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2018-06-28 23:50:05 Re: Fix to not check included columns in ANALYZE on indexes
Previous Message Tom Lane 2018-06-28 23:28:39 Re: Fix to not check included columns in ANALYZE on indexes