Saturday, March 8, 2014

DRIVING_SITE Hint

If we are joining local table with remote table, then by default, execution will happens at locally, and optimizer wont utilize remote table statistics, it will do full table scan.
  
The DRIVING_SITE hint lets you specify the site where the query execution is performed.  It is best to let cost-based optimization determine where the execution should be performed, but if you prefer to override the optimizer, you can specify the execution site manually.


Example: 

SELECT /*+ DRIVING_SITE(dept)*/ * FROM emp, dept@remote.com dept
WHERE emp.deptno = dept.deptno;

No comments:

Post a Comment