Driving Site

Published in Hints, Quick Tips by jsimmons Wednesday January 10, 2007

/*+ DRIVING_SITE([table]) */

Oracle provides us with the powerful feature “database links”. Database links allow for mostly seamless querying of remote databases. These distributed query cause unique performance and tuning issues.

The DRIVING_SITE hint forces query execution at a user selected site rather than at a site selected by the database.

SELECT *
FROM emp e, dept@dev d
WHERE e.deptno = d.deptno;

With Hint

SELECT  /*+ DRIVING_SITE(d) */ *
FROM emp e, dept@dev d
WHERE e.deptno = d.deptno;

With Hint

While this hint has minor performance impact on small remote tables, it can have enormous impact on medium to large tables.

28 queries. 0.249 seconds.
Powered by Wordpress
theme by cmoanz