14.6.12Configuring Optimizer Statistics for InnoDB
作者:互联网
14.6.12.1 Configuring Persistent Optimizer Statistics Parameters
14.6.12.2 Configuring Non-Persistent Optimizer Statistics Parameters
14.6.12.3 Estimating ANALYZE TABLE Complexity for InnoDB Tables
This section describes how to configure persistent and non-persistent optimizer statistics for InnoDB tables.
本节描述如何为InnoDB表配置持久性和非持久性优化器统计信息。
Persistent optimizer statistics are persisted across server restarts, allowing for greater plan stability and more consistent query performance. Persistent optimizer statistics also provide control and flexibility with these additional benefits:
持久性优化器统计信息在服务器重新启动时保持不变,从而实现更高的计划稳定性和更一致的查询性能。持久优化器统计数据还提供了这些额外的好处的控制和灵活性:
- You can use the innodb_stats_auto_recalc configuration option to control whether statistics are updated automatically after substantial changes to a table.
- 您可以使用innodb_stats_auto_recalc配置选项来控制是否在对表进行实质性更改后自动更新统计信息。
- You can use the STATS_PERSISTENT, STATS_AUTO_RECALC, and STATS_SAMPLE_PAGES clauses with CREATE TABLE andALTER TABLE statements to configure optimizer statistics for individual tables.
- 您可以在CREATE TABLE和ALTER TABLE语句后面加上STATS_PERSISTENT,STATS_AUTO_RECALC和STATS_SAMPLE_PAGES子句以及来为单个表配置优化器统计信息。
- You can query optimizer statistics data in the mysql.innodb_table_stats and mysql.innodb_index_stats tables.
- 您可以查询 mysql.innodb_table_stats和mysql.innodb_index_stats表中的优化器统计数据。
- You can view the last_update column of the mysql.innodb_table_stats and mysql.innodb_index_stats tables to see when statistics were last updated.
- 您可以查看mysql.innodb_table_stats和mysql.innodb_index_stats 表的last_update列,以查看统计信息上次更新的时间。
- You can manually modify the mysql.innodb_table_stats and mysql.innodb_index_stats tables to force a specific query optimization plan or to test alternative plans without modifying the database.
- 您可以手动修改 mysql.innodb_table_stats和 mysql.innodb_index_stats表来强制执行特定的查询优化计划,或者在不修改数据库的情况下测试替代计划。
The persistent optimizer statistics feature is enabled by default (innodb_stats_persistent=ON).
持久优化器统计信息功能默认启用(innodb_stats_persistent = ON)。
Non-persistent optimizer statistics are cleared on each server restart and after some other operations, and recomputed on the next table access. As a result, different estimates could be produced when recomputing statistics, leading to different choices in execution plans and variations in query performance.
在每次服务器重启时以及在其他操作之后清除非永久性优化器统计信息,并在下一次表访问时重新计算,因此,重新计算统计信息时可能会产生不同的估计值,从而导致执行计划的不同选择和查询性能的变化。
This section also provides information about estimating ANALYZE TABLE complexity, which may be useful when attempting to achieve a balance between accurate statistics and ANALYZE TABLE execution time.
本节还提供了有关估计ANALYZE TABLE复杂性的信息,这在尝试实现精确统计信息和ANALYZE TABLE执行时间之间的平衡时可能很有用
PREV: 14.6.11 Configuring InnoDB Purge Scheduling https://blog.51cto.com/itzhoujun/2358048
NEXT: 14.6.12.1 Configuring Persistent Optimizer Statistics Parameters https://blog.51cto.com/itzhoujun/2359334
标签:14.6,stats,statistics,Statistics,innodb,mysql,InnoDB,table,TABLE 来源: https://blog.51cto.com/itzhoujun/2359332