mysql 查看执行计划
【摘要】 mysql 可以通过 desc 和 explain 展示sql的执行计划,作用一样的。可以使用的条件: SELECT, DELETE, INSERT, REPLACE, and UPDATE statements.The DESCRIBE and EXPLAIN statements are synonyms. In practice, the DESCRIBE keyword is mor...
mysql 可以通过 desc 和 explain 展示sql的执行计划,作用一样的。
可以使用的条件: SELECT
, DELETE
, INSERT
, REPLACE
, and UPDATE
statements.
The DESCRIBE
and EXPLAIN
statements are synonyms. In practice, the DESCRIBE
keyword is more often used to obtain information about table structure, whereas EXPLAIN
is used to obtain a query execution plan (that is, an explanation of how MySQL would execute a query。
使用说明:
{EXPLAIN | DESCRIBE | DESC}
tbl_name [col_name | wild]
{EXPLAIN | DESCRIBE | DESC}
[explain_type]
{explainable_stmt | FOR CONNECTION connection_id}
explain_type: {
EXTENDED
| PARTITIONS
| FORMAT = format_name
}
format_name: {
TRADITIONAL
| JSON
}
explainable_stmt: {
SELECT statement
| DELETE statement
| INSERT statement
| REPLACE statement
| UPDATE statement
}
参考地址:
https://dev.mysql.com/doc/refman/5.7/en/explain.html
【版权声明】本文为华为云社区用户原创内容,转载时必须标注文章的来源(华为云社区)、文章链接、文章作者等基本信息, 否则作者和本社区有权追究责任。如果您发现本社区中有涉嫌抄袭的内容,欢迎发送邮件进行举报,并提供相关证据,一经查实,本社区将立刻删除涉嫌侵权内容,举报邮箱:
cloudbbs@huaweicloud.com
- 点赞
- 收藏
- 关注作者
评论(0)