37.3. Using SHOW WARNINGS for OptimizationThe SHOW WARNINGS statement displays diagnostic messages produced by statements that encounter execution abnormalities. (See Section 21.2, "The SHOW WARNINGS Statement.") It's not an analysis tool in the same sense as EXPLAIN because it doesn't provide information about the optimizer. Rather, it can serve to identify statements that may simply be unnecessary. For example, DROP TABLE IF EXISTS produces a warning if the table does not exist. It's true that eliminating a single statement of this kind is likely to provide only a minimal gain in application performance. However, in the case that an application has a bug or is misdesigned, it might indeed be issuing large numbers of unnecessary statements, and use of SHOW WARNINGS can help you diagnose this. |