Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> Re: DB Links
I found this by searching metalink for driving_site:
This also answer Kevin question about joins over dblink.
From: Melanie Kiburtz 10-Aug-04 18:19
Subject: Re : performance of joins over a dblink
The whole issue with remote joins has to do with the fact that oracle will
NOT utilize remote indices if the join is executed locally. So, in the case
where you have a local small table joined with a remote large table, the
entire remote table (referenced columns) is sent to the local db for joining
activity. Local indices can be used for the local tables. So this is why the
'remote reverse query' method is used. By setting up the appropriate views,
synonyms and dblinks to force the query to actually be executed on the
remote db performance can be dramatically improved. The forcing of the query
to execute on the remote db, the small table is then sent to the remote db
for the join function. Since the sql is actually executed on the remote db,
the remote db is the 'local db' for the query execution and therefore can
utilize the indices for table on that db. The small table would NOT utilize
indices in this case.
Does it work? Yes and extremely well as long as there is a significant
difference in the sizes of the tables and indices are actually used. Keep in
mind that either the optimizer or by virtue of the sql code itself, the
'desired' index may not be used unless hints are employed. You will need to
carefully examine the explain plans.
Another option with 9i is the following pasted info which eliminates the need to mess with views, synonyms etc yourself. For 3rd party software you could create a synonyms or view locally that induces the hint or you could use OUTLN to force the plan:
the above was pasted from the 9i Database Performance Tuning Guide and Reference manual
Melanie Kiburtz
DBA
Oregon, USA
Yechiel Adar
Mehish
-- http://www.freelists.org/webpage/oracle-lReceived on Thu Sep 23 2004 - 07:37:17 CDT
![]() |
![]() |