Re: Expression index ignores column statistics target

Поиск
Список
Период
Сортировка
От Michael Fuhr
Тема Re: Expression index ignores column statistics target
Дата
Msg-id 20051001074116.GA47043@winnie.fuhr.org
обсуждение исходный текст
Ответ на Re: Expression index ignores column statistics target  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: Expression index ignores column statistics target  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
On Sat, Oct 01, 2005 at 02:42:32AM -0400, Tom Lane wrote:
> Michael Fuhr <mike@fuhr.org> writes:
> > Would an ALTER INDEX SET STATISTICS form be possible?
> 
> It's not so much the table/index misnomer that's bothering me, it's
> the lack of a clean way to identify which column of the index you
> are talking about.

Ah, I see -- I wasn't thinking about expressions in multicolumn
indexes.  What about identifying the column with the expression
itself, ala quote_ident(pg_get_indexdef())?  That might be tedious
for the user to type but it would be attractive from a self-documentation
standpoint.

ALTER INDEX indexname ALTER COLUMN "the expression" SET STATISTICS 100;

I do see that indexes allow multiple instances of the same expression,
so this approach could be ambiguous.  Or should such repetition be
prohibited as it is with column names?

test=> CREATE TABLE foo (x integer);
CREATE TABLE
test=> CREATE INDEX foo1_idx ON foo (x, x);
ERROR:  duplicate key violates unique constraint "pg_attribute_relid_attnam_index"
test=> CREATE INDEX foo2_idx ON foo (abs(x), abs(x));
CREATE INDEX

-- 
Michael Fuhr


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Expression index ignores column statistics target
Следующее
От: Simon Riggs
Дата:
Сообщение: Re: [PERFORM] A Better External Sort?