解释mysql中的VS Desc异常 [英] Explain Vs Desc anomalies in mysql

查看:104
本文介绍了解释mysql中的VS Desc异常的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

MySQL中EXPLAIN和DESC命令之间有什么区别?

What are the differences between EXPLAIN and DESC commands in MySQL ?

推荐答案

  • 解释会给您更多 有关查询的信息,
  • 描述将为您提供更多 有关表或列的信息.
    • Explain will give you more information about a query,
    • describe will give you more information about tables or columns.
    • 您还可以在表名上使用EXPLAIN,在这种情况下,它的行为将与DESCRIBE完全相同.

      You can also use EXPLAIN on a table name, in which case it will behave exactly like DESCRIBE.

      EXPLAIN SELECT * 
      FROM `customer`
      
      id  select_type  table  type  possible_keys  key  key_len  ref  rows  Extra 
      1 SIMPLE customer ALL NULL NULL NULL NULL 2 
      

      vs.

      DESCRIBE `customer`
      Field  Type  Null  Key  Default  Extra 
      CustomerID varchar(2) NO      
      Cx varchar(3) NO   
      

      这篇关于解释mysql中的VS Desc异常的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆