content_image/694465.jpg content_image/694470.jpg
• innodb_stats_include_delete_marked 

<img src='content_image/694465.jpg'>

By default, InnoDB  reads uncommitted data when calculating statistics. In the case of an uncommitted transaction that deletes rows from a table, InnoDB  excludes records that are delete-marked when calculating row estimates and index statistics, which can lead to non-optimal execution plans for other transactions that are operating on the table concurrently using a transaction isolation level other than READ UNCOMMITTED . To avoid this scenario, innodb_stats_include_delete_marked  can be enabled to ensure that InnoDB  includes delete-marked records when calculating persistent optimizer statistics. 

When innodb_stats_include_delete_marked  is enabled, ANALYZE TABLE  considers delete- marked records when recalculating statistics. 

innodb_stats_include_delete_marked  is a global setting that affects all InnoDB  tables. It is only applicable to persistent optimizer statistics. 

For related information, see Section 15.8.10.1, “Configuring Persistent Optimizer Statistics Parameters” . 

• innodb_stats_method 

<img src='content_image/694470.jpg'>

How the server treats NULL  values when collecting statistics about the distribution of index values for InnoDB  tables. Permitted values are nulls_equal , nulls_unequal , and nulls_ignored . For nulls_equal , all NULL  index values are considered equal and form a single value group with a size equal to the number of NULL  values. For nulls_unequal , NULL  values are considered unequal, and each NULL  forms a distinct value group of size 1. For nulls_ignored , NULL  values are ignored. 

The method used to generate table statistics influences how the optimizer chooses indexes for query execution, as described in Section 8.3.8, “InnoDB and MyISAM Index Statistics Collection” . 

