判斷回表操作:explain 分析
根據你的問題,你可以通過 explain 的 extra 字段來判斷查詢是否存在回表操作。
extra 字段解釋:
- using index:使用索引覆蓋,查詢字段全部在索引中,不需要回表。
- using index condition:使用索引查找,但需要根據過濾條件判斷,也不需要回表。
- using index with where: 使用索引,但需要根據 where 條件過濾,需要回表。
案例分析:
你提供的 explain 輸出中,extra 為:
Using where; Using index; Using temporary; Using filesort
登錄后復制
由于 extra 中包含 “using where”,這意味著查詢需要回表操作。
結論:
因此,根據 explain 分析的結果,你的查詢還存在回表操作。