8.2.1 Optimizing SELECT Statements Speed of SELECT Statements How MySQL Optimizes WHERE Clauses Range Optimization Index Merge Optimization Engine Condition Pushdown Optimization Index Condition Pushdown Optimization Use of Index Extensions IS NULL Optimization LEFT JOIN and RIGHT JOIN Optimization Nested-Loop Join Algorithms Nested Join Optimization Outer Join Simplification Multi-Range Read Optimization Block Nested-Loop and Batched Key Access Joins ORDER BY Optimization GROUP BY Optimization DISTINCT Optimization Subquery Optimization Optimizing LIMIT Queries How to Avoid Full Table Scans

Queries, in the form of SELECT statements, perform all the lookup operations in the database. Tuning these statements is a top priority, whether to achieve sub-second response times for dynamic web pages, or to chop hours off the time to generate huge overnight reports.