mariadb/storage/innobase
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
..
btr MDEV-19574: innodb_stats_method ignored with persistent statistics 2025-10-20 23:38:57 +05:30
buf Merge 10.6 into 10.11 2025-10-09 13:29:46 +03:00
data Merge 10.7 into 10.8 2022-11-01 08:50:28 +02:00
dict MDEV-19574: innodb_stats_method ignored with persistent statistics 2025-10-20 23:38:57 +05:30
eval MDEV-37619 The forced use of THD accessors hurts InnoDB performance 2025-09-16 15:18:32 +03:00
fil MDEV-37299: Fix crash when server read-only and encrption ON 2025-09-19 11:55:43 +05:30
fsp MDEV-35000 preparation: Clean up dict_table_t::stat 2025-02-28 08:55:16 +02:00
fts MDEV-35000: dict_table_close() breaks STATS_AUTO_RECALC 2025-02-28 09:00:16 +02:00
fut MDEV-32175: Reduce page_align(), page_offset() calls 2024-11-21 11:01:30 +02:00
gis Merge 10.5 into 10.6 2025-03-26 17:09:57 +02:00
ha MDEV-35472 Server crash in ha_storage_put_memlim upon reading from INNODB_LOCKS 2024-11-25 10:31:57 +02:00
handler MDEV-19574: innodb_stats_method ignored with persistent statistics 2025-10-20 23:38:57 +05:30
ibuf MDEV-29930 Lock order inversion in ibuf_remove_free_page() 2025-09-11 13:25:08 +03:00
include MDEV-19574: innodb_stats_method ignored with persistent statistics 2025-10-20 23:38:57 +05:30
lock MDEV-37619 The forced use of THD accessors hurts InnoDB performance 2025-09-16 15:18:32 +03:00
log Merge 10.6 into 10.11 2025-10-17 07:49:55 +03:00
mem Cleanup: Remove duplicated code 2024-11-29 14:16:34 +02:00
mtr MDEV-37553: Assertion failure lsn - get_flushed_lsn(...) < capacity() 2025-09-03 08:45:45 +03:00
mysql-test/storage_engine MDEV-36330: SERIALIZABLE read inconsistency 2025-07-11 16:07:08 +03:00
os MDEV-36234: Add innodb_linux_aio 2025-06-23 13:51:52 +03:00
page Fixed that one can compile MariaDB with ASAN with -Wframe-larger-than=16384 2025-09-04 18:08:38 +03:00
pars Merge 10.6 into 10.11 2025-02-25 10:23:24 +02:00
que MDEV-24035 Failing assertion: UT_LIST_GET_LEN(lock.trx_locks) == 0 causing disruption and replication failure 2024-12-12 18:02:00 +02:00
read MDEV-34515: Contention between purge and workload 2024-08-26 12:23:06 +03:00
rem Merge 10.6 into 10.11 2024-03-28 09:16:57 +02:00
row Merge 10.6 into 10.11 2025-10-09 13:29:46 +03:00
srv Fixed that one can compile MariaDB with ASAN with -Wframe-larger-than=16384 2025-09-04 18:08:38 +03:00
sync MDEV-35566 Ensure compatibility with ARMv9 by updating .arch directive 2025-08-15 09:47:40 +03:00
trx Merge 10.6 into 10.11 2025-10-17 07:49:55 +03:00
unittest MDEV-35587 unit.innodb_sync leaks memory on mac 2024-12-12 10:27:36 +11:00
ut MDEV-36759: Huge performance drop 2025-05-13 12:27:50 +03:00
.clang-format-old switch off storage/innobase/.clang-format: InnoDB uses a common formatting style for all new code 2021-03-17 11:01:15 +03:00
CMakeLists.txt MDEV-36234: Add innodb_linux_aio 2025-06-23 13:51:52 +03:00
COPYING.Google
COPYING.Percona