Image

2

The Essential Analysis Commands

No single tool or command in MySQL will identify optimizations for SQL statements. The following SQL commands help identify areas of possible SQL optimization techniques, including creating indexes; however, these will not tell us which technique to apply. The art of SQL optimization requires a human to interpret the facts and deduce one or more optimal solutions. You have already seen a number of these commands in action in Chapter 1.

The following SQL commands will be outlined in this chapter:

• EXPLAIN

• SHOW CREATE TABLE

• SHOW INDEXES

• SHOW TABLE STATUS

• SHOW STATUS

• SHOW VARIABLES

EXPLAIN

The EXPLAIN ...

Get Effective MySQL Optimizing SQL Statements now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.