|From:||Yugo Nagata <nagata(at)sraoss(dot)co(dot)jp>|
|To:||Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>|
|Subject:||Re: Fix to not check included columns in ANALYZE on indexes|
|Views:||Raw Message | Whole Thread | Download mbox | Resend email|
On Thu, 28 Jun 2018 19:18:36 -0400
Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> Yugo Nagata <nagata(at)sraoss(dot)co(dot)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(at)sraoss(dot)co(dot)jp>
|Next Message||Kyotaro HORIGUCHI||2018-06-29 08:34:18||shared-memory based stats collector|
|Previous Message||Sergei Kornilov||2018-06-29 08:14:19||Re: New function pg_stat_statements_reset_query() to reset statistics of a specific query|