The following is an example shows a SQL statement with two potential table join paths. “Employee to Department” and “Department to Employee” are potential driving paths which will be decided by MySQL SQL optimizer during SQL optimization stage.
select emp_id,emp_name,dpt_avg_salary
from employee ,department
where emp_dept=dpt_id
Here the following is the query plan selected by MySQL SQL optimizer in Tosska proprietary...
How to Tune SQL Statement with Driving Path Control for MySQL?
select emp_id,emp_name,dpt_avg_salary
from employee ,department
where emp_dept=dpt_id
and emp_dept like 'A%'
and dpt_id like 'A%';
and dpt_id like 'A%';
Here the following is the query plan selected by MySQL SQL optimizer in Tosska proprietary...
How to Tune SQL Statement with Driving Path Control for MySQL?