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

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久久国产 | 中国嫩模一级毛片 | 欧美黑寡妇特a级做爰 | 日韩一级欧美一级毛片在 | 中文三 级 黄 色 片 | 92精品国产自产在线 | 亚洲日韩视频 | 久久久久久久亚洲精品一区 | 精品99在线观看 | 久久国产三级精品 | 国产亚洲精品成人一区看片 | 日本免费大黄在线观看 | 久久99精品久久久久久h | 日韩精品中文字幕在线 | 国产成人精品免费视频大全办公室 | 在线免费看a| 日本美女黄网站 | 成人深夜福利在线播放不卡 | 成年大片免费视频播放手机不卡 | 国产精品亚洲欧美 | 国产成人91精品 | 男女性生活网站 | 97视频免费观看2区 97视频免费上传播放 | 国产大臿蕉香蕉大视频女 | 精品欧美日韩一区二区 | 亚洲欧美视屏 | 亚洲欧美日韩国产综合 | 亚洲天堂视频在线观看 | 特级av毛片免费观看 | vr18成人资源 | 免费国产a | 精品国语_高清国语自产 | 一区二区三区 日韩 | 在线播放亚洲美女视频网站 | 精品国产区 | 毛片韩国| pgone太大了兽王免费视频 | 日韩国产一区二区 |