What is the meaning of the order of statements in mysql explaining the output?

This is the mysql explain plan for one of the queries I'm looking at.

+----+-------------+--------+-------+---------------+---------+---------+------+------+-------+ | id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra | +----+-------------+--------+-------+---------------+---------+---------+------+------+-------+ | 1 | SIMPLE | table2 | index | NULL | PRIMARY | 4 | NULL | 6 | | | 1 | SIMPLE | table3 | ALL | NULL | NULL | NULL | NULL | 23 | | | 1 | SIMPLE | table1 | ALL | NULL | NULL | NULL | NULL | 8 | | | 1 | SIMPLE | table5 | index | NULL | PRIMARY | 4 | NULL | 1 | | +----+-------------+--------+-------+---------------+---------+---------+------+------+-------+ 

4 lines per set (0 sec)

What is the meaning of the order of expressions in this release? Does this mean that table5 is read before everyone else?

+7
mysql sql-execution-plan
source share
1 answer

The tables are listed in the output in the order that MySQL will read them when processing the request. You can learn more about the release of the explanation plan here .

In addition, the conclusion tells me:

  • The optimizer saw that the query contained four (4) SELECT statements. Being a β€œsimple” type of selection, these queries do not use UNION or subqueries.
  • Two of these operators can use indexes (based on the type column) that were primary keys (based on the key column). The other two could not use any indexes.
+4
source share

All Articles