8.4 中文镜像

MySQL 8.4 参考手册 · 中文镜像

正文为中文,英文原文默认隐藏。点击任意中文段落即可展开 / 收起对应英文原文。

打开官方英文原文 ↗

译文由机器翻译生成,仅供理解参考;有疑问请以官方英文原文为准。

MySQL 8.4 参考手册 / 10 优化 / 10.9 控制查询优化器
中文点击中文段落可显示 / 隐藏英文原文本页译文覆盖 100%

10.9 控制查询优化器10.9 Controlling the Query Optimizer

MySQL 通过系统变量提供优化器控制,这些变量影响查询计划的评估,还可以切换优化、使用优化器和索引提示,以及优化器成本模型。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.

服务器在 column_statistics 数据字典表中维护有关列值的直方图统计信息(参见 第 10.9.6 节,“优化器统计信息”)。与其他数据字典表类似,用户无法直接访问此表。相反,您可以通过查询 INFORMATION_SCHEMA.COLUMN_STATISTICS 获取直方图信息,该表是数据字典表的视图实现。您还可以使用 ANALYZE TABLE 语句进行直方图管理。The server maintains histogram statistics about column values in the column_statistics data dictionary table (see Section 10.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.