I have two databases on one the index I like is getting used on the other it uses a different index.
and record_date > sysdate - 10
order by upper(name)
I have a FBI on name and another index on record_date.
In one database
(lets call it Database1) the query uses the date index
(on the other Database2) it uses the FBI.
Infact it seems to like the FBI on the second database most of the time ; even when the query changes to have a different filter condition that is indexed.
The dataset is identical
Both database were analyzed.
Both have same init parameters
Database 1 is on 22.214.171.124
Database 2 on 126.96.36.199
Any help is greatly appreciated
03-14-2005, 07:11 AM
Does both the database have the same set of records?
03-14-2005, 07:27 AM
Sorry i missed the your comment
"The dataset is identical"
03-14-2005, 08:50 AM
Try searching metalink for changes to the CBO between the two versions you are using.
03-15-2005, 02:11 PM
bug in 188.8.131.52
ALTER SESSION SET "_SORT_ELIMINATION_COST_RATIO"=5.
-- The above statement directs the CBO to consider a plan with ORDER BY sort elimination as long as the plan is no more expensive than 5 times the cost of the best known plan (that uses sort).
-- The parameter can be set to any non-negative integer.