The EXPLAIN command is the essential tool for determining the Query Execution Plan (QEP) of the SQL statement you intend to run. This command offers insight to the MySQL cost-based optimizer and provides details about access strategies the optimizer might have considered and what strategy the optimizer is expected to choose when running the SQL statement. It is important to realize that the generated QEP is not guaranteed and may can change, depending on several factors. MySQL offers no way to pin a QEP for a given query, and the QEP is determined for every execution of a SQL statement.
This information was presented in 2011. While the foundations of this presentation are still applicable today (2021) with MySQL, there are significant improvements in the MySQL optimizer, the QEP information available and additional tools and commands to optimize your SQL statements.