Subject | Using NATURAL plan instead of index - why? |
---|---|
Author | Maya Opperman |
Post date | 2012-10-31T08:14:32Z |
Hi,
This is really weird.
I cannot see why a NATURAL plan is being used instead of my index, I am not doing anything fancy.
Using: FB2.5.1 32 bit classic server
Query:
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....
Table has 1.4 million records.
Query does 1.4 million non-indexed reads, and takes 11 to 20 seconds to return no records (for the parameters I have selected)
My development database DOES use the index.
Please help! Is this a bug, or am I missing something!
How can I force it to use the index, to see if it is any faster?
Thanks
Maya
[Non-text portions of this message have been removed]
This is really weird.
I cannot see why a NATURAL plan is being used instead of my index, I am not doing anything fancy.
Using: FB2.5.1 32 bit classic server
Query:
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....
Table has 1.4 million records.
Query does 1.4 million non-indexed reads, and takes 11 to 20 seconds to return no records (for the parameters I have selected)
My development database DOES use the index.
Please help! Is this a bug, or am I missing something!
How can I force it to use the index, to see if it is any faster?
Thanks
Maya
[Non-text portions of this message have been removed]