1
SET SESSION STORAGE_ENGINE = InnoDB;
2
drop table if exists t1, t2, t3,t4;
11
insert into t1 values (-5, 1, 1),
16
explain select * from t1 force index(key1, key2) where key1 < 3 or key2 < 3;
17
id select_type table type possible_keys key key_len ref rows Extra
18
1 SIMPLE t1 index_merge key1,key2 key1,key2 5,5 NULL 4 Using sort_union(key1,key2); Using where
19
select * from t1 force index(key1, key2) where key1 < 3 or key2 < 3;
28
pk1 int unsigned not NULL,
35
insert into t1 values (0, 1, 1),
40
select * from t1 force index(key1, key2) where key1 < 3 or key2 < 3;
55
) collate latin2_general_ci;
56
insert into t1 values ('a1', 1, 1),
60
select * from t1 force index(key1, key2) where key1 < 3 or key2 < 3;
69
pk2 char(4) not NULL collate latin1_german1_ci,
70
pk3 char(4) not NULL collate latin1_bin,
73
PRIMARY KEY (pk1,pk2,pk3),
79
(1, 'u', char(0xEC), 1, 1),
81
insert ignore into t1 select pk1, char(0xEC), pk3, key1, key2 from t1;
82
insert ignore into t1 select pk1, 'x', pk3, key1, key2 from t1 where pk2='u';
83
insert ignore into t1 select 2, pk2, pk3, key1, key2 from t1;
104
select * from t1 force index(key1, key2) where key1 < 3 or key2 < 3;
105
pk1 pk2 pk3 key1 key2
124
alter table t1 drop primary key;
126
pk1 pk2 pk3 key1 key2
145
select * from t1 force index(key1, key2) where key1 < 3 or key2 < 3;
146
pk1 pk2 pk3 key1 key2
167
pk1 varchar(8) NOT NULL default '',
168
pk2 varchar(4) NOT NULL default '',
171
primary key(pk1, pk2),
175
insert into t1 values ('','empt',2,2),
180
select * from t1 force index(key1, key2) where key1 < 3 or key2 < 3;