Subject Re: [firebird-support] Question about using Indexes (long post)
Author Tomas Michalik
Hi,

Kevin Lingofelter wrote:

> Hello,
>
> I have a procedure that is using an index in one select statement, but not
> the another identical one. The index for the select statement defined in
> lines 63 through 77 is used and as indicated with the following plan:
>
> Plan:
> ----------------------------------------------------------------------------
> ----
> SORT (JOIN (S INDEX (SPECS_IDX1),JOIN (CR INDEX (CROSS_REFERENCE_IDX1),P
> INDEX (PARTS_IDX2))))
>
> The odd thing is that the select statement defined in lines 122 through 136
> (which is identical) does not use an index as indicated with this plan:
>
> Plan:
> ----------------------------------------------------------------------------
> ----
> SORT (JOIN (S INDEX (SPECS_IDX1),JOIN (CR NATURAL,P INDEX (PARTS_IDX2))))
>
> Can someone explain why that is and how I can force FB to use the correct
> index? Thanks a million.

I've seen your recent posts in IBE newsgroups, so I know you are using
it. I guess it might be IBE's fault - it may sometimes show plan that
differs from the one that is actually used on the server. See my today's
post there. (BTW, it is already fixed according to Alexander)

Best regards,
Tom

========================
Tomas Michalik
vyvoj IS

ProCA, spol. s r.o.
V Luzich 818
Praha 4 - Libus
140 00, Czech Republic

tel: +420 234646446
fax: +420 234646120

michalik@...
http://www.proca.cz