May 2020
Beginner
564 pages
14h 9m
English
There is a simple way to see how MySQL will run your query, and that is to append EXPLAIN to the front of your query. For example, you can see EXPLAIN being used in the following query:
USE lahmansbaseballdb;EXPLAIN SELECT playerid, g_all, g_batting, g_defense FROM appearances;
What EXPLAIN will do is give you a table of information about how it's going to run the query. The previous query will give you the results shown in the following screenshot:
Let's go through what each of these columns means:
Read now
Unlock full access