解释mysql中的Vs Desc异常

解释mysql中的Vs Desc异常,mysql,sql-execution-plan,describe,Mysql,Sql Execution Plan,Describe,MySQL中EXPLAIN和DESC命令之间有什么区别? 会给你更多 有关查询的信息 会给你更多 有关表或列的信息 您还可以对表名使用EXPLAIN,在这种情况下,它的行为将与descripe完全相同 EXPLAIN SELECT * FROM `customer` id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE customer ALL NULL NULL NULL

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

  • 会给你更多 有关查询的信息
  • 会给你更多 有关表或列的信息
您还可以对表名使用EXPLAIN,在这种情况下,它的行为将与descripe完全相同

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