mariadb/storage
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
..
archive Merge 10.6 into 10.11 2024-06-27 10:26:09 +03:00
blackhole MDEV-34348: my_hash_get_key fixes 2024-11-23 08:14:22 -07:00
columnstore Merge branch '10.6' into 10.11 2025-07-28 18:06:31 +02:00
connect MDEV-37633 Connect UDF functions push empty string warning. 2025-09-12 16:29:04 +10:00
csv Merge 10.6 into 10.11 2025-08-22 06:47:54 +03:00
example MDEV-36729: ha_example::show_func_example is incorrectly defined 2025-05-29 10:10:52 +10:00
federated Merge 10.5 into 10.6 2024-11-29 12:37:46 +02:00
federatedx Merge branch '10.6' into '10.11' 2025-04-16 03:34:40 +02:00
heap Merge 10.5 into 10.6 2025-01-20 09:57:37 +02:00
innobase MDEV-19574: innodb_stats_method ignored with persistent statistics 2025-10-20 23:38:57 +05:30
maria Merge branch '10.6' into 10.11 2025-09-12 13:08:40 +02:00
mroonga Fix compiler warnings 2025-09-30 12:06:31 +03:00
myisam Merge branch '10.6' into 10.11 2025-09-12 13:08:40 +02:00
myisammrg Merge 10.6 into 10.11 2025-01-08 12:51:26 +02:00
oqgraph Merge 10.6 into 10.11 2024-11-29 13:43:17 +02:00
perfschema Merge 10.6 into 10.11 2025-08-22 06:47:54 +03:00
rocksdb MDEV-36010 - fix myrocks_hotbackup for python3 2025-10-14 11:12:48 +11:00
sequence MDEV-33746 Supply missing override markings 2024-06-20 11:32:13 -04:00
sphinx Merge 10.5 into 10.6 2024-11-29 12:37:46 +02:00
spider Merge 10.6 into 10.11 2025-10-17 07:49:55 +03:00
test_sql_discovery Merge 10.5 into 10.6 2024-06-24 13:09:47 +03:00