@@ -32,7 +32,7 @@ key1 key2 key3 key4 key5 key6 key7 key8
32
32
1022 1022 1022 1022 1022 1022 1022 2
33
33
1023 1023 1023 1023 1023 1023 1023 1
34
34
1024 1024 1024 1024 1024 1024 1024 0
35
- explain select * from t0 where key1 < 3 or key2 <4 ;
35
+ explain select * from t0 where key1 < 3 or key2 <3 ;
36
36
id select_type table type possible_keys key key_len ref rows Extra
37
37
1 SIMPLE t0 ALL i1,i2 NULL NULL NULL # Using where
38
38
explain
@@ -56,7 +56,7 @@ id select_type table type possible_keys key key_len ref rows Extra
56
56
explain select * from t0 where (key1 < 3 or key2 <4) and key3 = 50;
57
57
id select_type table type possible_keys key key_len ref rows Extra
58
58
1 SIMPLE t0 ref i1,i2,i3 i3 4 const # Using where
59
- explain select * from t0 use index (i1,i2) where (key1 < 3 or key2 <4 ) and key3 = 50;
59
+ explain select * from t0 use index (i1,i2) where (key1 < 3 or key2 <3 ) and key3 = 50;
60
60
id select_type table type possible_keys key key_len ref rows Extra
61
61
1 SIMPLE t0 ALL i1,i2 NULL NULL NULL # Using where
62
62
explain select * from t0 where (key1 > 1 or key2 > 2);
@@ -67,7 +67,7 @@ id select_type table type possible_keys key key_len ref rows Extra
67
67
1 SIMPLE t0 index_merge i1,i2 i1,i2 4,4 NULL # Using sort_union(i1,i2); Using where
68
68
explain
69
69
select * from t0 where key1<3 or key2<3 or (key1>5 and key1<8) or
70
- (key1>10 and key1<12) or (key2>100 and key2<110 );
70
+ (key1>10 and key1<12) or (key2>100 and key2<105 );
71
71
id select_type table type possible_keys key key_len ref rows Extra
72
72
1 SIMPLE t0 ALL i1,i2 NULL NULL NULL # Using where
73
73
explain select * from t0 where key2 = 45 or key1 <=> null;
@@ -85,7 +85,7 @@ id select_type table type possible_keys key key_len ref rows Extra
85
85
explain select * from t0 where key2=10 or key3=3 or key4 is null;
86
86
id select_type table type possible_keys key key_len ref rows Extra
87
87
1 SIMPLE t0 index_merge i2,i3 i2,i3 4,4 NULL # Using union(i2,i3); Using where
88
- explain select key1 from t0 where (key1 <=> null) or (key2 < 5 ) or
88
+ explain select key1 from t0 where (key1 <=> null) or (key2 < 3 ) or
89
89
(key3=10) or (key4 <=> null);
90
90
id select_type table type possible_keys key key_len ref rows Extra
91
91
1 SIMPLE t0 ALL i1,i2,i3,i4 NULL NULL NULL # Using where
@@ -94,26 +94,25 @@ explain select key1 from t0 where (key1 <=> null) or (key1 < 5) or
94
94
id select_type table type possible_keys key key_len ref rows Extra
95
95
1 SIMPLE t0 index_merge i1,i3,i4 i1,i3 4,4 NULL # Using sort_union(i1,i3); Using where
96
96
explain select * from t0 where
97
- (key1 < 3 or key2 < 3) and (key3 < 4 or key4 < 4 ) and (key5 < 5 or key6 < 5);
97
+ (key1 < 3 or key2 < 3) and (key3 < 3 or key4 < 3 ) and (key5 < 5 or key6 < 5);
98
98
id select_type table type possible_keys key key_len ref rows Extra
99
99
1 SIMPLE t0 ALL i1,i2,i3,i4,i5,i6 NULL NULL NULL # Using where
100
100
explain
101
- select * from t0 where (key1 < 3 or key2 < 6 ) and (key1 < 7 or key3 < 4 );
101
+ select * from t0 where (key1 < 3 or key2 < 5 ) and (key1 < 5 or key3 < 3 );
102
102
id select_type table type possible_keys key key_len ref rows Extra
103
103
1 SIMPLE t0 ALL i1,i2,i3 NULL NULL NULL # Using where
104
- select * from t0 where (key1 < 3 or key2 < 6 ) and (key1 < 7 or key3 < 4 );
104
+ select * from t0 where (key1 < 3 or key2 < 5 ) and (key1 < 5 or key3 < 3 );
105
105
key1 key2 key3 key4 key5 key6 key7 key8
106
106
1 1 1 1 1 1 1 1023
107
107
2 2 2 2 2 2 2 1022
108
108
3 3 3 3 3 3 3 1021
109
109
4 4 4 4 4 4 4 1020
110
- 5 5 5 5 5 5 5 1019
111
110
explain select * from t0 where
112
- (key1 < 3 or key2 < 3) and (key3 < 4 or key4 < 4 ) and (key5 < 2 or key6 < 2);
111
+ (key1 < 3 or key2 < 3) and (key3 < 3 or key4 < 3 ) and (key5 < 2 or key6 < 2);
113
112
id select_type table type possible_keys key key_len ref rows Extra
114
113
1 SIMPLE t0 ALL i1,i2,i3,i4,i5,i6 NULL NULL NULL # Using where
115
114
explain select * from t0 where
116
- (key1 < 3 or key2 < 3) and (key3 < 100 );
115
+ (key1 < 3 or key2 < 3) and (key3 < 90 );
117
116
id select_type table type possible_keys key key_len ref rows Extra
118
117
1 SIMPLE t0 ALL i1,i2,i3 NULL NULL NULL # Using where
119
118
explain select * from t0 where
@@ -127,26 +126,24 @@ key2 > 5;
127
126
id select_type table type possible_keys key key_len ref rows Extra
128
127
1 SIMPLE t0 ALL i1,i2,i3 NULL NULL NULL # Using where
129
128
explain select * from t0 where
130
- ((key1 < 4 or key2 < 4) and (key2 <5 or key3 < 4 ))
129
+ ((key1 < 4 or key2 < 4) and (key2 <4 or key3 < 3 ))
131
130
or
132
- key1 < 7 ;
131
+ key1 < 5 ;
133
132
id select_type table type possible_keys key key_len ref rows Extra
134
133
1 SIMPLE t0 ALL i1,i2,i3 NULL NULL NULL # Using where
135
134
select * from t0 where
136
- ((key1 < 4 or key2 < 4) and (key2 <5 or key3 < 4 ))
135
+ ((key1 < 4 or key2 < 4) and (key2 <4 or key3 < 3 ))
137
136
or
138
- key1 < 7 ;
137
+ key1 < 5 ;
139
138
key1 key2 key3 key4 key5 key6 key7 key8
140
139
1 1 1 1 1 1 1 1023
141
140
2 2 2 2 2 2 2 1022
142
141
3 3 3 3 3 3 3 1021
143
142
4 4 4 4 4 4 4 1020
144
- 5 5 5 5 5 5 5 1019
145
- 6 6 6 6 6 6 6 1018
146
143
explain select * from t0 where
147
- ((key1 < 4 or key2 < 4 ) and (key3 <5 or key5 < 4))
144
+ ((key1 < 3 or key2 < 3 ) and (key3 <4 or key5 < 4))
148
145
or
149
- ((key5 < 5 or key6 < 6 ) and (key7 <7 or key8 < 4 ));
146
+ ((key5 < 5 or key6 < 5 ) and (key7 <5 or key8 < 3 ));
150
147
id select_type table type possible_keys key key_len ref rows Extra
151
148
1 SIMPLE t0 ALL i1,i2,i3,i5,i6,i7,i8 NULL NULL NULL # Using where
152
149
explain select * from t0 where
162
159
id select_type table type possible_keys key key_len ref rows Extra
163
160
1 SIMPLE t0 ALL i1,i2,i3,i5,i6 NULL NULL NULL # Using where
164
161
explain select * from t0 where
165
- ((key3 <5 or key5 < 4 ) and (key1 < 4 or key2 < 4 ))
162
+ ((key3 <4 or key5 < 3 ) and (key1 < 3 or key2 < 3 ))
166
163
or
167
- (((key3 <7 and key7 < 6 ) or key5 < 2) and (key5 < 5 or key6 < 6 ));
164
+ (((key3 <5 and key7 < 5 ) or key5 < 2) and (key5 < 4 or key6 < 4 ));
168
165
id select_type table type possible_keys key key_len ref rows Extra
169
166
1 SIMPLE t0 ALL i1,i2,i3,i5,i6,i7 NULL NULL NULL # Using where
170
167
explain select * from t0 where
185
182
((key3 >=5 or key5 < 2) and (key5 < 5 or key6 < 6));
186
183
id select_type table type possible_keys key key_len ref rows Extra
187
184
1 SIMPLE t0 ALL i1,i2,i3,i5,i6 NULL NULL NULL # Using where
188
- select * from t0 where key1 < 5 or key8 < 4 order by key1;
185
+ select * from t0 where key1 < 4 or key8 < 3 order by key1;
189
186
key1 key2 key3 key4 key5 key6 key7 key8
190
187
1 1 1 1 1 1 1 1023
191
188
2 2 2 2 2 2 2 1022
192
189
3 3 3 3 3 3 3 1021
193
- 4 4 4 4 4 4 4 1020
194
- 1021 1021 1021 1021 1021 1021 1021 3
195
190
1022 1022 1022 1022 1022 1022 1022 2
196
191
1023 1023 1023 1023 1023 1023 1023 1
197
192
1024 1024 1024 1024 1024 1024 1024 0
198
193
explain
199
- select * from t0 where key1 < 5 or key8 < 4 order by key1;
194
+ select * from t0 where key1 < 4 or key8 < 3 order by key1;
200
195
id select_type table type possible_keys key key_len ref rows Extra
201
196
1 SIMPLE t0 ALL i1,i8 NULL NULL NULL # Using where; Using filesort
202
197
create table t2 like t0;
@@ -361,8 +356,8 @@ from t0 as A force index(i1,i2), t0 as B force index (i1,i2)
361
356
where (A.key1 = 1 or A.key2 = 1)
362
357
and (B.key1 = 1 or B.key2 = 1);
363
358
id select_type table type possible_keys key key_len ref rows Extra
364
- 1 SIMPLE A index_merge i1,i2 i1,i2 4,4 NULL 1021 Using union(i1,i2); Using where
365
- 1 SIMPLE B index_merge i1,i2 i1,i2 4,4 NULL 1021 Using union(i1,i2); Using where; Using join buffer (Block Nested Loop)
359
+ 1 SIMPLE A index_merge i1,i2 i1,i2 4,4 NULL # Using union(i1,i2); Using where
360
+ 1 SIMPLE B index_merge i1,i2 i1,i2 4,4 NULL # Using union(i1,i2); Using where; Using join buffer (Block Nested Loop)
366
361
select max(A.key1 + B.key1 + A.key2 + B.key2 + A.key3 + B.key3 + A.key4 + B.key4 + A.key5 + B.key5)
367
362
from t0 as A force index(i1,i2), t0 as B force index (i1,i2)
368
363
where (A.key1 = 1 or A.key2 = 1)
@@ -371,13 +366,6 @@ max(A.key1 + B.key1 + A.key2 + B.key2 + A.key3 + B.key3 + A.key4 + B.key4 + A.ke
371
366
8194
372
367
alter table t0 add filler1 char(200), add filler2 char(200), add filler3 char(200);
373
368
update t0 set key2=1, key3=1, key4=1, key5=1,key6=1,key7=1 where key7 < 500;
374
- explain select max(A.key1 + B.key1 + A.key2 + B.key2 + A.key3 + B.key3 + A.key4 + B.key4 + A.key5 + B.key5)
375
- from t0 as A, t0 as B
376
- where (A.key1 = 1 and A.key2 = 1 and A.key3 = 1 and A.key4=1 and A.key5=1 and A.key6=1 and A.key7 = 1 or A.key8=1)
377
- and (B.key1 = 1 and B.key2 = 1 and B.key3 = 1 and B.key4=1 and B.key5=1 and B.key6=1 and B.key7 = 1 or B.key8=1);
378
- id select_type table type possible_keys key key_len ref rows Extra
379
- 1 SIMPLE A index_merge i1,i2,i3,i4,i5,i6,i7?,i8 i2,i8 4,4 NULL # Using union(i2,i8); Using where
380
- 1 SIMPLE B index_merge i1,i2,i3,i4,i5,i6,i7?,i8 i2,i8 4,4 NULL # Using union(i2,i8); Using where; Using join buffer (Block Nested Loop)
381
369
select max(A.key1 + B.key1 + A.key2 + B.key2 + A.key3 + B.key3 + A.key4 + B.key4 + A.key5 + B.key5)
382
370
from t0 as A, t0 as B
383
371
where (A.key1 = 1 and A.key2 = 1 and A.key3 = 1 and A.key4=1 and A.key5=1 and A.key6=1 and A.key7 = 1 or A.key8=1)
0 commit comments