Explain Vs Desc anomalies in mysql

末鹿安然 提交于 2019-11-30 04:55:00

问题


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


回答1:


  • Explain will give you more information about a query,
  • describe will give you more information about tables or columns.

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   


来源:https://stackoverflow.com/questions/3100247/explain-vs-desc-anomalies-in-mysql

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!