MySQL: Explain
#MySQL
https://dev.mysql.com/doc/refman/5.7/en/explain-output.html
id
select_type
table
partitions
type
The type column of EXPLAIN output describes how tables are joined.
possible_keys
使用されうるindexの候補
key
実際に選択されるindex
key_len
選択されたindexの長さ。
長さとは何?
ref
rows
filtered
Extra
https://dev.mysql.com/doc/refman/5.7/en/explain-output.html#explain-extra-information
Using temporary
Using filesort
MySQL must do an extra pass to find out how to retrieve the rows in sorted order. The sort is done by going through all rows according to the join type and storing the sort key and pointer to the row for all rows that match the WHERE clause. The keys then are sorted and the rows are retrieved in sorted order.
See Section 8.2.1.14, “ORDER BY Optimization”.
Using where
https://dba.stackexchange.com/questions/164251/what-is-the-meaning-of-filtered-in-mysql-explain
によるとtype key extra が重要
参考
https://www.slideshare.net/techblogyahoo/mysql-58540246
https://enterprisezine.jp/article/detail/3520?p=4