On Thu, 28 Jun 2018 19:18:36 -0400
Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Yugo Nagata <nagata@sraoss.co.jp> 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 we decide to support expressions
> > in included columns in future, this must be fixed eventually.
>
> AFAICS, we'd just have to revert this patch later, so I don't see
> much value in it.
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, statistics on
included (= non-key) columns in index is never used by the planner whether this
is expression or not. So, we don't have to examin these columns in ANALYZE.
> Also, is it really true that we don't support included expression
> columns now? In what way would that not be a bug?
Currently, included expression columns are not supported.
postgres=# create index on test(i) include ((d+1));
ERROR: expressions are not supported in included columns
>
> regards, tom lane
>
--
Yugo Nagata <nagata@sraoss.co.jp>