The following SQL is simple, but the explain plan is a little bit complex. Oracle SQL optimizer uses an adaptive plan to execute the SQL statement. You can see the SQL’s syntax is normal, there is not much syntax rewrite which can be helpful to improve the SQL speed manually. The emps_salary index of employees and emps_dept index of departments are both used in a proper way. The SQL takes 12.45 seconds to finish, it still seems longer than what I expected....
A SQL example to show why traditional SQL rewrite tuning may not be applicable
A SQL example to show why traditional SQL rewrite tuning may not be applicable