EXPLAIN clause
The EXPLAIN clause is used to explain the plan used for a query. It is particularly useful when you want to understand how a query is executed and how it is optimized by the database.
When EXPLAIN is used, the statement returns an explanation, essentially revealing the execution plan to provide transparency and understanding of the query performance.
Syntax
Using the EXPLAIN clause in addition to the FULL keyword is expeciallly useful when you want to understand the performance of a query and can provide more details when debugging.
Examples
For example, consider the performance of the following query when the field email is not indexed. We can see that the execution plan will iterate over the whole table.
On the other hand, here is the result when the field email is indexed. We can see that the execution plan will use the index to retrieve the record.