What are the differences between EXPLAIN and DESC commands in MySQL ?
Explain Vs Desc anomalies in mysql
Asked Answered
- 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
dev.mysql.com/doc/refman/8.0/en/explain.html says "The DESCRIBE and EXPLAIN statements are synonyms." And "the MySQL parser treats them as completely synonymous." –
Vaivode
© 2022 - 2024 — McMap. All rights reserved.