久综合色-久综合网-玖草影视-玖草资源在线-亚洲黄色片子-亚洲黄色片在线观看

Hello! 歡迎來到小浪云!


使用 explain 如何判斷二級(jí)索引使用后是否回表?


使用 explain 如何判斷二級(jí)索引使用后是否回表?

如何使用 explain 判斷二級(jí)索引使用后,是否存在回表操作?

對(duì)于給定的查詢 sql

select     track_source_id,     date_format(created_at, '%y-%m-%d') as day,     count(*) as total_count,     sum(case when len_parse_result_list = 0 then 1 else 0 end) as len_parse_result_list_zero_count,     sum(case when len_parse_result_list is null then 1 else 0 end) as len_parse_result_list_null_count,     sum(case when len_parse_result_list > 0 then 1 else 0 end) as len_parse_result_list_gte_zero_count from     keywordtask where     created_at >= now() - interval 30 day group by     track_source_id,     day order by     track_source_id,     day;
登錄后復(fù)制

其 explain 輸出:

| id | select_type | table | partitions | type | possible_keys | key | key_len | ref | rows | filtered | Extra | | --- | ----------- | ----- | ---------- | ---- | ------------- | --- | ------ | --- | ---- | -------- | ----- | | 1   | SIMPLE      | keywordtask | NULL      | index | idx_created_at,idx_track_source_id_created_at_len_parse_result_list | idx_track_source_id_created_at_len_parse_result_list | 14 | NULL | 134324154 | 50.0 | using where; Using index; Using temporary; Using filesort |
登錄后復(fù)制

是否回表判斷:

通過讀取 extra 列,可以判斷查詢是否回表:

  • using index 表示索引覆蓋,不需要回表。
  • using index condition 表示索引查找,不需要回表過濾。
  • using index & using where 表示索引查找,但需要回表過濾。
  • using where 表示回表查詢數(shù)據(jù)。
  • 主鍵查詢 不回表,但 extra 列無法反映。

對(duì)于給定的查詢,extra 列為 using where; using index; using temporary; using filesort,表明查詢使用了索引 (idx_track_source_id_created_at_len_parse_result_list),但需要回表過濾條件 created_at >= now() – interval 30 day。因此,該查詢會(huì)發(fā)生回表操作。

相關(guān)閱讀

主站蜘蛛池模板: 一极毛片 | 国产一级网站 | 久久久久免费精品视频 | 99视频网址| 免费一级真人毛片 | 欧美日韩精品一区二区 | 超清波多野结衣精品一区 | 性做久久久久久久免费观看 | 国产精品免费看久久久香蕉 | 在线视频自拍 | 成人网18免费软件 | 国产成人99精品免费观看 | 狠狠做久久深爱婷婷97动漫 | 手机看片1024精品国产 | 亚洲精品人成网线在线 | 中文字幕中文字幕中中文 | 亚欧美视频| 国产三级日产三级韩国三级 | 亚洲爆爽| 欧美精品在线一区二区三区 | 97视频在线免费观看 | 一区二区在线欧美日韩中文 | 国产成人黄网址在线视频 | 67id人成国产在线 | 中美日韩在线网免费毛片视频 | 亚洲天堂在线视频观看 | 亚洲成人免费视频在线 | 欧美日韩人成在线观看 | 久久精品国产精品亚洲20 | 亚洲综合成人在线 | 成人看片黄a在线观看 | 欧美韩国日本在线 | 亚欧色| 国产精品亚洲综合久久 | 亚洲精品一区二区三区中文字幕 | 中文字幕亚洲欧美 | 在线观看 国产 | 欧美特一级 | a级精品九九九大片免费看 a级毛片免费观看网站 | 麻豆国产| 91精品国产免费久久久久久青草 |