Re: [HACKERS] Expression index ignores column statistics target

2005-10-01 Thread Tom Lane
I wrote: I seem to recall bringing up the question of whether we could find a less implementation-specific way of commanding this behavior, but I can't find it in the archives right now. Ah, here it is: http://archives.postgresql.org/pgsql-hackers/2004-03/msg00502.php No responses :-(

Re: [HACKERS] Expression index ignores column statistics target

2005-10-01 Thread Michael Fuhr
On Sat, Oct 01, 2005 at 02:19:06AM -0400, Tom Lane wrote: I wrote: I seem to recall bringing up the question of whether we could find a less implementation-specific way of commanding this behavior, but I can't find it in the archives right now. Ah, here it is:

Re: [HACKERS] Expression index ignores column statistics target

2005-10-01 Thread Tom Lane
Michael Fuhr [EMAIL PROTECTED] writes: On Sat, Oct 01, 2005 at 02:19:06AM -0400, Tom Lane wrote: Ah, here it is: http://archives.postgresql.org/pgsql-hackers/2004-03/msg00502.php Would an ALTER INDEX SET STATISTICS form be possible? It's not so much the table/index misnomer that's bothering

Re: [HACKERS] Expression index ignores column statistics target

2005-10-01 Thread Michael Fuhr
On Sat, Oct 01, 2005 at 02:42:32AM -0400, Tom Lane wrote: Michael Fuhr [EMAIL PROTECTED] 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

Re: [HACKERS] Expression index ignores column statistics target

2005-10-01 Thread Bruce Momjian
Tom Lane wrote: Michael Fuhr [EMAIL PROTECTED] writes: I've noticed that row count estimates for expression indexes appear to rely on default_statistics_target rather than on a column's actual statistics target. That is, if I use ALTER TABLE SET STATISTICS to increase a column's

Re: [HACKERS] Expression index ignores column statistics target

2005-10-01 Thread Tom Lane
Michael Fuhr [EMAIL PROTECTED] 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

[HACKERS] Expression index ignores column statistics target

2005-09-30 Thread Michael Fuhr
I've noticed that row count estimates for expression indexes appear to rely on default_statistics_target rather than on a column's actual statistics target. That is, if I use ALTER TABLE SET STATISTICS to increase a column's statistics target and then run ANALYZE, then estimates for

Re: [HACKERS] Expression index ignores column statistics target

2005-09-30 Thread Bruce Momjian
This is expected. The main TODO items is: * Allow accurate statistics to be collected on indexes with more than one column or expression indexes, perhaps using per-index statistics Basically, we don't have multi-column or expression statistics. ANALYZE just analyzes

Re: [HACKERS] Expression index ignores column statistics target

2005-09-30 Thread Tom Lane
Michael Fuhr [EMAIL PROTECTED] writes: I've noticed that row count estimates for expression indexes appear to rely on default_statistics_target rather than on a column's actual statistics target. That is, if I use ALTER TABLE SET STATISTICS to increase a column's statistics target and then

Re: [HACKERS] Expression index ignores column statistics target

2005-09-30 Thread Michael Fuhr
On Fri, Sep 30, 2005 at 11:59:26PM -0400, Bruce Momjian wrote: This is expected. The main TODO items is: * Allow accurate statistics to be collected on indexes with more than one column or expression indexes, perhaps using per-index statistics Basically, we don't have

Re: [HACKERS] Expression index ignores column statistics target

2005-09-30 Thread Michael Fuhr
On Sat, Oct 01, 2005 at 12:53:03AM -0400, Tom Lane wrote: The code does in fact honor per-column statistics targets attached to expression indexes, viz alter table myfuncindex alter column pg_expression_1 set statistics 100; Aha -- that's the piece I didn't know about. I was wondering where