Re: [HACKERS] How does the planner deal with multiple possible indexes?

2006-07-21 Thread Tom Lane
"Jim C. Nasby" <[EMAIL PROTECTED]> writes: > No, this is 8.1.3, and it's a production machine so I'd prefer not to go > about dropping indexes to get cost comparisons; unless there's some way > to disable the use of an index in a given backend? The traditional hack for that is beg

Re: [HACKERS] How does the planner deal with multiple possible indexes?

2006-07-21 Thread Jim C. Nasby
On Wed, Jul 19, 2006 at 07:54:49PM -0400, Tom Lane wrote: > "Jim C. Nasby" <[EMAIL PROTECTED]> writes: > > Indeed, if I find a case where there's a large enough number of rows it > > will choose the smaller index. But I'm wondering if it would be better > > to always favor the smaller index, since

Re: [HACKERS] How does the planner deal with multiple possible indexes?

2006-07-19 Thread Tom Lane
"Jim C. Nasby" <[EMAIL PROTECTED]> writes: > Indeed, if I find a case where there's a large enough number of rows it > will choose the smaller index. But I'm wondering if it would be better > to always favor the smaller index, since it would (presumably) be easier > to keep it in cache? AFAICS, in

Re: [HACKERS] How does the planner deal with multiple possible indexes?

2006-07-19 Thread Jim C. Nasby
On Wed, Jul 19, 2006 at 07:00:40PM -0400, Tom Lane wrote: > "Gregory Maxwell" <[EMAIL PROTECTED]> writes: > > On 7/19/06, Jim C. Nasby <[EMAIL PROTECTED]> wrote: > > [snip] > >> \d does list bdata__ident_filed_departure before bdata_ident; I'm > >> wondering if the planner is finding the first inde

Re: [HACKERS] How does the planner deal with multiple possible indexes?

2006-07-19 Thread Tom Lane
"Gregory Maxwell" <[EMAIL PROTECTED]> writes: > On 7/19/06, Jim C. Nasby <[EMAIL PROTECTED]> wrote: > [snip] >> \d does list bdata__ident_filed_departure before bdata_ident; I'm >> wondering if the planner is finding the first index with ident_id in it >> and stopping there? >> From my own experie

Re: [HACKERS] How does the planner deal with multiple possible indexes?

2006-07-19 Thread Gregory Maxwell
On 7/19/06, Jim C. Nasby <[EMAIL PROTECTED]> wrote: [snip] \d does list bdata__ident_filed_departure before bdata_ident; I'm wondering if the planner is finding the first index with ident_id in it and stopping there? From my own experience it was grabbing the first that has the requested fiel

[HACKERS] How does the planner deal with multiple possible indexes?

2006-07-19 Thread Jim C. Nasby
Client has a table with 9 indexes; one is on just ident_id and takes up 75181 pages, the other is on ident_id and another field and uses 117461 pages. "bdata__ident_filed_departure" btree (ident_id, filed_departuretime), tablespace "array4" "bdata_ident" btree (ident_id), tablespace "array4"