4. What can you tell from
this output produced by the EXPLAIN
command?
+----+-------------+------------+-------+---------------+---------+...
| id | select_type | table | type | possible_keys | key |...
+----+-------------+------------+-------+---------------+---------+...
| 1 | SIMPLE | supervisor | const | PRIMARY | PRIMARY |...
| 1 | SIMPLE | student | ALL | NULL | NULL |...
| 1 | SIMPLE | supervises | index | NULL | PRIMARY |...
+----+-------------+------------+-------+---------------+---------+...
... +---------+-------+------+------------------------------------+
... | key_len | ref | rows | Extra |
... +---------+-------+------+------------------------------------+
... | 4 | const | 1 | Using index Using temporary |
... | NULL | NULL | 95 | |
... | 12 | NULL | 570 | Using where Using index Distinct |
... +---------+-------+------+------------------------------------+
3 rows inset sec. What can you tell from this output produced by the
EXPLAIN
command?
+-----+--------------+------------+--------+---------------+---------+---------+...
| id | select_type | table | type | possible_keys | key | key_len |...
+-----+--------------+------------+--------+---------------+---------+---------+...
| 1 | PRIMARY | played | index | PRIMARY | PRIMARY | 10 |...
| 1 | PRIMARY | track | eq_ref | PRIMARY | PRIMARY | 6 |...
| 2 | UNION | played | index | PRIMARY | PRIMARY | 10 |...
| 2 | UNION | track | eq_ref | PRIMARY | PRIMARY | 6 |...
| NULL UNION RESULT |
| ALL | | | |...
+-----+--------------+------------+--------+---------------+---------+---------+...
...+--------------------------------------------------------------------+------+...
...| ref | rows |...
...+--------------------------------------------------------------------+------+...
...| | 12 |...
...| music.played.artist_id,music.played.album_id,music.played.track_id | 1 |...
...| | 12 |...
...| music.played.artist_id,music.played.album_id,music.played.track_id | 1 |...
...| | NULL |...
...+--------------------------------------------------------------------+------+...
...+-----------------------------+
...| Extra |
...+-----------------------------+
...| Using index Using filesort |
...| |
...| Using index Using filesort |
...| |
...| |
...+-----------------------------+
5 rows inset sec)
Share with your friends: