Table of Contents
目录
- 8.9.1 控制查询计划评估(Controlling Query Plan Evaluation) 【粗翻】
- 8.9.2 调优开关(Switchable Optimizations) 【粗翻】
- 8.9.3 优化器提示(Optimizer Hints)【部分】
- 8.9.4 索引提示(Index Hints)【粗翻】
- 8.9.5 优化器成本模型(The Optimizer Cost Model)
- 8.9.6 优化器统计信息(Optimizer Statistics)
MySQL provides optimizer control through system variables that affect how query plans are evaluated, switchable optimizations, optimizer and index hints, and the optimizer cost model.
The server maintains histogram statistics about column values in the column_statistics
data dictionary table (see Section 8.9.6, “Optimizer Statistics” ). Like other data dictionary tables, this table is not directly accessible by users. Instead, you can obtain histogram information by querying INFORMATION_SCHEMA
.COLUMN_STATISTICS
, which is implemented as a view on the data dictionary table. You can also perform histogram management using the ANALYZE TABLE
statement.
要调整和控制MySQL的优化器, 可以通过查询计划评估方式相关的系统变量、可切换优化、优化器提示和索引提示,以及优化器成本模型来进行。
服务器在 column_statistics
数据字典表中维护关于列值的直方图统计信息(参见 8.9.6 优化器统计信息(Optimizer Statistics) )。 与其他数据字典表一样,用户不能直接访问该表。 但我们可以通过查询 INFORMATION_SCHEMA
.COLUMN_STATISTICS
来获取直方图统计信息, 这是作为数据字典表的视图来实现的。 我们还可以使用 ANALYZE TABLE
语句来进行直方图管理。
https://dev.mysql.com/doc/refman/8.0/en/controlling-optimizer.html