Subject Re: [firebird-support] optimizing query
Author Edwin Pratomo
On Thursday 17 July 2003 17:45, Svein Erling Tysvaer wrote:
> What a great example to show what I just answered! Your problem is that MT
> is using two indexes - even though one of them is unique! Change your
> select to
..
> 16:31:59' AND (mt.smsc = 'foo' or 2=0)

Excellent!

and the query plan is now
PLAN SORT (JOIN (DLR DLR INDEX (DLR_STATUS_IDX),MT MT INDEX (RDB$PRIMARY29),T
INDEX (RDB$PRIMARY24)))

Next question: how do we know that an index is selective enough to be used in
a query plan?

Thanks a lot!

rgds,
Edwin.