📄 index_merge_ror_cpk.result
字号:
drop table if exists t1;create table t1(pk1 int not null, pk2 int not null,key1 int not null,key2 int not null,pktail1ok int not null, pktail2ok int not null, pktail3bad int not null,pktail4bad int not null,pktail5bad int not null,pk2copy int not null,badkey int not null,filler1 char (200),filler2 char (200),key (key1),key (key2),/* keys with tails from CPK members */key (pktail1ok, pk1),key (pktail2ok, pk1, pk2),key (pktail3bad, pk2, pk1),key (pktail4bad, pk1, pk2copy),key (pktail5bad, pk1, pk2, pk2copy),primary key (pk1, pk2)) engine=innodb;explain select * from t1 where pk1 = 1 and pk2 < 80 and key1=0;id select_type table type possible_keys key key_len ref rows Extra1 SIMPLE t1 range PRIMARY,key1 PRIMARY 8 NULL 9 Using whereselect * from t1 where pk1 = 1 and pk2 < 80 and key1=0;pk1 pk2 key1 key2 pktail1ok pktail2ok pktail3bad pktail4bad pktail5bad pk2copy badkey filler1 filler21 10 0 0 0 0 0 0 0 10 0 filler-data-10 filler21 11 0 0 0 0 0 0 0 11 0 filler-data-11 filler21 12 0 0 0 0 0 0 0 12 0 filler-data-12 filler21 13 0 0 0 0 0 0 0 13 0 filler-data-13 filler21 14 0 0 0 0 0 0 0 14 0 filler-data-14 filler21 15 0 0 0 0 0 0 0 15 0 filler-data-15 filler21 16 0 0 0 0 0 0 0 16 0 filler-data-16 filler21 17 0 0 0 0 0 0 0 17 0 filler-data-17 filler21 18 0 0 0 0 0 0 0 18 0 filler-data-18 filler21 19 0 0 0 0 0 0 0 19 0 filler-data-19 filler2explain select pk1,pk2 from t1 where key1 = 10 and key2=10 and 2*pk1+1 < 2*96+1;id select_type table type possible_keys key key_len ref rows Extra1 SIMPLE t1 index_merge key1,key2 key1,key2 4,4 NULL 1 Using intersect(key1,key2); Using where; Using indexselect pk1,pk2 from t1 where key1 = 10 and key2=10 and 2*pk1+1 < 2*96+1;pk1 pk295 5095 5195 5295 5395 5495 5595 5695 5795 5895 59explain select * from t1 where badkey=1 and key1=10;id select_type table type possible_keys key key_len ref rows Extra1 SIMPLE t1 ref key1 key1 4 const 100 Using whereexplain select * from t1 where pk1 < 7500 and key1 = 10;id select_type table type possible_keys key key_len ref rows Extra1 SIMPLE t1 index_merge PRIMARY,key1 key1,PRIMARY 4,4 NULL ROWS Using intersect(key1,PRIMARY); Using whereexplain select * from t1 where pktail1ok=1 and key1=10;id select_type table type possible_keys key key_len ref rows Extra1 SIMPLE t1 index_merge key1,pktail1ok key1,pktail1ok 4,4 NULL 1 Using intersect(key1,pktail1ok); Using whereexplain select * from t1 where pktail2ok=1 and key1=10;id select_type table type possible_keys key key_len ref rows Extra1 SIMPLE t1 index_merge key1,pktail2ok key1,pktail2ok 4,4 NULL 1 Using intersect(key1,pktail2ok); Using whereselect ' The following is actually a deficiency, it uses sort_union currently:' as 'note:';note: The following is actually a deficiency, it uses sort_union currently:explain select * from t1 where (pktail2ok=1 and pk1< 50000) or key1=10;id select_type table type possible_keys key key_len ref rows Extra1 SIMPLE t1 index_merge PRIMARY,key1,pktail2ok pktail2ok,key1 8,4 NULL 199 Using sort_union(pktail2ok,key1); Using whereexplain select * from t1 where pktail3bad=1 and key1=10;id select_type table type possible_keys key key_len ref rows Extra1 SIMPLE t1 ref key1,pktail3bad key1 4 const 100 Using whereexplain select * from t1 where pktail4bad=1 and key1=10;id select_type table type possible_keys key key_len ref rows Extra1 SIMPLE t1 ref key1,pktail4bad key1 4 const 100 Using whereexplain select * from t1 where pktail5bad=1 and key1=10;id select_type table type possible_keys key key_len ref rows Extra1 SIMPLE t1 ref key1,pktail5bad key1 4 const 100 Using whereexplain select pk1,pk2,key1,key2 from t1 where key1 = 10 and key2=10 limit 10;id select_type table type possible_keys key key_len ref rows Extra1 SIMPLE t1 index_merge key1,key2 key1,key2 4,4 NULL 1 Using intersect(key1,key2); Using where; Using indexselect pk1,pk2,key1,key2 from t1 where key1 = 10 and key2=10 limit 10;pk1 pk2 key1 key295 50 10 1095 51 10 1095 52 10 1095 53 10 1095 54 10 1095 55 10 1095 56 10 1095 57 10 1095 58 10 1095 59 10 10drop table t1;create table t1( RUNID varchar(22), SUBMITNR varchar(5), ORDERNR char(1) , PROGRAMM varchar(8), TESTID varchar(4), UCCHECK char(1), ETEXT varchar(80), ETEXT_TYPE char(1),INFO char(1), SEVERITY tinyint(3), TADIRFLAG char(1), PRIMARY KEY (RUNID,SUBMITNR,ORDERNR,PROGRAMM,TESTID,UCCHECK), KEY `TVERM~KEY` (PROGRAMM,TESTID,UCCHECK)) ENGINE=InnoDB DEFAULT CHARSET=latin1;update t1 set `ETEXT` = '', `ETEXT_TYPE`='', `INFO`='', `SEVERITY`='', `TADIRFLAG`='' WHERE `RUNID`= '' AND `SUBMITNR`= '' AND `ORDERNR`='' AND `PROGRAMM`='' AND `TESTID`='' AND `UCCHECK`='';drop table t1;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -