Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using wrong index

Status
Not open for further replies.

maesb

Technical User
Mar 25, 2003
30
JP
i've got 2 different users with the same set of database, but when i run the same query on both users, they seem to be using different indexes to run the query. How do i make them use the same index?

Following is my query :
select a.cust,(b.dorq-b.qrtn) as qnty
from soinno a, ptdord b, socrsd c
where a.crid=b.crid and a.dono=b.dono
and b.crid=c.crid and b.refn=c.sono and b.oprt=c.part
and (a.crid>='AA' and a.crid<='ZZ')
and a.pmth >= '10410' and a.pmth <= '10412'
and a.cust not like 'ZZ%' and a.refn not like 'JS%'

one user is running on index with the following field
CRID
DONO

the other user is running on following index
CRID
CUST

 
Hi Musafa,
The database structure of both users are the same as i exported user1 and imported the tables into user2. So i assume the permission should be the same? The only difference i know of is that user1 and user2 are using a different table_space. does that answer your question?
 
Oracle CBO takes into account a lot of parameters thus if that tables contain different data it may choose different plans. BTW is statistics on both tables is up to date? If so and you wish to make execution plans to be the same you may use stored outlines. But I'm about to be sure that this was due to the lack of/outdated statistics on one of the tables.

Regards, Dima
 
Normally when you execute an import, statistics are computed.
So, if your user2 has a better response time, try to update statistics onto user1's objects
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top