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

2018-07-06 Thread Yugo Nagata
On Fri, 29 Jun 2018 17:31:51 +0300 Teodor Sigaev wrote: > > AFAICS, we'd just have to revert this patch later, so I don't see > > much value in it. > True, I suppose we should apply this patch just for consistency, because we > don't allow expression in included columns. Yes, this is what I int

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

2018-07-06 Thread Yugo Nagata
On Sat, 30 Jun 2018 14:13:49 -0400 Tom Lane wrote: > Peter Geoghegan writes: > > I think that the argument Tom is making is that it might be useful to > > have statistics on the expression regardless of this -- the expression > > may be interesting in some general sense. For example, one can ima

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

2018-06-30 Thread Tom Lane
Peter Geoghegan writes: > I think that the argument Tom is making is that it might be useful to > have statistics on the expression regardless of this -- the expression > may be interesting in some general sense. For example, one can imagine > the planner creating a plan with a hash aggregate rath

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

2018-06-30 Thread Peter Geoghegan
On Fri, Jun 29, 2018 at 1:31 AM, Yugo Nagata wrote: > I'm sorry but I don't understand why we'd just have to revert this patch > later. > > Do you mean that if we decide to support expressions in included columns in > future, > this patch would be reverted? This is wrong. To my understanding, st

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

2018-06-29 Thread Teodor Sigaev
AFAICS, we'd just have to revert this patch later, so I don't see much value in it. True, I suppose we should apply this patch just for consistency, because we don't allow expression in included columns. Also, is it really true that we don't support included expression columns now? In what w

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

2018-06-29 Thread Yugo Nagata
On Thu, 28 Jun 2018 19:18:36 -0400 Tom Lane wrote: > Yugo Nagata writes: > > I found that both key columns and included columns are checked when analyze > > is run on indexes. This is almost harmless because non-expression columns > > are not processed. However, this check is obviously unnecess

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

2018-06-28 Thread Tom Lane
Andres Freund writes: > On June 28, 2018 4:28:39 PM PDT, Tom Lane wrote: >> (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? No, just the coll

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

2018-06-28 Thread Andres Freund
On June 28, 2018 4:28:39 PM PDT, Tom Lane wrote: >Andres Freund writes: >> On June 28, 2018 4:18:36 PM PDT, Tom Lane 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 c

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

2018-06-28 Thread Tom Lane
Andres Freund writes: > On June 28, 2018 4:18:36 PM PDT, Tom Lane 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

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

2018-06-28 Thread Andres Freund
On June 28, 2018 4:18:36 PM PDT, Tom Lane wrote: >Yugo Nagata writes: >> I found that both key columns and included columns are checked when >analyze >> is run on indexes. This is almost harmless because non-expression >columns >> are not processed. However, this check is obviously unnecessar

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

2018-06-28 Thread Tom Lane
Yugo Nagata writes: > I found that both key columns and included columns are checked when analyze > is run on indexes. This is almost harmless because non-expression columns > are not processed. However, this check is obviously unnecessary and we > can fix this to not check included columns. If w

Fix to not check included columns in ANALYZE on indexes

2018-06-28 Thread Yugo Nagata
Hi, I found that both key columns and included columns are checked when analyze is run on indexes. This is almost harmless because non-expression columns are not processed. However, this check is obviously unnecessary and we can fix this to not check included columns. If we decide to support expr