Re: Expression index ignores column statistics target - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Expression index ignores column statistics target
Date
Msg-id 9372.1128186998@sss.pgh.pa.us
Whole thread Raw
In response to Re: Expression index ignores column statistics target  (Michael Fuhr <mike@fuhr.org>)
List pgsql-hackers
Michael Fuhr <mike@fuhr.org> writes:
> ALTER INDEX indexname ALTER COLUMN "the expression" SET STATISTICS 100;

Yeah, that could probably be made to work.

> I do see that indexes allow multiple instances of the same expression,
> so this approach could be ambiguous.

I can't think of an actual use for that, though, so we could just ignore
the possible ambiguity.  Or we could have the ALTER update all columns
matching the given expression.

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

Hmm, seems like there should be a more direct check for this ...
        regards, tom lane


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: FW: PGBuildfarm member snake Branch HEAD Status changed
Next
From: Ron Peacetree
Date:
Subject: Re: [PERFORM] A Better External Sort?