利用explain查看sql语句的执行计划

 可以查看是不是能优化查询

explain select * from student where dept='shuxue' \G;
*************************** 1. row ***************************
           id: 1
  select_type: SIMPLE
        table: student
   partitions: NULL
         type: ref
possible_keys: index_drop
          key: index_drop
      key_len: 11
          ref: const
         rows: 1
     filtered: 100.00
        Extra: Using where
1 row in set, 1 warning (0.00 sec)

ERROR: 
No query specified

 

 

posted @ 2022-02-23 19:02  闲着没事学学习  阅读(50)  评论(0)    收藏  举报