mirror of
https://github.com/MariaDB/server.git
synced 2026-02-06 10:49:07 +01:00
Problem: ======== When persistent statistics are enabled (innodb_stats_persistent=ON), the innodb_stats_method setting was not being properly passed through the statistics calculation chain. This caused NULL handling to always use the default behavior, regardless of the configured stats method. The issue affected query optimization for queries involving NULL values, as the statistics collection wasn't respecting the user's preference for NULL value treatment (NULLS_EQUAL, NULLS_UNEQUAL, or NULLS_IGNORED). Solution: ======== 1. Passed innodb_stats_method parameter through the statistics calculation chain: - dict_stats_scan_page() - dict_stats_analyze_index_below_cur() - dict_stats_analyze_index_for_n_prefix() - dict_stats_analyze_index_level - dict_stats_analyze_index - dict_stats_update_persistent - dict_stats_save 2. Conditionally set n_non_null_key_vals based on the NULLS_IGNORED method. 3. Introduced IndexLevelStats which is to collect statistics at a specific B-tree level during index analysis 4. Introduced LeafPageStats which is to collect statistics for leaf page analysis 5. IndexLevelStats, LeafPageStats replaces multiple individual parameters in function signatures. 6. Add stats method name to stat_description in case of non default innodb_stats_method variable value 7. Added the new stat name like n_nonnull_fld01, n_nonull_fld02 etc with stats description to indicate how many non-nulls value exist for nth field of the index. This value is properly retrieved and stored in index statistics in dict_stats_fetch_index_stats_step(). 8. When InnoDB scan the leaf page directly, assign leaf page count as number of pages scanned in case of multi-level index. For single page indexes, use 1. This change leads to multiple changes in existing test case. |
||
|---|---|---|
| .. | ||
| btr | ||
| buf | ||
| data | ||
| dict | ||
| eval | ||
| fil | ||
| fsp | ||
| fts | ||
| fut | ||
| gis | ||
| ha | ||
| handler | ||
| ibuf | ||
| include | ||
| lock | ||
| log | ||
| mem | ||
| mtr | ||
| mysql-test/storage_engine | ||
| os | ||
| page | ||
| pars | ||
| que | ||
| read | ||
| rem | ||
| row | ||
| srv | ||
| sync | ||
| trx | ||
| unittest | ||
| ut | ||
| .clang-format-old | ||
| CMakeLists.txt | ||
| COPYING.Google | ||
| COPYING.Percona | ||