Subject RE: [ib-support] Problem with plan selection - doesn't seem right (Resubmit)
Author Leyne, Sean
> When I run the following SQL it uses the plan below:
>
> select max(od_seqnum)
> from ordersd
> where od_om_id = 25433
>
> -------------------------------------------------------------------
> The Plan:
>
> PLAN (ORDERSD INDEX (ORDERSDBYINVOICEM))
> -------------------------------------------------------------------
> Shouldn't it be using the "OrdersdBySeqnum" index, that one
> is decending and on the fields being accessed? Why doesn't it?

No, the index ORDERSDBYINVOICEM is the best fit, given the selectivity
of the OD_ID column (unique!).


> Is there a way to specify a plan in a trigger?

No, not with IB (any version) or FB v1.0. A recent change for FB v1.5
allows PLAN is triggers -- I would not recommend it, though.


Sean