2023/05/31

mysql explain select

 ## explain select

- access_type:
- all(全件検索)/index(indexの全件検索)はfull-scanであり、要注意。
- indexはallより良い。
- possible_keys: 使用可能なindex(primary-key is index)
- key: 実際使ったindex
- ref: indexのKeyと比較するcolumn
- patition: 使ったpatition. patationは何?大きなテーブルを分解すること
- patitionは使えるかも!
- 分解のtypeは:RANGE,LIST,HASH,KEY
- rows: 大体の件数を推測した結果
- filtered: 条件が効いて、次の層に行く件数の割合。小さい方が良い。