Subject | RE: [firebird-support] Re: Using NATURAL plan instead of index - why? |
---|---|
Author | Maya Opperman |
Post date | 2012-10-31T09:00:58Z |
>> select t.SalesOrderNo from stk_stocktransaction t where (t.SourceTypeThanks for the ideas, Dmitry.
>> = 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)
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