Subject RE: [firebird-support] Re: Using NATURAL plan instead of index - why?
Author Maya Opperman
>> select t.SalesOrderNo from stk_stocktransaction t where (t.SourceType
>> = 34) and (t.TransactionType = 'EXTCST') and (t.RefNo = 'I00001')
>>
> >Plan is:
> >PLAN (T NATURAL)
>>
> >Yet I have the following index: SourceType, TransactionType, RefNo asc
>>
> >With selectivity: 0.0000049....

>There are only two possible explanations:

>a) index is inactive (check RDB$INDEX_INACTIVE in RDB$INDICES for this
>index)
>or
>b) Column SourceType is non-numeric (char or varchar)


Thanks for the ideas, Dmitry.

It is active, and SourceType is an integer. (you did make me go look with my heart racing!)

I also ran a database validation, in case the index was corrupt - nothing





------------------------------------

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Visit http://www.firebirdsql.org and click the Resources item
on the main (top) menu. Try Knowledgebase and FAQ links !

Also search the knowledgebases at http://www.ibphoenix.com

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Yahoo! Groups Links