Subject Re: Index Bug
Author csswa
--- In ib-support@y..., Helen Borrie <helebor@t...> wrote:

> >index1 on fieldA, fieldB
> >index2 on fieldA, fieldC
> >
> >fieldB is varchar (20) and fieldC is numeric (18, 0)
> >when I do a select statement like
> >
> >select * from tableA
> >where fieldA = :val1 and
> > fieldC = :val2
> >
> >I expect it to use index2, but for some reason it uses index1. I


> What's commonly done is to disable the "usefulness" the optimizer
perceives
> in using index1, e.g. by including a fatuous WHERE criterion

Helen, can you elaborate on what aspect the optimizer sees as most
useful in choosing the 'wrong' index? I know the optimizer can get
confused, but this seems like an entirely braindead thing to do.
This is some kind of problem with the optimizer not properly
evaluating the available indexes?

Regards,
Andrew Ferguson