Company
Date Published
Author
Savannah Longoria
Word count
2732
Language
English
Hacker News points
170

Summary

The text discusses the use of EXPLAIN, a keyword in MySQL used to gain information about query execution. It explains how to utilize EXPLAIN to remedy problematic queries and provides an overview of its features, including SELECT_TYPE, table on which the query was running, partitions accessed by the query, types of JOINs used, indexes from which MySQL could choose, and actual costs of individual iterators in the execution plan. The text also introduces EXPLAIN ANALYZE, a new concept built on top of regular EXPLAIN, which provides additional information such as estimated execution cost, estimated number of returned rows, time to return first row, and time spent executing each iterator. It highlights when to use MySQL EXPLAIN or EXPLAIN ANALYZE, including using it for query optimizations, designing indexes, and identifying potential performance issues. The text also covers the limitations of EXPLAIN, such as not providing information about triggers, stored procedures, or UDFs, and discusses the EXTRA column in EXPLAIN output, which contains extra information that doesn't fit into other columns. Finally, it provides a hands-on example of how to use MySQL EXPLAIN for query optimizations using a multi-column index.