I was recently trying to tune one of my process that is working with a database link. The process is to insert datas based on a join using a small local table and a distant big one. The problem i was hitting was that because Oracle does not have enough information on the distant table it was sending me back all rows from the distant table.
After some research i found on the Oracle documentation (http://docs.oracle.com/cd/B28359_01/server.111/b28286/sql_elements006.htm#BABEGIJC)
DRIVING_SITE hint instructs the optimizer to execute the query at a different site than that selected by the database. This hint is useful if you are using distributed query optimization.
SELECT /*+ DRIVING_SITE(departments) */ * FROM employees, departments@rsite WHERE employees.department_id = departments.department_id;
If this query is executed without the hint, then rows from
departments are sent to the local site, and the join is executed there. With the hint, the rows from
employees are sent to the remote site, and the query is executed there and the result set is returned to the local site.
But after doing some tests my statment was still retrieving locally the distant table. So i have continue my research and finally found this article on metalink Limitations of DRIVING_SITE Hint [ID 825677.1] that says
« So keep in mind when using the DRIVING_SITE hint this is merely for query optimization and not intended for DML or DDL. »
So this hint can be usefull in some case but not in mine…
Hope this will help.