mariadb/storage/innobase/dict
Thirunarayanan Balathandayuthapani 57cab3e3a2 MDEV-19574: innodb_stats_method ignored with persistent statistics
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. 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.
2025-10-20 23:38:57 +05:30
..
dict0boot.cc Merge branch '10.6' into 10.11 2023-12-18 11:19:04 +01:00
dict0crea.cc MDEV-37619 The forced use of THD accessors hurts InnoDB performance 2025-09-16 15:18:32 +03:00
dict0defrag_bg.cc MDEV-36122: Protect table references with a lock 2025-03-26 14:31:44 +02:00
dict0dict.cc MDEV-37619 The forced use of THD accessors hurts InnoDB performance 2025-09-16 15:18:32 +03:00
dict0load.cc Merge branch '10.6' into '10.11' 2025-04-16 03:34:40 +02:00
dict0mem.cc Merge branch '10.6' into 10.11 2025-01-30 11:55:13 +01:00
dict0stats.cc MDEV-19574: innodb_stats_method ignored with persistent statistics 2025-10-20 23:38:57 +05:30
dict0stats_bg.cc MDEV-35000: dict_table_close() breaks STATS_AUTO_RECALC 2025-02-28 09:00:16 +02:00
drop.cc Merge branch '10.6' into 10.11 2025-01-30 11:55:13 +01:00