EXPLAIN

This lesson demonstrates the usage of the EXPLAIN statement.

We'll cover the following

EXPLAIN

In this lesson, we’ll make a brief introduction to the EXPLAIN statement. The EXPLAIN statement is sort of a dry-run of your query or the blueprint/plan of how the server plans to execute your query. Generally, when complicated queries exhibit performance degradation, we can use the EXPLAIN statement to seek and identify bottlenecks. This lesson is not a comprehensive treatment of query optimization, rather just a light and general introduction to a vast subject.

Note that EXPLAIN and DESCRIBE are synonyms, however, as a convention EXPLAIN is used with queries whereas DESCRIBE is with structures.

Syntax

EXPLAIN <SQL Statement>;

Connect to the terminal below by clicking in the widget. Once connected, the command line prompt will show up. Enter or copy and paste the command ./DataJek/Lessons/40lesson.sh and wait for the MySQL prompt to start-up.

Get hands-on with 1400+ tech skills courses.