Problem Statement
Should you rely on optimizer hints to tune queries? When are they appropriate?
Explanation
Hints can force join orders or algorithms, but they lock the plan to today’s data shape. Over time, they may hide underlying issues like missing indexes or bad statistics and can age poorly.
Use hints as a last resort for stable, critical queries after fixing schema and statistics. Document why the hint exists and review it when data distributions change.
Code Solution
SolutionRead Only
-- Example (syntax varies) SELECT /*+ USE_HASH(o c) LEADING(o c) */ ...
Practice Sets
This question appears in the following practice sets:
