Summary (Contd.)
Over time, indexes have to be fine-tuned (dropped, created, re-built, ...) for performance.
- Should determine the plan used by the system, and adjust the choice of indexes appropriately.
System may still not find a good plan:
- Only left-deep plans considered!
- Null values, arithmetic conditions, string expressions, the use of ORs, etc. can confuse an optimizer.
So, may have to rewrite the query/view:
- Avoid nested queries, temporary relations, complex conditions, and operations like DISTINCT and GROUP BY.