当前位置: 首页 > MySQL数据库

mysql执行计划知识点有哪些

时间:2026-01-28 14:10:54

The DESCRIBE and EXPLAIN statements are synonyms, used either to obtain information about table structure or query execution plans.

DESCRIBE和EXPLAIN语句是同义词,用于获得表结构信息和SQL语句的执行计划。

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). The following discussion uses the DESCRIBE and EXPLAIN keywords in accordance with those uses, but the MySQL parser treats them as completely synonymous.

DESCRIBE和EXPLAIN语句是同义词,实际上在平时使用过程中DESCRIBE多用于获取表结构的信息,然后EXPLAIN多用于获取SQL语句的执行计划。MySQL解析器对这两个语句是完全作为同义词对待的。

mysql> desc mysql.plugin;

+-------+--------------+------+-----+---------+-------+

| Field | Type         | Null | Key | Default | Extra |

+-------+--------------+------+-----+---------+-------+

| name  | varchar(64)  | NO   | PRI |         |       |

| dl    | varchar(128) | NO   |     |         |       |

+-------+--------------+------+-----+---------+-------+

2 rows in set (0.00 sec)


mysql> explain mysql.plugin;

+-------+--------------+------+-----+---------+-------+

| Field | Type         | Null | Key | Default | Extra |

+-------+--------------+------+-----+---------+-------+

| name  | varchar(64)  | NO   | PRI |         |       |

| dl    | varchar(128) | NO   |     |         |       |

+-------+--------------+------+-----+---------+-------+

2 rows in set (0.00 sec)


mysql> desc select * from mysql.plugin;

+----+-------------+--------+--------+---------------+------+---------+------+------+---------------------+

| id | select_type | table  | type   | possible_keys | key  | key_len | ref  | rows | Extra               |

+----+-------------+--------+--------+---------------+------+---------+------+------+---------------------+

|  1 | SIMPLE      | plugin | system | NULL          | NULL | NULL    | NULL |    0 | const row not found |

+----+-------------+--------+--------+---------------+------+---------+------+------+---------------------+

1 row in set (0.07 sec)


mysql> explain select * from mysql.plugin;

+----+-------------+--------+--------+---------------+------+---------+------+------+---------------------+

| id | select_type | table  | type   | possible_keys | key  | key_len | ref  | rows | Extra               |

+----+-------------+--------+--------+---------------+------+---------+------+------+---------------------+

|  1 | SIMPLE      | plugin | system | NULL          | NULL | NULL    | NULL |    0 | const row not found |

+----+-------------+--------+--------+---------------+------+---------+------+------+---------------------+

1 row in set (0.00 sec)


  • 英特尔与 Vertiv 合作开发液冷 AI 处理器
  • 英特尔第五代 Xeon CPU 来了:详细信息和行业反应
  • 由于云计算放缓引发扩张担忧,甲骨文股价暴跌
  • Web开发状况报告详细介绍可组合架构的优点
  • 如何使用 PowerShell 的 Get-Date Cmdlet 创建时间戳
  • 美光在数据中心需求增长后给出了强有力的预测
  • 2027服务器市场价值将接近1960亿美元
  • 生成式人工智能的下一步是什么?
  • 分享在外部存储上安装Ubuntu的5种方法技巧
  • 全球数据中心发展的关键考虑因素
  • 英特尔与 Vertiv 合作开发液冷 AI 处理器

    英特尔第五代 Xeon CPU 来了:详细信息和行业反应

    由于云计算放缓引发扩张担忧,甲骨文股价暴跌

    Web开发状况报告详细介绍可组合架构的优点

    如何使用 PowerShell 的 Get-Date Cmdlet 创建时间戳

    美光在数据中心需求增长后给出了强有力的预测

    2027服务器市场价值将接近1960亿美元

    生成式人工智能的下一步是什么?

    分享在外部存储上安装Ubuntu的5种方法技巧

    全球数据中心发展的关键考虑因素