Subject | Re: Index Bug |
---|---|
Author | csswa |
Post date | 2002-04-19T17:37:07Z |
--- In ib-support@y..., Helen Borrie <helebor@t...> wrote:
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
> >index1 on fieldA, fieldBperceives
> >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
> in using index1, e.g. by including a fatuous WHERE criterionHelen, 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