mirror of
https://github.com/MariaDB/server.git
synced 2025-08-01 03:47:19 +03:00
BUG#9622, stage 2, work together with fix for BUG#12232:
added "nulls_ignored" index statistics collection method for MyISAM tables. (notification trigger: this is about BUG#9622). include/my_base.h: BUG#9622: Added MI_STATS_METHOD_IGNORE_NULLS statistics collection method: Added SEARCH_RETURN_B_POS flag for ha_key_cmp() include/my_handler.h: BUG#9622: Added MI_STATS_METHOD_IGNORE_NULLS statistics collection method: added ha_find_null() include/myisam.h: BUG#9622: Added MI_STATS_METHOD_IGNORE_NULLS statistics collection method. myisam/mi_check.c: BUG#9622: Added MI_STATS_METHOD_IGNORE_NULLS statistics collection method, added mi_collect_stats_*(), updated update_key_parts() to deal with all 3 methods. myisam/myisamchk.c: BUG#9622: Added nulls_ignored index statistics collection method for MyISAM myisam/myisamdef.h: BUG#9622: Added MI_STATS_METHOD_IGNORE_NULLS statistics collection method. myisam/sort.c: BUG#9622: Added MI_STATS_METHOD_IGNORE_NULLS statistics collection method. mysql-test/r/myisam.result: Testcase for BUG9622 mysql-test/t/myisam.test: Testcase for BUG9622 mysys/my_handler.c: BUG#9622: ha_key_cmp() now supports new SEARCH_RETURN_B_POS flag, added ha_find_null() sql/ha_myisam.cc: BUG#9622: Added MI_STATS_METHOD_IGNORE_NULLS statistics collection method. sql/mysqld.cc: BUG#9622: Added MI_STATS_METHOD_IGNORE_NULLS statistics collection method.
This commit is contained in:
@ -670,3 +670,35 @@ show index from t1;
|
||||
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
|
||||
t1 1 a 1 a A 10 NULL NULL YES BTREE
|
||||
drop table t1;
|
||||
set myisam_stats_method=nulls_ignored;
|
||||
show variables like 'myisam_stats_method';
|
||||
Variable_name Value
|
||||
myisam_stats_method nulls_ignored
|
||||
create table t1 (
|
||||
a char(3), b char(4), c char(5), d char(6),
|
||||
key(a,b,c,d)
|
||||
);
|
||||
insert into t1 values ('bcd','def1', NULL, 'zz');
|
||||
insert into t1 values ('bcd','def2', NULL, 'zz');
|
||||
insert into t1 values ('bce','def1', 'yuu', NULL);
|
||||
insert into t1 values ('bce','def2', NULL, 'quux');
|
||||
analyze table t1;
|
||||
Table Op Msg_type Msg_text
|
||||
test.t1 analyze status OK
|
||||
show index from t1;
|
||||
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
|
||||
t1 1 a 1 a A 2 NULL NULL YES BTREE
|
||||
t1 1 a 2 b A 4 NULL NULL YES BTREE
|
||||
t1 1 a 3 c A 4 NULL NULL YES BTREE
|
||||
t1 1 a 4 d A 4 NULL NULL YES BTREE
|
||||
delete from t1;
|
||||
analyze table t1;
|
||||
Table Op Msg_type Msg_text
|
||||
test.t1 analyze status OK
|
||||
show index from t1;
|
||||
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
|
||||
t1 1 a 1 a A 0 NULL NULL YES BTREE
|
||||
t1 1 a 2 b A 0 NULL NULL YES BTREE
|
||||
t1 1 a 3 c A 0 NULL NULL YES BTREE
|
||||
t1 1 a 4 d A 0 NULL NULL YES BTREE
|
||||
set myisam_stats_method=DEFAULT;
|
||||
|
Reference in New Issue
Block a user