From: Alvaro Herrera <alvherre@2ndquadrant.com>
To: Yugo Nagata <nagata@sraoss.co.jp>
Cc: pgsql-hackers@postgresql.org, Teodor Sigaev <teodor@sigaev.ru>
Cc: Alexander Korotkov <aekorotkov@gmail.com>
Subject: Re: Fix error message when trying to alter statistics on included column
Date: Mon, 16 Jul 2018 20:04:34 -0400
Message-ID: <20180717000433.ljup6n5mgxlgmeev@alvherre.pgsql> (raw)
In-Reply-To: <20180628182803.e4632d5a.nagata@sraoss.co.jp>
On 2018-Jun-28, Yugo Nagata wrote:
> According to the error message, it is not allowed to alter statistics on
> included column because this is "non-expression column".
>
> postgres=# create table test (i int, d int);
> CREATE TABLE
> postgres=# create index idx on test(i) include (d);
> CREATE INDEX
> postgres=# alter index idx alter column 2 set statistics 10;
> ERROR: cannot alter statistics on non-expression column "d" of index "idx"
> HINT: Alter statistics on table column instead.
>
> However, I think this should be forbidded in that this is not a key column
> but a included column. Even if we decide to support expressions in included
> columns in future, it is meaningless to do this because any statistics on
> included column is never used by the planner.
I agree with this reasoning, so I pushed this patch. Thanks! I added a
couple of lines in the regress file for this feature also.
Teodor, Alexander, now would be the time to express dissent :-)
--
Álvaro Herrera https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-hackers@postgresql.org
Cc: alvherre@2ndquadrant.com, nagata@sraoss.co.jp, teodor@sigaev.ru, aekorotkov@gmail.com
Subject: Re: Fix error message when trying to alter statistics on included column
In-Reply-To: <20180717000433.ljup6n5mgxlgmeev@alvherre.pgsql>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox