Replacing optimization hints
Complete these optional tasks in order to reduce or eliminate the use of optimization hints in your queries.
About this task
The situation can arise in which you want to reduce or eliminate the use of optimization hints in your queries. Some of the reasons for this include maintenance overhead, inflexibility, the possibility of overriding better plans, and others.
Db2ZAI 1.6.0 provides a couple of methods to achieve that goal.
(Method 1) Using the access path exploration process to replace optimization hints:
Procedure
This method compares the currently-hinted access path to other potential access paths. If a better performing access path is found, a recommendation will be made to switch to that access path.
By deploying the recommended access path, the deployed access path has priority over the hinted access path. This allows the hinted access path to be removed.
(Method 2) Using the access path lock feature to replace optimization hints
Procedure
This method uses the access path lock feature to lock in the current access path. The current access path should be the hinted access path, if the optimization hint has been successfully applied by Db2®. If the optimization hint has not been successfully applied by Db2, then it cannot be replaced using this method.