mariadb/mysql-test/suite
Thirunarayanan Balathandayuthapani 6ca9ae4e40 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-11-25 12:17:02 +05:30
..
archive Merge branch '10.6' into '10.11' 2025-04-16 03:34:40 +02:00
atomic Merge branch '10.6' into 10.11 2025-04-26 10:47:03 +02:00
binlog Merge branch '10.6' into 10.11 2025-10-22 09:44:15 +02:00
binlog_encryption cleanup: select ... into tests 2025-07-17 09:18:18 +02:00
client
compat Merge branch '10.6' into 10.11 2025-01-30 11:55:13 +01:00
csv
encryption MDEV-37299 fixup: cmake -DPLUGIN_PERFSCHEMA=NO 2025-09-30 16:42:58 +03:00
engines MDEV-37375 engines/iuds suite fails with ps-protocol 2025-09-15 11:00:02 +02:00
federated MDEV-29874: FederatedX error 10000 on multi-table UPDATE/DELETE 2025-10-22 15:35:54 +07:00
funcs_1 cleanup: select ... into tests 2025-07-17 09:18:18 +02:00
funcs_2 Merge 10.5 into 10.6 2025-03-26 17:09:57 +02:00
galera MDEV-36528 : Test failure on galera.mdev-22543 2025-11-19 13:21:43 +02:00
galera_3nodes MDEV-37816: galera tests failing with Table performance_schema.xxx doesn't exist 2025-10-09 16:01:09 +11:00
galera_3nodes_sr galera mtr tests: synchronization between branches and editions 2025-04-02 04:50:11 +02:00
galera_sr MDEV-34117 : Assertion `! thd->in_sub_stmt' failed in bool trans_rollback_stmt(THD*) 2025-11-03 10:45:56 +02:00
gcol cleanup: select ... into tests 2025-07-17 09:18:18 +02:00
handler Merge branch '10.5' into 10.6 2024-12-17 11:06:09 +11:00
heap Merge branch '10.6' into 10.11 2025-01-30 11:55:13 +01:00
innodb MDEV-19574: innodb_stats_method ignored with persistent statistics 2025-11-25 12:17:02 +05:30
innodb_fts Merge 10.6 into 10.11 2025-11-11 10:29:45 +02:00
innodb_gis Merge 10.6 into 10.11 2025-10-23 10:38:55 +03:00
innodb_i_s
innodb_zip MDEV-37138: Innochecksum fails to handle doublewrite buffer and 2025-10-13 13:04:53 +05:30
jp
json MDEV-34081: View containing JSON_TABLE does not return JSON 2025-10-22 22:49:26 +05:30
large_tests
maria Merge branch '10.6' into bb-10.11-release 2025-10-27 14:34:43 +01:00
mariabackup MDEV-37520 Failure to detect corruption during backups of Aria table 2025-09-04 18:08:39 +03:00
mtr/t Remove dates from all rdiff files 2025-01-05 16:40:11 +02:00
mtr2
multi_source MDEV-7611: create multi_source.mariadb-dump_slave 2025-07-10 18:31:36 -06:00
optimizer_unfixed_bugs
parts MDEV-37328 Assertion failure in make_empty_rec upon CONVERT PARTITION 2025-07-28 18:06:11 +02:00
perfschema Merge branch '10.6' into bb-10.11-release 2025-10-27 14:34:43 +01:00
perfschema_stress
period Merge branch '10.6' into 10.11 2025-09-12 13:08:40 +02:00
plugins Merge 10.6 into 10.11 2025-10-23 10:38:55 +03:00
roles Merge branch '10.6' into 10.11 2025-01-30 11:55:13 +01:00
rpl MDEV-37662: Binlog Corruption When tmpdir is Full 2025-11-19 07:05:49 -07:00
s3 Merge branch '10.6' into 10.11 2025-06-04 14:09:23 +02:00
sql_sequence MDEV-37345 temporary table, ALTER, recreate sequence 2025-10-28 17:49:51 +01:00
storage_engine
stress
sys_vars Merge 10.6 into 10.11 2025-10-23 10:38:55 +03:00
sysschema MDEV-37083: Fixed type mismatch in sys views 2025-07-25 17:02:59 +05:30
unit
vcol Improvements for myisamchk 2025-09-04 18:08:39 +03:00
versioning Merge 10.6 into 10.11 2025-11-11 10:29:45 +02:00
wsrep MDEV-34117 : Assertion `! thd->in_sub_stmt' failed in bool trans_rollback_stmt(THD*) 2025-11-03 10:45:56 +02:00