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

Поиск
Список
Период
Сортировка
От Yugo Nagata
Тема Re: Fix to not check included columns in ANALYZE on indexes
Дата
Msg-id 20180629173101.2b126621.nagata@sraoss.co.jp
обсуждение исходный текст
Ответ на Re: Fix to not check included columns in ANALYZE on indexes  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: Fix to not check included columns in ANALYZE on indexes  (Peter Geoghegan <pg@bowt.ie>)
Список pgsql-hackers
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>


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Sergei Kornilov
Дата:
Сообщение: Re: New function pg_stat_statements_reset_query() to reset statistics of a specific query
Следующее
От: Kyotaro HORIGUCHI
Дата:
Сообщение: shared-memory based stats collector