133
133
test.t3 analyze status Table is already up to date
134
134
explain select a1, min(a2) from t1 group by a1;
135
135
id select_type table type possible_keys key key_len ref rows Extra
136
1 SIMPLE t1 range NULL idx_t1_1 130 NULL 5 Using index for group-by
136
1 SIMPLE t1 range NULL idx_t1_1 518 NULL 5 Using index for group-by
137
137
explain select a1, max(a2) from t1 group by a1;
138
138
id select_type table type possible_keys key key_len ref rows Extra
139
1 SIMPLE t1 range NULL idx_t1_1 65 NULL 5 Using index for group-by
139
1 SIMPLE t1 range NULL idx_t1_1 259 NULL 5 Using index for group-by
140
140
explain select a1, min(a2), max(a2) from t1 group by a1;
141
141
id select_type table type possible_keys key key_len ref rows Extra
142
1 SIMPLE t1 range NULL idx_t1_1 130 NULL 5 Using index for group-by
142
1 SIMPLE t1 range NULL idx_t1_1 518 NULL 5 Using index for group-by
143
143
explain select a1, a2, b, min(c), max(c) from t1 group by a1,a2,b;
144
144
id select_type table type possible_keys key key_len ref rows Extra
145
1 SIMPLE t1 range NULL idx_t1_1 147 NULL 17 Using index for group-by
145
1 SIMPLE t1 range NULL idx_t1_1 585 NULL 17 Using index for group-by
146
146
explain select a1,a2,b,max(c),min(c) from t1 group by a1,a2,b;
147
147
id select_type table type possible_keys key key_len ref rows Extra
148
1 SIMPLE t1 range NULL idx_t1_1 147 NULL 17 Using index for group-by
148
1 SIMPLE t1 range NULL idx_t1_1 585 NULL 17 Using index for group-by
149
149
explain select a1,a2,b,max(c),min(c) from t2 group by a1,a2,b;
150
150
id select_type table type possible_keys key key_len ref rows Extra
151
1 SIMPLE t2 range NULL idx_t2_1 # NULL # Using index for group-by
151
1 SIMPLE t2 index NULL idx_t2_1 # NULL # Using index
152
152
explain select min(a2), a1, max(a2), min(a2), a1 from t1 group by a1;
153
153
id select_type table type possible_keys key key_len ref rows Extra
154
1 SIMPLE t1 range NULL idx_t1_1 130 NULL 5 Using index for group-by
154
1 SIMPLE t1 range NULL idx_t1_1 518 NULL 5 Using index for group-by
155
155
explain select a1, b, min(c), a1, max(c), b, a2, max(c), max(c) from t1 group by a1, a2, b;
156
156
id select_type table type possible_keys key key_len ref rows Extra
157
1 SIMPLE t1 range NULL idx_t1_1 147 NULL 17 Using index for group-by
157
1 SIMPLE t1 range NULL idx_t1_1 585 NULL 17 Using index for group-by
158
158
explain select min(a2) from t1 group by a1;
159
159
id select_type table type possible_keys key key_len ref rows Extra
160
1 SIMPLE t1 range NULL idx_t1_1 130 NULL 5 Using index for group-by
160
1 SIMPLE t1 range NULL idx_t1_1 518 NULL 5 Using index for group-by
161
161
explain select a2, min(c), max(c) from t1 group by a1,a2,b;
162
162
id select_type table type possible_keys key key_len ref rows Extra
163
1 SIMPLE t1 range NULL idx_t1_1 147 NULL 17 Using index for group-by
163
1 SIMPLE t1 range NULL idx_t1_1 585 NULL 17 Using index for group-by
164
164
select a1, min(a2) from t1 group by a1;
288
288
explain select a1,a2,b,min(c),max(c) from t1 where a1 < 'd' group by a1,a2,b;
289
289
id select_type table type possible_keys key key_len ref rows Extra
290
1 SIMPLE t1 range idx_t1_0,idx_t1_1,idx_t1_2 idx_t1_1 147 NULL 10 Using where; Using index for group-by
290
1 SIMPLE t1 range idx_t1_0,idx_t1_1,idx_t1_2 idx_t1_1 585 NULL 13 Using where; Using index for group-by
291
291
explain select a1,a2,b,min(c),max(c) from t1 where a1 >= 'b' group by a1,a2,b;
292
292
id select_type table type possible_keys key key_len ref rows Extra
293
1 SIMPLE t1 range idx_t1_0,idx_t1_1,idx_t1_2 idx_t1_1 147 NULL 14 Using where; Using index for group-by
293
1 SIMPLE t1 range idx_t1_0,idx_t1_1,idx_t1_2 idx_t1_1 585 NULL 13 Using where; Using index for group-by
294
294
explain select a1,a2,b, max(c) from t1 where a1 >= 'c' or a1 < 'b' group by a1,a2,b;
295
295
id select_type table type possible_keys key key_len ref rows Extra
296
1 SIMPLE t1 range idx_t1_0,idx_t1_1,idx_t1_2 idx_t1_1 147 NULL 14 Using where; Using index for group-by
296
1 SIMPLE t1 range idx_t1_0,idx_t1_1,idx_t1_2 idx_t1_1 585 NULL 13 Using where; Using index for group-by
297
297
explain select a1, max(c) from t1 where a1 >= 'c' or a1 < 'b' group by a1,a2,b;
298
298
id select_type table type possible_keys key key_len ref rows Extra
299
1 SIMPLE t1 range idx_t1_0,idx_t1_1,idx_t1_2 idx_t1_1 147 NULL 14 Using where; Using index for group-by
299
1 SIMPLE t1 range idx_t1_0,idx_t1_1,idx_t1_2 idx_t1_1 585 NULL 13 Using where; Using index for group-by
300
300
explain select a1,a2,b,min(c),max(c) from t1 where a1 >= 'c' or a2 < 'b' group by a1,a2,b;
301
301
id select_type table type possible_keys key key_len ref rows Extra
302
1 SIMPLE t1 range idx_t1_0,idx_t1_1,idx_t1_2 idx_t1_1 147 NULL 17 Using where; Using index for group-by
302
1 SIMPLE t1 range idx_t1_0,idx_t1_1,idx_t1_2 idx_t1_1 585 NULL 17 Using where; Using index for group-by
303
303
explain select a1,a2,b, max(c) from t1 where a1 = 'z' or a1 = 'b' or a1 = 'd' group by a1,a2,b;
304
304
id select_type table type possible_keys key key_len ref rows Extra
305
1 SIMPLE t1 range idx_t1_0,idx_t1_1,idx_t1_2 idx_t1_1 147 NULL 10 Using where; Using index for group-by
305
1 SIMPLE t1 range idx_t1_0,idx_t1_1,idx_t1_2 idx_t1_1 585 NULL 8 Using where; Using index for group-by
306
306
explain select a1,a2,b,min(c),max(c) from t1 where a1 = 'z' or a1 = 'b' or a1 = 'd' group by a1,a2,b;
307
307
id select_type table type possible_keys key key_len ref rows Extra
308
1 SIMPLE t1 range idx_t1_0,idx_t1_1,idx_t1_2 idx_t1_1 147 NULL 10 Using where; Using index for group-by
308
1 SIMPLE t1 range idx_t1_0,idx_t1_1,idx_t1_2 idx_t1_1 585 NULL 8 Using where; Using index for group-by
309
309
explain select a1,a2,b, max(c) from t1 where (a1 = 'b' or a1 = 'd' or a1 = 'a' or a1 = 'c') and (a2 > 'a') group by a1,a2,b;
310
310
id select_type table type possible_keys key key_len ref rows Extra
311
1 SIMPLE t1 range idx_t1_0,idx_t1_1,idx_t1_2 idx_t1_1 147 NULL 10 Using where; Using index for group-by
311
1 SIMPLE t1 range idx_t1_0,idx_t1_1,idx_t1_2 idx_t1_1 585 NULL 8 Using where; Using index for group-by
312
312
explain select a1,a2,b,min(c),max(c) from t1 where (a1 = 'b' or a1 = 'd' or a1 = 'a' or a1 = 'c') and (a2 > 'a') group by a1,a2,b;
313
313
id select_type table type possible_keys key key_len ref rows Extra
314
1 SIMPLE t1 range idx_t1_0,idx_t1_1,idx_t1_2 idx_t1_1 147 NULL 10 Using where; Using index for group-by
314
1 SIMPLE t1 range idx_t1_0,idx_t1_1,idx_t1_2 idx_t1_1 585 NULL 8 Using where; Using index for group-by
315
315
explain select a1,min(c),max(c) from t1 where a1 >= 'b' group by a1,a2,b;
316
316
id select_type table type possible_keys key key_len ref rows Extra
317
1 SIMPLE t1 range idx_t1_0,idx_t1_1,idx_t1_2 idx_t1_1 147 NULL 14 Using where; Using index for group-by
317
1 SIMPLE t1 range idx_t1_0,idx_t1_1,idx_t1_2 idx_t1_1 585 NULL 13 Using where; Using index for group-by
318
318
explain select a1, max(c) from t1 where a1 in ('a','b','d') group by a1,a2,b;
319
319
id select_type table type possible_keys key key_len ref rows Extra
320
1 SIMPLE t1 range idx_t1_0,idx_t1_1,idx_t1_2 idx_t1_1 147 NULL 14 Using where; Using index for group-by
320
1 SIMPLE t1 range idx_t1_0,idx_t1_1,idx_t1_2 idx_t1_1 585 NULL 13 Using where; Using index for group-by
321
321
explain select a1,a2,b, max(c) from t2 where a1 < 'd' group by a1,a2,b;
322
322
id select_type table type possible_keys key key_len ref rows Extra
323
1 SIMPLE t2 range idx_t2_0,idx_t2_1,idx_t2_2 idx_t2_1 146 NULL # Using where; Using index for group-by
323
1 SIMPLE t2 range idx_t2_0,idx_t2_1,idx_t2_2 idx_t2_1 584 NULL # Using where; Using index for group-by
324
324
explain select a1,a2,b,min(c),max(c) from t2 where a1 < 'd' group by a1,a2,b;
325
325
id select_type table type possible_keys key key_len ref rows Extra
326
1 SIMPLE t2 range idx_t2_0,idx_t2_1,idx_t2_2 idx_t2_1 163 NULL # Using where; Using index for group-by
326
1 SIMPLE t2 range idx_t2_0,idx_t2_1,idx_t2_2 idx_t2_1 651 NULL # Using where; Using index for group-by
327
327
explain select a1,a2,b,min(c),max(c) from t2 where a1 >= 'b' group by a1,a2,b;
328
328
id select_type table type possible_keys key key_len ref rows Extra
329
1 SIMPLE t2 range idx_t2_0,idx_t2_1,idx_t2_2 idx_t2_1 163 NULL # Using where; Using index for group-by
329
1 SIMPLE t2 range idx_t2_0,idx_t2_1,idx_t2_2 idx_t2_1 651 NULL # Using where; Using index for group-by
330
330
explain select a1,a2,b, max(c) from t2 where a1 >= 'c' or a1 < 'b' group by a1,a2,b;
331
331
id select_type table type possible_keys key key_len ref rows Extra
332
1 SIMPLE t2 range idx_t2_0,idx_t2_1,idx_t2_2 idx_t2_1 146 NULL # Using where; Using index for group-by
332
1 SIMPLE t2 range idx_t2_0,idx_t2_1,idx_t2_2 idx_t2_1 584 NULL # Using where; Using index for group-by
333
333
explain select a1, max(c) from t2 where a1 >= 'c' or a1 < 'b' group by a1,a2,b;
334
334
id select_type table type possible_keys key key_len ref rows Extra
335
1 SIMPLE t2 range idx_t2_0,idx_t2_1,idx_t2_2 idx_t2_1 146 NULL # Using where; Using index for group-by
335
1 SIMPLE t2 range idx_t2_0,idx_t2_1,idx_t2_2 idx_t2_1 584 NULL # Using where; Using index for group-by
336
336
explain select a1,a2,b,min(c),max(c) from t2 where a1 >= 'c' or a2 < 'b' group by a1,a2,b;
337
337
id select_type table type possible_keys key key_len ref rows Extra
338
1 SIMPLE t2 range idx_t2_0,idx_t2_1,idx_t2_2 idx_t2_1 163 NULL # Using where; Using index for group-by
338
1 SIMPLE t2 index idx_t2_0,idx_t2_1,idx_t2_2 idx_t2_1 651 NULL # Using where; Using index
339
339
explain select a1,a2,b, max(c) from t2 where a1 = 'z' or a1 = 'b' or a1 = 'd' group by a1,a2,b;
340
340
id select_type table type possible_keys key key_len ref rows Extra
341
1 SIMPLE t2 range idx_t2_0,idx_t2_1,idx_t2_2 idx_t2_1 146 NULL # Using where; Using index for group-by
341
1 SIMPLE t2 range idx_t2_0,idx_t2_1,idx_t2_2 idx_t2_1 584 NULL # Using where; Using index for group-by
342
342
explain select a1,a2,b,min(c),max(c) from t2 where a1 = 'z' or a1 = 'b' or a1 = 'd' group by a1,a2,b;
343
343
id select_type table type possible_keys key key_len ref rows Extra
344
1 SIMPLE t2 range idx_t2_0,idx_t2_1,idx_t2_2 idx_t2_1 163 NULL # Using where; Using index for group-by
344
1 SIMPLE t2 range idx_t2_0,idx_t2_1,idx_t2_2 idx_t2_1 651 NULL # Using where; Using index for group-by
345
345
explain select a1,a2,b, max(c) from t2 where (a1 = 'b' or a1 = 'd' or a1 = 'a' or a1 = 'c') and (a2 > 'a') group by a1,a2,b;
346
346
id select_type table type possible_keys key key_len ref rows Extra
347
1 SIMPLE t2 range idx_t2_0,idx_t2_1,idx_t2_2 idx_t2_1 146 NULL # Using where; Using index for group-by
347
1 SIMPLE t2 range idx_t2_0,idx_t2_1,idx_t2_2 idx_t2_1 584 NULL # Using where; Using index for group-by
348
348
explain select a1,a2,b,min(c),max(c) from t2 where (a1 = 'b' or a1 = 'd' or a1 = 'a' or a1 = 'c') and (a2 > 'a') group by a1,a2,b;
349
349
id select_type table type possible_keys key key_len ref rows Extra
350
1 SIMPLE t2 range idx_t2_0,idx_t2_1,idx_t2_2 idx_t2_1 163 NULL # Using where; Using index for group-by
350
1 SIMPLE t2 range idx_t2_0,idx_t2_1,idx_t2_2 idx_t2_1 651 NULL # Using where; Using index for group-by
351
351
explain select a1,min(c),max(c) from t2 where a1 >= 'b' group by a1,a2,b;
352
352
id select_type table type possible_keys key key_len ref rows Extra
353
1 SIMPLE t2 range idx_t2_0,idx_t2_1,idx_t2_2 idx_t2_1 163 NULL # Using where; Using index for group-by
353
1 SIMPLE t2 range idx_t2_0,idx_t2_1,idx_t2_2 idx_t2_1 651 NULL # Using where; Using index for group-by
354
354
explain select a1, max(c) from t2 where a1 in ('a','b','d') group by a1,a2,b;
355
355
id select_type table type possible_keys key key_len ref rows Extra
356
1 SIMPLE t2 range idx_t2_0,idx_t2_1,idx_t2_2 idx_t2_1 146 NULL # Using where; Using index for group-by
356
1 SIMPLE t2 range idx_t2_0,idx_t2_1,idx_t2_2 idx_t2_1 584 NULL # Using where; Using index for group-by
357
357
select a1,a2,b,min(c),max(c) from t1 where a1 < 'd' group by a1,a2,b;
358
358
a1 a2 b min(c) max(c)
670
670
explain select a1,a2,b,max(c),min(c) from t1 where (a2 = 'a') and (b = 'b') group by a1;
671
671
id select_type table type possible_keys key key_len ref rows Extra
672
1 SIMPLE t1 range NULL idx_t1_1 147 NULL 5 Using where; Using index for group-by
672
1 SIMPLE t1 range NULL idx_t1_1 585 NULL 5 Using where; Using index for group-by
673
673
explain select a1,max(c),min(c) from t1 where (a2 = 'a') and (b = 'b') group by a1;
674
674
id select_type table type possible_keys key key_len ref rows Extra
675
1 SIMPLE t1 range NULL idx_t1_1 147 NULL 5 Using where; Using index for group-by
675
1 SIMPLE t1 range NULL idx_t1_1 585 NULL 5 Using where; Using index for group-by
676
676
explain select a1,a2,b, max(c) from t1 where (b = 'b') group by a1,a2;
677
677
id select_type table type possible_keys key key_len ref rows Extra
678
1 SIMPLE t1 range NULL idx_t1_1 147 NULL 9 Using where; Using index for group-by
678
1 SIMPLE t1 range NULL idx_t1_1 585 NULL 9 Using where; Using index for group-by
679
679
explain select a1,a2,b,min(c),max(c) from t1 where (b = 'b') group by a1,a2;
680
680
id select_type table type possible_keys key key_len ref rows Extra
681
1 SIMPLE t1 range NULL idx_t1_1 147 NULL 9 Using where; Using index for group-by
681
1 SIMPLE t1 range NULL idx_t1_1 585 NULL 9 Using where; Using index for group-by
682
682
explain select a1,a2, max(c) from t1 where (b = 'b') group by a1,a2;
683
683
id select_type table type possible_keys key key_len ref rows Extra
684
1 SIMPLE t1 range NULL idx_t1_1 147 NULL 9 Using where; Using index for group-by
684
1 SIMPLE t1 range NULL idx_t1_1 585 NULL 9 Using where; Using index for group-by
685
685
explain select a1,a2,b,max(c),min(c) from t2 where (a2 = 'a') and (b = 'b') group by a1;
686
686
id select_type table type possible_keys key key_len ref rows Extra
687
1 SIMPLE t2 range NULL idx_t2_1 163 NULL 5 Using where; Using index for group-by
687
1 SIMPLE t2 range NULL idx_t2_1 651 NULL 5 Using where; Using index for group-by
688
688
explain select a1,max(c),min(c) from t2 where (a2 = 'a') and (b = 'b') group by a1;
689
689
id select_type table type possible_keys key key_len ref rows Extra
690
1 SIMPLE t2 range NULL idx_t2_1 163 NULL 5 Using where; Using index for group-by
690
1 SIMPLE t2 range NULL idx_t2_1 651 NULL 5 Using where; Using index for group-by
691
691
explain select a1,a2,b, max(c) from t2 where (b = 'b') group by a1,a2;
692
692
id select_type table type possible_keys key key_len ref rows Extra
693
1 SIMPLE t2 range NULL idx_t2_1 146 NULL 10 Using where; Using index for group-by
693
1 SIMPLE t2 range NULL idx_t2_1 584 NULL 10 Using where; Using index for group-by
694
694
explain select a1,a2,b,min(c),max(c) from t2 where (b = 'b') group by a1,a2;
695
695
id select_type table type possible_keys key key_len ref rows Extra
696
1 SIMPLE t2 range NULL idx_t2_1 163 NULL 10 Using where; Using index for group-by
696
1 SIMPLE t2 range NULL idx_t2_1 651 NULL 10 Using where; Using index for group-by
697
697
explain select a1,a2, max(c) from t2 where (b = 'b') group by a1,a2;
698
698
id select_type table type possible_keys key key_len ref rows Extra
699
1 SIMPLE t2 range NULL idx_t2_1 146 NULL 10 Using where; Using index for group-by
699
1 SIMPLE t2 range NULL idx_t2_1 584 NULL 10 Using where; Using index for group-by
700
700
explain select a1,a2,b,max(c),min(c) from t3 where (a2 = 'a') and (b = 'b') group by a1;
701
701
id select_type table type possible_keys key key_len ref rows Extra
702
1 SIMPLE t3 range NULL idx_t3_1 6 NULL 4 Using where; Using index for group-by
702
1 SIMPLE t3 range NULL idx_t3_1 21 NULL 4 Using where; Using index for group-by
703
703
explain select a1,max(c),min(c) from t3 where (a2 = 'a') and (b = 'b') group by a1;
704
704
id select_type table type possible_keys key key_len ref rows Extra
705
1 SIMPLE t3 range NULL idx_t3_1 6 NULL 4 Using where; Using index for group-by
705
1 SIMPLE t3 range NULL idx_t3_1 21 NULL 4 Using where; Using index for group-by
706
706
select a1,a2,b,max(c),min(c) from t1 where (a2 = 'a') and (b = 'b') group by a1;
707
707
a1 a2 b max(c) min(c)
805
805
explain select a1,a2,b,min(c) from t2 where (a2 = 'a') and b is NULL group by a1;
806
806
id select_type table type possible_keys key key_len ref rows Extra
807
1 SIMPLE t2 range NULL idx_t2_1 163 NULL 5 Using where; Using index for group-by
807
1 SIMPLE t2 range NULL idx_t2_1 651 NULL 5 Using where; Using index for group-by
808
808
explain select a1,a2,b,max(c) from t2 where (a2 = 'a') and b is NULL group by a1;
809
809
id select_type table type possible_keys key key_len ref rows Extra
810
1 SIMPLE t2 range NULL idx_t2_1 146 NULL 5 Using where; Using index for group-by
810
1 SIMPLE t2 range NULL idx_t2_1 584 NULL 5 Using where; Using index for group-by
811
811
explain select a1,a2,b,min(c) from t2 where b is NULL group by a1,a2;
812
812
id select_type table type possible_keys key key_len ref rows Extra
813
1 SIMPLE t2 range NULL idx_t2_1 163 NULL 10 Using where; Using index for group-by
813
1 SIMPLE t2 range NULL idx_t2_1 651 NULL 10 Using where; Using index for group-by
814
814
explain select a1,a2,b,max(c) from t2 where b is NULL group by a1,a2;
815
815
id select_type table type possible_keys key key_len ref rows Extra
816
1 SIMPLE t2 range NULL idx_t2_1 146 NULL 10 Using where; Using index for group-by
817
explain select a1,a2,b,min(c),max(c) from t2 where b is NULL group by a1,a2;
818
id select_type table type possible_keys key key_len ref rows Extra
819
1 SIMPLE t2 range NULL idx_t2_1 163 NULL 10 Using where; Using index for group-by
820
explain select a1,a2,b,min(c),max(c) from t2 where b is NULL group by a1,a2;
821
id select_type table type possible_keys key key_len ref rows Extra
822
1 SIMPLE t2 range NULL idx_t2_1 163 NULL 10 Using where; Using index for group-by
816
1 SIMPLE t2 range NULL idx_t2_1 584 NULL 10 Using where; Using index for group-by
817
explain select a1,a2,b,min(c),max(c) from t2 where b is NULL group by a1,a2;
818
id select_type table type possible_keys key key_len ref rows Extra
819
1 SIMPLE t2 range NULL idx_t2_1 651 NULL 10 Using where; Using index for group-by
820
explain select a1,a2,b,min(c),max(c) from t2 where b is NULL group by a1,a2;
821
id select_type table type possible_keys key key_len ref rows Extra
822
1 SIMPLE t2 range NULL idx_t2_1 651 NULL 10 Using where; Using index for group-by
823
823
select a1,a2,b,min(c) from t2 where (a2 = 'a') and b is NULL group by a1;
846
846
c a NULL c777 c999
847
847
explain select a1,a2,b, max(c) from t1 where (c > 'b1') group by a1,a2,b;
848
848
id select_type table type possible_keys key key_len ref rows Extra
849
1 SIMPLE t1 range NULL idx_t1_1 147 NULL # Using where; Using index for group-by
849
1 SIMPLE t1 range NULL idx_t1_1 585 NULL # Using where; Using index for group-by
850
850
explain select a1,a2,b,min(c),max(c) from t1 where (c > 'b1') group by a1,a2,b;
851
851
id select_type table type possible_keys key key_len ref rows Extra
852
1 SIMPLE t1 range NULL idx_t1_1 163 NULL 17 Using where; Using index for group-by
852
1 SIMPLE t1 range NULL idx_t1_1 651 NULL 17 Using where; Using index for group-by
853
853
explain select a1,a2,b, max(c) from t1 where (c > 'f123') group by a1,a2,b;
854
854
id select_type table type possible_keys key key_len ref rows Extra
855
1 SIMPLE t1 range NULL idx_t1_1 147 NULL 17 Using where; Using index for group-by
855
1 SIMPLE t1 range NULL idx_t1_1 585 NULL 17 Using where; Using index for group-by
856
856
explain select a1,a2,b,min(c),max(c) from t1 where (c > 'f123') group by a1,a2,b;
857
857
id select_type table type possible_keys key key_len ref rows Extra
858
1 SIMPLE t1 range NULL idx_t1_1 163 NULL 17 Using where; Using index for group-by
858
1 SIMPLE t1 range NULL idx_t1_1 651 NULL 17 Using where; Using index for group-by
859
859
explain select a1,a2,b, max(c) from t1 where (c < 'a0') group by a1,a2,b;
860
860
id select_type table type possible_keys key key_len ref rows Extra
861
1 SIMPLE t1 range NULL idx_t1_1 163 NULL 17 Using where; Using index for group-by
861
1 SIMPLE t1 range NULL idx_t1_1 651 NULL 17 Using where; Using index for group-by
862
862
explain select a1,a2,b,min(c),max(c) from t1 where (c < 'a0') group by a1,a2,b;
863
863
id select_type table type possible_keys key key_len ref rows Extra
864
1 SIMPLE t1 range NULL idx_t1_1 163 NULL 17 Using where; Using index for group-by
864
1 SIMPLE t1 range NULL idx_t1_1 651 NULL 17 Using where; Using index for group-by
865
865
explain select a1,a2,b, max(c) from t1 where (c < 'k321') group by a1,a2,b;
866
866
id select_type table type possible_keys key key_len ref rows Extra
867
1 SIMPLE t1 range NULL idx_t1_1 163 NULL 17 Using where; Using index for group-by
867
1 SIMPLE t1 range NULL idx_t1_1 651 NULL 17 Using where; Using index for group-by
868
868
explain select a1,a2,b,min(c),max(c) from t1 where (c < 'k321') group by a1,a2,b;
869
869
id select_type table type possible_keys key key_len ref rows Extra
870
1 SIMPLE t1 range NULL idx_t1_1 163 NULL 17 Using where; Using index for group-by
870
1 SIMPLE t1 range NULL idx_t1_1 651 NULL 17 Using where; Using index for group-by
871
871
explain select a1,a2,b, max(c) from t1 where (c < 'a0') or (c > 'b1') group by a1,a2,b;
872
872
id select_type table type possible_keys key key_len ref rows Extra
873
1 SIMPLE t1 range NULL idx_t1_1 163 NULL 17 Using where; Using index for group-by
873
1 SIMPLE t1 range NULL idx_t1_1 651 NULL 17 Using where; Using index for group-by
874
874
explain select a1,a2,b,min(c),max(c) from t1 where (c < 'a0') or (c > 'b1') group by a1,a2,b;
875
875
id select_type table type possible_keys key key_len ref rows Extra
876
1 SIMPLE t1 range NULL idx_t1_1 163 NULL 17 Using where; Using index for group-by
876
1 SIMPLE t1 range NULL idx_t1_1 651 NULL 17 Using where; Using index for group-by
877
877
explain select a1,a2,b, max(c) from t1 where (c > 'b1') or (c <= 'g1') group by a1,a2,b;
878
878
id select_type table type possible_keys key key_len ref rows Extra
879
1 SIMPLE t1 range NULL idx_t1_1 147 NULL 17 Using where; Using index for group-by
879
1 SIMPLE t1 range NULL idx_t1_1 585 NULL 17 Using where; Using index for group-by
880
880
explain select a1,a2,b,min(c),max(c) from t1 where (c > 'b1') or (c <= 'g1') group by a1,a2,b;
881
881
id select_type table type possible_keys key key_len ref rows Extra
882
1 SIMPLE t1 range NULL idx_t1_1 147 NULL 17 Using where; Using index for group-by
882
1 SIMPLE t1 range NULL idx_t1_1 585 NULL 17 Using where; Using index for group-by
883
883
explain select a1,a2,b,min(c),max(c) from t1 where (c > 'b111') and (c <= 'g112') group by a1,a2,b;
884
884
id select_type table type possible_keys key key_len ref rows Extra
885
1 SIMPLE t1 range NULL idx_t1_1 163 NULL 17 Using where; Using index for group-by
885
1 SIMPLE t1 range NULL idx_t1_1 651 NULL 17 Using where; Using index for group-by
886
886
explain select a1,a2,b,min(c),max(c) from t1 where (c < 'c5') or (c = 'g412') or (c = 'k421') group by a1,a2,b;
887
887
id select_type table type possible_keys key key_len ref rows Extra
888
1 SIMPLE t1 range NULL idx_t1_1 163 NULL 17 Using where; Using index for group-by
888
1 SIMPLE t1 range NULL idx_t1_1 651 NULL 17 Using where; Using index for group-by
889
889
explain select a1,a2,b,min(c),max(c) from t1 where ((c > 'b111') and (c <= 'g112')) or ((c > 'd000') and (c <= 'i110')) group by a1,a2,b;
890
890
id select_type table type possible_keys key key_len ref rows Extra
891
1 SIMPLE t1 range NULL idx_t1_1 163 NULL 17 Using where; Using index for group-by
891
1 SIMPLE t1 range NULL idx_t1_1 651 NULL 17 Using where; Using index for group-by
892
892
explain select a1,a2,b,min(c),max(c) from t1 where (c between 'b111' and 'g112') or (c between 'd000' and 'i110') group by a1,a2,b;
893
893
id select_type table type possible_keys key key_len ref rows Extra
894
1 SIMPLE t1 range NULL idx_t1_1 163 NULL 17 Using where; Using index for group-by
894
1 SIMPLE t1 range NULL idx_t1_1 651 NULL 17 Using where; Using index for group-by
895
895
explain select a1,a2,b, max(c) from t2 where (c > 'b1') group by a1,a2,b;
896
896
id select_type table type possible_keys key key_len ref rows Extra
897
1 SIMPLE t2 range NULL idx_t2_1 146 NULL # Using where; Using index for group-by
897
1 SIMPLE t2 index NULL idx_t2_1 651 NULL # Using where; Using index
898
898
explain select a1,a2,b,min(c),max(c) from t2 where (c > 'b1') group by a1,a2,b;
899
899
id select_type table type possible_keys key key_len ref rows Extra
900
1 SIMPLE t2 range NULL idx_t2_1 163 NULL # Using where; Using index for group-by
900
1 SIMPLE t2 index NULL idx_t2_1 651 NULL # Using where; Using index
901
901
explain select a1,a2,b, max(c) from t2 where (c > 'f123') group by a1,a2,b;
902
902
id select_type table type possible_keys key key_len ref rows Extra
903
1 SIMPLE t2 range NULL idx_t2_1 146 NULL # Using where; Using index for group-by
903
1 SIMPLE t2 index NULL idx_t2_1 651 NULL # Using where; Using index
904
904
explain select a1,a2,b,min(c),max(c) from t2 where (c > 'f123') group by a1,a2,b;
905
905
id select_type table type possible_keys key key_len ref rows Extra
906
1 SIMPLE t2 range NULL idx_t2_1 163 NULL # Using where; Using index for group-by
906
1 SIMPLE t2 index NULL idx_t2_1 651 NULL # Using where; Using index
907
907
explain select a1,a2,b, max(c) from t2 where (c < 'a0') group by a1,a2,b;
908
908
id select_type table type possible_keys key key_len ref rows Extra
909
1 SIMPLE t2 range NULL idx_t2_1 163 NULL # Using where; Using index for group-by
909
1 SIMPLE t2 index NULL idx_t2_1 651 NULL # Using where; Using index
910
910
explain select a1,a2,b,min(c),max(c) from t2 where (c < 'a0') group by a1,a2,b;
911
911
id select_type table type possible_keys key key_len ref rows Extra
912
1 SIMPLE t2 range NULL idx_t2_1 163 NULL # Using where; Using index for group-by
912
1 SIMPLE t2 index NULL idx_t2_1 651 NULL # Using where; Using index
913
913
explain select a1,a2,b, max(c) from t2 where (c < 'k321') group by a1,a2,b;
914
914
id select_type table type possible_keys key key_len ref rows Extra
915
1 SIMPLE t2 range NULL idx_t2_1 163 NULL # Using where; Using index for group-by
915
1 SIMPLE t2 index NULL idx_t2_1 651 NULL # Using where; Using index
916
916
explain select a1,a2,b,min(c),max(c) from t2 where (c < 'k321') group by a1,a2,b;
917
917
id select_type table type possible_keys key key_len ref rows Extra
918
1 SIMPLE t2 range NULL idx_t2_1 163 NULL # Using where; Using index for group-by
918
1 SIMPLE t2 index NULL idx_t2_1 651 NULL # Using where; Using index
919
919
explain select a1,a2,b, max(c) from t2 where (c < 'a0') or (c > 'b1') group by a1,a2,b;
920
920
id select_type table type possible_keys key key_len ref rows Extra
921
1 SIMPLE t2 range NULL idx_t2_1 163 NULL # Using where; Using index for group-by
921
1 SIMPLE t2 index NULL idx_t2_1 651 NULL # Using where; Using index
922
922
explain select a1,a2,b,min(c),max(c) from t2 where (c < 'a0') or (c > 'b1') group by a1,a2,b;
923
923
id select_type table type possible_keys key key_len ref rows Extra
924
1 SIMPLE t2 range NULL idx_t2_1 163 NULL # Using where; Using index for group-by
924
1 SIMPLE t2 index NULL idx_t2_1 651 NULL # Using where; Using index
925
925
explain select a1,a2,b, max(c) from t2 where (c > 'b1') or (c <= 'g1') group by a1,a2,b;
926
926
id select_type table type possible_keys key key_len ref rows Extra
927
1 SIMPLE t2 range NULL idx_t2_1 146 NULL # Using where; Using index for group-by
927
1 SIMPLE t2 index NULL idx_t2_1 651 NULL # Using where; Using index
928
928
explain select a1,a2,b,min(c),max(c) from t2 where (c > 'b1') or (c <= 'g1') group by a1,a2,b;
929
929
id select_type table type possible_keys key key_len ref rows Extra
930
1 SIMPLE t2 range NULL idx_t2_1 163 NULL # Using where; Using index for group-by
930
1 SIMPLE t2 index NULL idx_t2_1 651 NULL # Using where; Using index
931
931
explain select a1,a2,b,min(c),max(c) from t2 where (c > 'b111') and (c <= 'g112') group by a1,a2,b;
932
932
id select_type table type possible_keys key key_len ref rows Extra
933
1 SIMPLE t2 range NULL idx_t2_1 163 NULL # Using where; Using index for group-by
933
1 SIMPLE t2 index NULL idx_t2_1 651 NULL # Using where; Using index
934
934
explain select a1,a2,b,min(c),max(c) from t2 where (c < 'c5') or (c = 'g412') or (c = 'k421') group by a1,a2,b;
935
935
id select_type table type possible_keys key key_len ref rows Extra
936
1 SIMPLE t2 range NULL idx_t2_1 163 NULL # Using where; Using index for group-by
936
1 SIMPLE t2 index NULL idx_t2_1 651 NULL # Using where; Using index
937
937
explain select a1,a2,b,min(c),max(c) from t2 where ((c > 'b111') and (c <= 'g112')) or ((c > 'd000') and (c <= 'i110')) group by a1,a2,b;
938
938
id select_type table type possible_keys key key_len ref rows Extra
939
1 SIMPLE t2 range NULL idx_t2_1 163 NULL # Using where; Using index for group-by
939
1 SIMPLE t2 index NULL idx_t2_1 651 NULL # Using where; Using index
940
940
select a1,a2,b, max(c) from t1 where (c > 'b1') group by a1,a2,b;
958
select a1,a2,b,min(c),max(c) from t1 where (c > 'b1') group by a1,a2,b;
959
a1 a2 b min(c) max(c)
976
942
select a1,a2,b, max(c) from t1 where (c > 'f123') group by a1,a2,b;
990
select a1,a2,b,min(c),max(c) from t1 where (c > 'f123') group by a1,a2,b;
991
a1 a2 b min(c) max(c)
1004
944
select a1,a2,b, max(c) from t1 where (c < 'a0') group by a1,a2,b;
1006
946
select a1,a2,b,min(c),max(c) from t1 where (c < 'a0') group by a1,a2,b;
1358
1224
where exists ( select * from t2 where t2.c = t1.c )
1359
1225
group by a1,a2,b;
1360
1226
id select_type table type possible_keys key key_len ref rows Extra
1361
1 PRIMARY t1 index NULL idx_t1_1 163 NULL 128 Using where; Using index
1362
2 DEPENDENT SUBQUERY t2 index NULL idx_t2_1 163 NULL 164 Using where; Using index
1227
1 PRIMARY t1 index NULL idx_t1_1 651 NULL 128 Using where; Using index
1228
2 DEPENDENT SUBQUERY t2 index NULL idx_t2_1 651 NULL 164 Using where; Using index
1363
1229
explain select a1,a2,b,min(c),max(c) from t1
1364
1230
where exists ( select * from t2 where t2.c > 'b1' )
1365
1231
group by a1,a2,b;
1366
1232
id select_type table type possible_keys key key_len ref rows Extra
1367
1 PRIMARY t1 range NULL idx_t1_1 147 NULL 17 Using index for group-by
1368
2 SUBQUERY t2 index NULL idx_t2_1 163 NULL 164 Using where; Using index
1233
1 PRIMARY t1 range NULL idx_t1_1 585 NULL 17 Using index for group-by
1234
2 SUBQUERY t2 index NULL idx_t2_1 651 NULL 164 Using where; Using index
1369
1235
explain select a1,a2,b,min(c),max(c) from t1 where (a1 >= 'c' or a2 < 'b') and (b > 'a') group by a1,a2,b;
1370
1236
id select_type table type possible_keys key key_len ref rows Extra
1371
1 SIMPLE t1 range idx_t1_0,idx_t1_1,idx_t1_2 idx_t1_1 147 NULL 17 Using where; Using index for group-by
1237
1 SIMPLE t1 range idx_t1_0,idx_t1_1,idx_t1_2 idx_t1_1 585 NULL 17 Using where; Using index for group-by
1372
1238
explain select a1,a2,b,min(c),max(c) from t1 where (a1 >= 'c' or a2 < 'b') and (c > 'b111') group by a1,a2,b;
1373
1239
id select_type table type possible_keys key key_len ref rows Extra
1374
1 SIMPLE t1 range idx_t1_0,idx_t1_1,idx_t1_2 idx_t1_1 163 NULL 17 Using where; Using index for group-by
1240
1 SIMPLE t1 range idx_t1_0,idx_t1_1,idx_t1_2 idx_t1_1 651 NULL 17 Using where; Using index for group-by
1375
1241
explain select a1,a2,b,min(c),max(c) from t1 where (a2 >= 'b') and (b = 'a') and (c > 'b111') group by a1,a2,b;
1376
1242
id select_type table type possible_keys key key_len ref rows Extra
1377
1 SIMPLE t1 range NULL idx_t1_1 163 NULL 17 Using where; Using index for group-by
1243
1 SIMPLE t1 range NULL idx_t1_1 651 NULL 17 Using where; Using index for group-by
1378
1244
explain select a1,a2,b,min(c) from t1 where ((a1 > 'a') or (a1 < '9')) and ((a2 >= 'b') and (a2 < 'z')) and (b = 'a') and ((c < 'h112') or (c = 'j121') or (c > 'k121' and c < 'm122') or (c > 'o122')) group by a1,a2,b;
1379
1245
id select_type table type possible_keys key key_len ref rows Extra
1380
1 SIMPLE t1 range idx_t1_0,idx_t1_1,idx_t1_2 idx_t1_1 163 NULL 14 Using where; Using index for group-by
1246
1 SIMPLE t1 range idx_t1_0,idx_t1_1,idx_t1_2 idx_t1_1 651 NULL 13 Using where; Using index for group-by
1381
1247
explain select a1,a2,b,min(c) from t1 where ((a1 > 'a') or (a1 < '9')) and ((a2 >= 'b') and (a2 < 'z')) and (b = 'a') and ((c = 'j121') or (c > 'k121' and c < 'm122') or (c > 'o122') or (c < 'h112') or (c = 'c111')) group by a1,a2,b;
1382
1248
id select_type table type possible_keys key key_len ref rows Extra
1383
1 SIMPLE t1 range idx_t1_0,idx_t1_1,idx_t1_2 idx_t1_1 163 NULL 14 Using where; Using index for group-by
1249
1 SIMPLE t1 range idx_t1_0,idx_t1_1,idx_t1_2 idx_t1_1 651 NULL 13 Using where; Using index for group-by
1384
1250
explain select a1,a2,b,min(c) from t1 where (a1 > 'a') and (a2 > 'a') and (b = 'c') group by a1,a2,b;
1385
1251
id select_type table type possible_keys key key_len ref rows Extra
1386
1 SIMPLE t1 range idx_t1_0,idx_t1_1,idx_t1_2 idx_t1_1 147 NULL 14 Using where; Using index for group-by
1252
1 SIMPLE t1 range idx_t1_0,idx_t1_1,idx_t1_2 idx_t1_1 585 NULL 13 Using where; Using index for group-by
1387
1253
explain select a1,a2,b,min(c) from t1 where (ord(a1) > 97) and (ord(a2) + ord(a1) > 194) and (b = 'c') group by a1,a2,b;
1388
1254
id select_type table type possible_keys key key_len ref rows Extra
1389
1 SIMPLE t1 range NULL idx_t1_1 147 NULL 17 Using where; Using index for group-by
1255
1 SIMPLE t1 range NULL idx_t1_1 585 NULL 17 Using where; Using index for group-by
1390
1256
explain select a1,a2,b,min(c),max(c) from t2 where (a1 >= 'c' or a2 < 'b') and (b > 'a') group by a1,a2,b;
1391
1257
id select_type table type possible_keys key key_len ref rows Extra
1392
1 SIMPLE t2 range idx_t2_0,idx_t2_1,idx_t2_2 idx_t2_1 163 NULL # Using where; Using index for group-by
1258
1 SIMPLE t2 index idx_t2_0,idx_t2_1,idx_t2_2 idx_t2_1 651 NULL # Using where; Using index
1393
1259
explain select a1,a2,b,min(c),max(c) from t2 where (a1 >= 'c' or a2 < 'b') and (c > 'b111') group by a1,a2,b;
1394
1260
id select_type table type possible_keys key key_len ref rows Extra
1395
1 SIMPLE t2 range idx_t2_0,idx_t2_1,idx_t2_2 idx_t2_1 163 NULL # Using where; Using index for group-by
1261
1 SIMPLE t2 index idx_t2_0,idx_t2_1,idx_t2_2 idx_t2_1 651 NULL # Using where; Using index
1396
1262
explain select a1,a2,b,min(c),max(c) from t2 where (a2 >= 'b') and (b = 'a') and (c > 'b111') group by a1,a2,b;
1397
1263
id select_type table type possible_keys key key_len ref rows Extra
1398
1 SIMPLE t2 range NULL idx_t2_1 163 NULL # Using where; Using index for group-by
1264
1 SIMPLE t2 index NULL idx_t2_1 651 NULL # Using where; Using index
1399
1265
explain select a1,a2,b,min(c) from t2 where ((a1 > 'a') or (a1 < '9')) and ((a2 >= 'b') and (a2 < 'z')) and (b = 'a') and ((c < 'h112') or (c = 'j121') or (c > 'k121' and c < 'm122') or (c > 'o122')) group by a1,a2,b;
1400
1266
id select_type table type possible_keys key key_len ref rows Extra
1401
1 SIMPLE t2 range idx_t2_0,idx_t2_1,idx_t2_2 idx_t2_1 163 NULL # Using where; Using index for group-by
1267
1 SIMPLE t2 range idx_t2_0,idx_t2_1,idx_t2_2 idx_t2_1 651 NULL # Using where; Using index for group-by
1402
1268
explain select a1,a2,b,min(c) from t2 where ((a1 > 'a') or (a1 < '9')) and ((a2 >= 'b') and (a2 < 'z')) and (b = 'a') and ((c = 'j121') or (c > 'k121' and c < 'm122') or (c > 'o122') or (c < 'h112') or (c = 'c111')) group by a1,a2,b;
1403
1269
id select_type table type possible_keys key key_len ref rows Extra
1404
1 SIMPLE t2 range idx_t2_0,idx_t2_1,idx_t2_2 idx_t2_1 163 NULL # Using where; Using index for group-by
1270
1 SIMPLE t2 range idx_t2_0,idx_t2_1,idx_t2_2 idx_t2_1 651 NULL # Using where; Using index for group-by
1405
1271
explain select a1,a2,b,min(c) from t2 where (a1 > 'a') and (a2 > 'a') and (b = 'c') group by a1,a2,b;
1406
1272
id select_type table type possible_keys key key_len ref rows Extra
1407
1 SIMPLE t2 range idx_t2_0,idx_t2_1,idx_t2_2 idx_t2_1 163 NULL # Using where; Using index for group-by
1273
1 SIMPLE t2 range idx_t2_0,idx_t2_1,idx_t2_2 idx_t2_1 651 NULL # Using where; Using index for group-by
1408
1274
select a1,a2,b,min(c),max(c) from t1 where (a1 >= 'c' or a2 < 'b') and (b > 'a') group by a1,a2,b;
1409
1275
a1 a2 b min(c) max(c)
1410
1276
a a b e112 h112
1479
1319
d b a i421 l421
1480
1320
select a1,a2,b,min(c) from t2 where ((a1 > 'a') or (a1 < '9')) and ((a2 >= 'b') and (a2 < 'z')) and (b = 'a') and ((c < 'h112') or (c = 'j121') or (c > 'k121' and c < 'm122') or (c > 'o122')) group by a1,a2,b;
1485
1322
select a1,a2,b,min(c) from t2 where ((a1 > 'a') or (a1 < '9')) and ((a2 >= 'b') and (a2 < 'z')) and (b = 'a') and ((c = 'j121') or (c > 'k121' and c < 'm122') or (c > 'o122') or (c < 'h112') or (c = 'c111')) group by a1,a2,b;
1490
1324
select a1,a2,b,min(c) from t2 where (a1 > 'a') and (a2 > 'a') and (b = 'c') group by a1,a2,b;
1492
1326
explain select a1,a2,b from t1 where (a1 >= 'c' or a2 < 'b') and (b > 'a') group by a1,a2,b;
1493
1327
id select_type table type possible_keys key key_len ref rows Extra
1494
1 SIMPLE t1 range idx_t1_0,idx_t1_1,idx_t1_2 idx_t1_1 147 NULL 17 Using where; Using index for group-by
1328
1 SIMPLE t1 range idx_t1_0,idx_t1_1,idx_t1_2 idx_t1_1 585 NULL 17 Using where; Using index for group-by
1495
1329
explain select a1,a2,b from t1 where (a2 >= 'b') and (b = 'a') group by a1,a2,b;
1496
1330
id select_type table type possible_keys key key_len ref rows Extra
1497
1 SIMPLE t1 range NULL idx_t1_1 147 NULL 17 Using where; Using index for group-by
1331
1 SIMPLE t1 range NULL idx_t1_1 585 NULL 17 Using where; Using index for group-by
1498
1332
explain select a1,a2,b,c from t1 where (a2 >= 'b') and (b = 'a') and (c = 'i121') group by a1,a2,b;
1499
1333
id select_type table type possible_keys key key_len ref rows Extra
1500
1 SIMPLE t1 range NULL idx_t1_1 163 NULL 17 Using where; Using index for group-by
1334
1 SIMPLE t1 index NULL idx_t1_1 651 NULL 128 Using where; Using index
1501
1335
explain select a1,a2,b from t1 where (a1 > 'a') and (a2 > 'a') and (b = 'c') group by a1,a2,b;
1502
1336
id select_type table type possible_keys key key_len ref rows Extra
1503
1 SIMPLE t1 range idx_t1_0,idx_t1_1,idx_t1_2 idx_t1_1 147 NULL 14 Using where; Using index for group-by
1337
1 SIMPLE t1 range idx_t1_0,idx_t1_1,idx_t1_2 idx_t1_1 585 NULL 13 Using where; Using index for group-by
1504
1338
explain select a1,a2,b from t2 where (a1 >= 'c' or a2 < 'b') and (b > 'a') group by a1,a2,b;
1505
1339
id select_type table type possible_keys key key_len ref rows Extra
1506
1 SIMPLE t2 range idx_t2_0,idx_t2_1,idx_t2_2 idx_t2_1 146 NULL # Using where; Using index for group-by
1340
1 SIMPLE t2 index idx_t2_0,idx_t2_1,idx_t2_2 idx_t2_2 584 NULL # Using where; Using index
1507
1341
explain select a1,a2,b from t2 where (a2 >= 'b') and (b = 'a') group by a1,a2,b;
1508
1342
id select_type table type possible_keys key key_len ref rows Extra
1509
1 SIMPLE t2 range NULL idx_t2_1 146 NULL # Using where; Using index for group-by
1343
1 SIMPLE t2 index NULL idx_t2_2 584 NULL # Using where; Using index
1510
1344
explain select a1,a2,b,c from t2 where (a2 >= 'b') and (b = 'a') and (c = 'i121') group by a1,a2,b;
1511
1345
id select_type table type possible_keys key key_len ref rows Extra
1512
1 SIMPLE t2 index NULL idx_t2_1 163 NULL # Using where; Using index
1346
1 SIMPLE t2 index NULL idx_t2_1 651 NULL # Using where; Using index
1513
1347
explain select a1,a2,b from t2 where (a1 > 'a') and (a2 > 'a') and (b = 'c') group by a1,a2,b;
1514
1348
id select_type table type possible_keys key key_len ref rows Extra
1515
1 SIMPLE t2 range idx_t2_0,idx_t2_1,idx_t2_2 idx_t2_1 146 NULL # Using where; Using index for group-by
1349
1 SIMPLE t2 range idx_t2_0,idx_t2_1,idx_t2_2 idx_t2_1 584 NULL # Using where; Using index for group-by
1516
1350
select a1,a2,b from t1 where (a1 >= 'c' or a2 < 'b') and (b > 'a') group by a1,a2,b;
1555
1389
explain select distinct a1,a2,b from t1;
1556
1390
id select_type table type possible_keys key key_len ref rows Extra
1557
1 SIMPLE t1 range NULL idx_t1_1 147 NULL 17 Using index for group-by
1391
1 SIMPLE t1 range NULL idx_t1_1 585 NULL 17 Using index for group-by
1558
1392
explain select distinct a1,a2,b from t1 where (a2 >= 'b') and (b = 'a');
1559
1393
id select_type table type possible_keys key key_len ref rows Extra
1560
1 SIMPLE t1 range NULL idx_t1_1 147 NULL 17 Using where; Using index for group-by
1394
1 SIMPLE t1 range NULL idx_t1_1 585 NULL 17 Using where; Using index for group-by
1561
1395
explain extended select distinct a1,a2,b,c from t1 where (a2 >= 'b') and (b = 'a') and (c = 'i121');
1562
1396
id select_type table type possible_keys key key_len ref rows filtered Extra
1563
1 SIMPLE t1 index NULL idx_t1_1 163 NULL 128 50.78 Using where; Using index
1397
1 SIMPLE t1 index NULL idx_t1_1 651 NULL 128 50.78 Using where; Using index
1565
Note 1003 select distinct "test"."t1"."a1" AS "a1","test"."t1"."a2" AS "a2","test"."t1"."b" AS "b","test"."t1"."c" AS "c" from "test"."t1" where (("test"."t1"."c" = 'i121') and ("test"."t1"."b" = 'a') and ("test"."t1"."a2" >= 'b'))
1399
Note 1003 select distinct `test`.`t1`.`a1` AS `a1`,`test`.`t1`.`a2` AS `a2`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c` from `test`.`t1` where ((`test`.`t1`.`a2` >= 'b') and (`test`.`t1`.`b` = 'a') and (`test`.`t1`.`c` = 'i121'))
1566
1400
explain select distinct a1,a2,b from t1 where (a1 > 'a') and (a2 > 'a') and (b = 'c');
1567
1401
id select_type table type possible_keys key key_len ref rows Extra
1568
1 SIMPLE t1 range idx_t1_0,idx_t1_1,idx_t1_2 idx_t1_1 147 NULL 14 Using where; Using index for group-by
1402
1 SIMPLE t1 range idx_t1_0,idx_t1_1,idx_t1_2 idx_t1_1 585 NULL 13 Using where; Using index for group-by
1569
1403
explain select distinct b from t1 where (a2 >= 'b') and (b = 'a');
1570
1404
id select_type table type possible_keys key key_len ref rows Extra
1571
1 SIMPLE t1 index NULL idx_t1_2 147 NULL 128 Using where; Using index
1405
1 SIMPLE t1 index NULL idx_t1_2 585 NULL 128 Using where; Using index
1572
1406
explain select distinct a1,a2,b from t2;
1573
1407
id select_type table type possible_keys key key_len ref rows Extra
1574
1 SIMPLE t2 range NULL idx_t2_1 146 NULL # Using index for group-by
1408
1 SIMPLE t2 index NULL idx_t2_2 584 NULL # Using index
1575
1409
explain select distinct a1,a2,b from t2 where (a2 >= 'b') and (b = 'a');
1576
1410
id select_type table type possible_keys key key_len ref rows Extra
1577
1 SIMPLE t2 range NULL idx_t2_1 146 NULL # Using where; Using index for group-by
1411
1 SIMPLE t2 index NULL idx_t2_2 584 NULL # Using where; Using index
1578
1412
explain extended select distinct a1,a2,b,c from t2 where (a2 >= 'b') and (b = 'a') and (c = 'i121');
1579
1413
id select_type table type possible_keys key key_len ref rows filtered Extra
1580
1 SIMPLE t2 index NULL idx_t2_1 163 NULL 164 50.61 Using where; Using index
1414
1 SIMPLE t2 index NULL idx_t2_1 651 NULL 164 50.61 Using where; Using index
1582
Note 1003 select distinct "test"."t2"."a1" AS "a1","test"."t2"."a2" AS "a2","test"."t2"."b" AS "b","test"."t2"."c" AS "c" from "test"."t2" where (("test"."t2"."c" = 'i121') and ("test"."t2"."b" = 'a') and ("test"."t2"."a2" >= 'b'))
1416
Note 1003 select distinct `test`.`t2`.`a1` AS `a1`,`test`.`t2`.`a2` AS `a2`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c` from `test`.`t2` where ((`test`.`t2`.`a2` >= 'b') and (`test`.`t2`.`b` = 'a') and (`test`.`t2`.`c` = 'i121'))
1583
1417
explain select distinct a1,a2,b from t2 where (a1 > 'a') and (a2 > 'a') and (b = 'c');
1584
1418
id select_type table type possible_keys key key_len ref rows Extra
1585
1 SIMPLE t2 range idx_t2_0,idx_t2_1,idx_t2_2 idx_t2_1 146 NULL # Using where; Using index for group-by
1419
1 SIMPLE t2 range idx_t2_0,idx_t2_1,idx_t2_2 idx_t2_1 584 NULL # Using where; Using index for group-by
1586
1420
explain select distinct b from t2 where (a2 >= 'b') and (b = 'a');
1587
1421
id select_type table type possible_keys key key_len ref rows Extra
1588
1 SIMPLE t2 index NULL idx_t2_2 146 NULL 164 Using where; Using index
1422
1 SIMPLE t2 index NULL idx_t2_2 584 NULL 164 Using where; Using index
1589
1423
select distinct a1,a2,b from t1;
1703
1537
explain select distinct a1,a2,b from t1;
1704
1538
id select_type table type possible_keys key key_len ref rows Extra
1705
1 SIMPLE t1 range NULL idx_t1_1 147 NULL 17 Using index for group-by
1539
1 SIMPLE t1 range NULL idx_t1_1 585 NULL 17 Using index for group-by
1706
1540
explain select distinct a1,a2,b from t1 where (a2 >= 'b') and (b = 'a') group by a1,a2,b;
1707
1541
id select_type table type possible_keys key key_len ref rows Extra
1708
1 SIMPLE t1 range NULL idx_t1_1 147 NULL 17 Using where; Using index for group-by
1542
1 SIMPLE t1 range NULL idx_t1_1 585 NULL 17 Using where; Using index for group-by
1709
1543
explain select distinct a1,a2,b,c from t1 where (a2 >= 'b') and (b = 'a') and (c = 'i121') group by a1,a2,b;
1710
1544
id select_type table type possible_keys key key_len ref rows Extra
1711
1 SIMPLE t1 range NULL idx_t1_1 163 NULL 17 Using where; Using index for group-by
1545
1 SIMPLE t1 index NULL idx_t1_1 651 NULL 128 Using where; Using index
1712
1546
explain select distinct a1,a2,b from t1 where (a1 > 'a') and (a2 > 'a') and (b = 'c') group by a1,a2,b;
1713
1547
id select_type table type possible_keys key key_len ref rows Extra
1714
1 SIMPLE t1 range idx_t1_0,idx_t1_1,idx_t1_2 idx_t1_1 147 NULL 14 Using where; Using index for group-by
1548
1 SIMPLE t1 range idx_t1_0,idx_t1_1,idx_t1_2 idx_t1_1 585 NULL 13 Using where; Using index for group-by
1715
1549
explain select distinct b from t1 where (a2 >= 'b') and (b = 'a') group by a1,a2,b;
1716
1550
id select_type table type possible_keys key key_len ref rows Extra
1717
1 SIMPLE t1 range NULL idx_t1_1 147 NULL 17 Using where; Using index for group-by; Using temporary; Using filesort
1551
1 SIMPLE t1 range NULL idx_t1_1 585 NULL 17 Using where; Using index for group-by; Using temporary; Using filesort
1718
1552
explain select distinct a1,a2,b from t2;
1719
1553
id select_type table type possible_keys key key_len ref rows Extra
1720
1 SIMPLE t2 range NULL idx_t2_1 146 NULL # Using index for group-by
1554
1 SIMPLE t2 index NULL idx_t2_2 584 NULL # Using index
1721
1555
explain select distinct a1,a2,b from t2 where (a2 >= 'b') and (b = 'a') group by a1,a2,b;
1722
1556
id select_type table type possible_keys key key_len ref rows Extra
1723
1 SIMPLE t2 range NULL idx_t2_1 146 NULL # Using where; Using index for group-by
1557
1 SIMPLE t2 index NULL idx_t2_2 584 NULL # Using where; Using index
1724
1558
explain select distinct a1,a2,b,c from t2 where (a2 >= 'b') and (b = 'a') and (c = 'i121') group by a1,a2,b;
1725
1559
id select_type table type possible_keys key key_len ref rows Extra
1726
1 SIMPLE t2 index NULL idx_t2_1 163 NULL # Using where; Using index
1560
1 SIMPLE t2 index NULL idx_t2_1 651 NULL # Using where; Using index
1727
1561
explain select distinct a1,a2,b from t2 where (a1 > 'a') and (a2 > 'a') and (b = 'c') group by a1,a2,b;
1728
1562
id select_type table type possible_keys key key_len ref rows Extra
1729
1 SIMPLE t2 range idx_t2_0,idx_t2_1,idx_t2_2 idx_t2_1 146 NULL # Using where; Using index for group-by
1563
1 SIMPLE t2 range idx_t2_0,idx_t2_1,idx_t2_2 idx_t2_1 584 NULL # Using where; Using index for group-by
1730
1564
explain select distinct b from t2 where (a2 >= 'b') and (b = 'a') group by a1,a2,b;
1731
1565
id select_type table type possible_keys key key_len ref rows Extra
1732
1 SIMPLE t2 range NULL idx_t2_1 146 NULL # Using where; Using index for group-by; Using temporary; Using filesort
1566
1 SIMPLE t2 index NULL idx_t2_2 584 NULL # Using where; Using index; Using temporary; Using filesort
1733
1567
select distinct a1,a2,b from t1;
1801
1635
explain select count(distinct a1,a2,b) from t1 where (a2 >= 'b') and (b = 'a');
1802
1636
id select_type table type possible_keys key key_len ref rows Extra
1803
1 SIMPLE t1 index NULL idx_t1_2 147 NULL 128 Using where; Using index
1637
1 SIMPLE t1 index NULL idx_t1_2 585 NULL 128 Using where; Using index
1804
1638
explain select count(distinct a1,a2,b,c) from t1 where (a2 >= 'b') and (b = 'a') and (c = 'i121');
1805
1639
id select_type table type possible_keys key key_len ref rows Extra
1806
1 SIMPLE t1 index NULL idx_t1_1 163 NULL 128 Using where; Using index
1640
1 SIMPLE t1 index NULL idx_t1_1 651 NULL 128 Using where; Using index
1807
1641
explain extended select count(distinct a1,a2,b) from t1 where (a1 > 'a') and (a2 > 'a') and (b = 'c');
1808
1642
id select_type table type possible_keys key key_len ref rows filtered Extra
1809
1 SIMPLE t1 index idx_t1_0,idx_t1_1,idx_t1_2 idx_t1_2 147 NULL 128 75.00 Using where; Using index
1643
1 SIMPLE t1 index idx_t1_0,idx_t1_1,idx_t1_2 idx_t1_2 585 NULL 128 75.00 Using where; Using index
1811
Note 1003 select count(distinct "test"."t1"."a1","test"."t1"."a2","test"."t1"."b") AS "count(distinct a1,a2,b)" from "test"."t1" where (("test"."t1"."b" = 'c') and ("test"."t1"."a1" > 'a') and ("test"."t1"."a2" > 'a'))
1645
Note 1003 select count(distinct `test`.`t1`.`a1`,`test`.`t1`.`a2`,`test`.`t1`.`b`) AS `count(distinct a1,a2,b)` from `test`.`t1` where ((`test`.`t1`.`a1` > 'a') and (`test`.`t1`.`a2` > 'a') and (`test`.`t1`.`b` = 'c'))
1812
1646
explain select count(distinct b) from t1 where (a2 >= 'b') and (b = 'a');
1813
1647
id select_type table type possible_keys key key_len ref rows Extra
1814
1 SIMPLE t1 index NULL idx_t1_2 147 NULL 128 Using where; Using index
1648
1 SIMPLE t1 index NULL idx_t1_2 585 NULL 128 Using where; Using index
1815
1649
explain extended select ord(a1) + count(distinct a1,a2,b) from t1 where (a1 > 'a') and (a2 > 'a');
1816
1650
id select_type table type possible_keys key key_len ref rows filtered Extra
1817
1 SIMPLE t1 index idx_t1_0,idx_t1_1,idx_t1_2 idx_t1_2 147 NULL 128 75.00 Using where; Using index
1651
1 SIMPLE t1 index idx_t1_0,idx_t1_1,idx_t1_2 idx_t1_2 585 NULL 128 75.00 Using where; Using index
1819
Note 1003 select (ord("test"."t1"."a1") + count(distinct "test"."t1"."a1","test"."t1"."a2","test"."t1"."b")) AS "ord(a1) + count(distinct a1,a2,b)" from "test"."t1" where (("test"."t1"."a1" > 'a') and ("test"."t1"."a2" > 'a'))
1653
Note 1003 select (ord(`test`.`t1`.`a1`) + count(distinct `test`.`t1`.`a1`,`test`.`t1`.`a2`,`test`.`t1`.`b`)) AS `ord(a1) + count(distinct a1,a2,b)` from `test`.`t1` where ((`test`.`t1`.`a1` > 'a') and (`test`.`t1`.`a2` > 'a'))
1820
1654
select count(distinct a1,a2,b) from t1 where (a2 >= 'b') and (b = 'a');
1821
1655
count(distinct a1,a2,b)
1835
1669
explain select a1,a2,b, concat(min(c), max(c)) from t1 where a1 < 'd' group by a1,a2,b;
1836
1670
id select_type table type possible_keys key key_len ref rows Extra
1837
1 SIMPLE t1 range idx_t1_0,idx_t1_1,idx_t1_2 idx_t1_1 147 NULL 10 Using where; Using index for group-by
1671
1 SIMPLE t1 range idx_t1_0,idx_t1_1,idx_t1_2 idx_t1_1 585 NULL 13 Using where; Using index for group-by
1838
1672
explain select concat(a1,min(c)),b from t1 where a1 < 'd' group by a1,a2,b;
1839
1673
id select_type table type possible_keys key key_len ref rows Extra
1840
1 SIMPLE t1 range idx_t1_0,idx_t1_1,idx_t1_2 idx_t1_1 147 NULL 10 Using where; Using index for group-by
1674
1 SIMPLE t1 range idx_t1_0,idx_t1_1,idx_t1_2 idx_t1_1 585 NULL 13 Using where; Using index for group-by
1841
1675
explain select concat(a1,min(c)),b,max(c) from t1 where a1 < 'd' group by a1,a2,b;
1842
1676
id select_type table type possible_keys key key_len ref rows Extra
1843
1 SIMPLE t1 range idx_t1_0,idx_t1_1,idx_t1_2 idx_t1_1 147 NULL 10 Using where; Using index for group-by
1677
1 SIMPLE t1 range idx_t1_0,idx_t1_1,idx_t1_2 idx_t1_1 585 NULL 13 Using where; Using index for group-by
1844
1678
explain select concat(a1,a2),b,min(c),max(c) from t1 where a1 < 'd' group by a1,a2,b;
1845
1679
id select_type table type possible_keys key key_len ref rows Extra
1846
1 SIMPLE t1 range idx_t1_0,idx_t1_1,idx_t1_2 idx_t1_1 147 NULL 10 Using where; Using index for group-by
1680
1 SIMPLE t1 range idx_t1_0,idx_t1_1,idx_t1_2 idx_t1_1 585 NULL 13 Using where; Using index for group-by
1847
1681
explain select concat(ord(min(b)),ord(max(b))),min(b),max(b) from t1 group by a1,a2;
1848
1682
id select_type table type possible_keys key key_len ref rows Extra
1849
1 SIMPLE t1 range NULL idx_t1_1 147 NULL 9 Using index for group-by
1683
1 SIMPLE t1 range NULL idx_t1_1 585 NULL 9 Using index for group-by
1850
1684
select a1,a2,b, concat(min(c), max(c)) from t1 where a1 < 'd' group by a1,a2,b;
1851
1685
a1 a2 b concat(min(c), max(c))
1922
1756
explain extended select a1,a2,min(b),max(b) from t1
1923
1757
where (a1 = 'b' or a1 = 'd' or a1 = 'a' or a1 = 'c') and (a2 > 'a') and (c > 'a111') group by a1,a2;
1924
1758
id select_type table type possible_keys key key_len ref rows filtered Extra
1925
1 SIMPLE t1 range idx_t1_0,idx_t1_1,idx_t1_2 idx_t1_1 130 NULL 76 85.53 Using where; Using index
1759
1 SIMPLE t1 index idx_t1_0,idx_t1_1,idx_t1_2 idx_t1_1 651 NULL 128 49.22 Using where; Using index
1927
Note 1003 select "test"."t1"."a1" AS "a1","test"."t1"."a2" AS "a2",min("test"."t1"."b") AS "min(b)",max("test"."t1"."b") AS "max(b)" from "test"."t1" where ((("test"."t1"."a1" = 'b') or ("test"."t1"."a1" = 'd') or ("test"."t1"."a1" = 'a') or ("test"."t1"."a1" = 'c')) and ("test"."t1"."a2" > 'a') and ("test"."t1"."c" > 'a111')) group by "test"."t1"."a1","test"."t1"."a2"
1761
Note 1003 select `test`.`t1`.`a1` AS `a1`,`test`.`t1`.`a2` AS `a2`,min(`test`.`t1`.`b`) AS `min(b)`,max(`test`.`t1`.`b`) AS `max(b)` from `test`.`t1` where (((`test`.`t1`.`a1` = 'b') or (`test`.`t1`.`a1` = 'd') or (`test`.`t1`.`a1` = 'a') or (`test`.`t1`.`a1` = 'c')) and (`test`.`t1`.`a2` > 'a') and (`test`.`t1`.`c` > 'a111')) group by `test`.`t1`.`a1`,`test`.`t1`.`a2`
1928
1762
explain extended select a1,a2,b,min(c),max(c) from t1
1929
1763
where (a1 = 'b' or a1 = 'd' or a1 = 'a' or a1 = 'c') and (a2 > 'a') and (d > 'xy2') group by a1,a2,b;
1930
1764
id select_type table type possible_keys key key_len ref rows filtered Extra
1931
1 SIMPLE t1 ALL idx_t1_0,idx_t1_1,idx_t1_2 NULL NULL NULL 128 50.78 Using where; Using temporary; Using filesort
1765
1 SIMPLE t1 ALL idx_t1_0,idx_t1_1,idx_t1_2 NULL NULL NULL 128 49.22 Using where; Using temporary; Using filesort
1933
Note 1003 select "test"."t1"."a1" AS "a1","test"."t1"."a2" AS "a2","test"."t1"."b" AS "b",min("test"."t1"."c") AS "min(c)",max("test"."t1"."c") AS "max(c)" from "test"."t1" where ((("test"."t1"."a1" = 'b') or ("test"."t1"."a1" = 'd') or ("test"."t1"."a1" = 'a') or ("test"."t1"."a1" = 'c')) and ("test"."t1"."a2" > 'a') and ("test"."t1"."d" > 'xy2')) group by "test"."t1"."a1","test"."t1"."a2","test"."t1"."b"
1767
Note 1003 select `test`.`t1`.`a1` AS `a1`,`test`.`t1`.`a2` AS `a2`,`test`.`t1`.`b` AS `b`,min(`test`.`t1`.`c`) AS `min(c)`,max(`test`.`t1`.`c`) AS `max(c)` from `test`.`t1` where (((`test`.`t1`.`a1` = 'b') or (`test`.`t1`.`a1` = 'd') or (`test`.`t1`.`a1` = 'a') or (`test`.`t1`.`a1` = 'c')) and (`test`.`t1`.`a2` > 'a') and (`test`.`t1`.`d` > 'xy2')) group by `test`.`t1`.`a1`,`test`.`t1`.`a2`,`test`.`t1`.`b`
1934
1768
explain extended select a1,a2,b,c from t1
1935
1769
where (a1 = 'b' or a1 = 'd' or a1 = 'a' or a1 = 'c') and (a2 > 'a') and (d > 'xy2') group by a1,a2,b,c;
1936
1770
id select_type table type possible_keys key key_len ref rows filtered Extra
1937
1 SIMPLE t1 ALL idx_t1_0,idx_t1_1,idx_t1_2 NULL NULL NULL 128 50.78 Using where; Using temporary; Using filesort
1771
1 SIMPLE t1 ALL idx_t1_0,idx_t1_1,idx_t1_2 NULL NULL NULL 128 49.22 Using where; Using temporary; Using filesort
1939
Note 1003 select "test"."t1"."a1" AS "a1","test"."t1"."a2" AS "a2","test"."t1"."b" AS "b","test"."t1"."c" AS "c" from "test"."t1" where ((("test"."t1"."a1" = 'b') or ("test"."t1"."a1" = 'd') or ("test"."t1"."a1" = 'a') or ("test"."t1"."a1" = 'c')) and ("test"."t1"."a2" > 'a') and ("test"."t1"."d" > 'xy2')) group by "test"."t1"."a1","test"."t1"."a2","test"."t1"."b","test"."t1"."c"
1773
Note 1003 select `test`.`t1`.`a1` AS `a1`,`test`.`t1`.`a2` AS `a2`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c` from `test`.`t1` where (((`test`.`t1`.`a1` = 'b') or (`test`.`t1`.`a1` = 'd') or (`test`.`t1`.`a1` = 'a') or (`test`.`t1`.`a1` = 'c')) and (`test`.`t1`.`a2` > 'a') and (`test`.`t1`.`d` > 'xy2')) group by `test`.`t1`.`a1`,`test`.`t1`.`a2`,`test`.`t1`.`b`,`test`.`t1`.`c`
1940
1774
explain select a1,a2,b,max(c),min(c) from t2 where (a2 = 'a') and (b = 'b') or (b < 'b') group by a1;
1941
1775
id select_type table type possible_keys key key_len ref rows Extra
1942
1 SIMPLE t2 index NULL idx_t2_1 163 NULL 164 Using where; Using index
1776
1 SIMPLE t2 index NULL idx_t2_1 651 NULL 164 Using where; Using index
1943
1777
explain extended select a1,a2,b from t1 where (a1 = 'b' or a1 = 'd' or a1 = 'a' or a1 = 'c') and (a2 > 'a') and (c > 'a111') group by a1,a2,b;
1944
1778
id select_type table type possible_keys key key_len ref rows filtered Extra
1945
1 SIMPLE t1 range idx_t1_0,idx_t1_1,idx_t1_2 idx_t1_1 130 NULL 76 85.53 Using where; Using index
1779
1 SIMPLE t1 index idx_t1_0,idx_t1_1,idx_t1_2 idx_t1_1 651 NULL 128 49.22 Using where; Using index
1947
Note 1003 select "test"."t1"."a1" AS "a1","test"."t1"."a2" AS "a2","test"."t1"."b" AS "b" from "test"."t1" where ((("test"."t1"."a1" = 'b') or ("test"."t1"."a1" = 'd') or ("test"."t1"."a1" = 'a') or ("test"."t1"."a1" = 'c')) and ("test"."t1"."a2" > 'a') and ("test"."t1"."c" > 'a111')) group by "test"."t1"."a1","test"."t1"."a2","test"."t1"."b"
1781
Note 1003 select `test`.`t1`.`a1` AS `a1`,`test`.`t1`.`a2` AS `a2`,`test`.`t1`.`b` AS `b` from `test`.`t1` where (((`test`.`t1`.`a1` = 'b') or (`test`.`t1`.`a1` = 'd') or (`test`.`t1`.`a1` = 'a') or (`test`.`t1`.`a1` = 'c')) and (`test`.`t1`.`a2` > 'a') and (`test`.`t1`.`c` > 'a111')) group by `test`.`t1`.`a1`,`test`.`t1`.`a2`,`test`.`t1`.`b`
1948
1782
explain select a1,a2,min(b),c from t2 where (a2 = 'a') and (c = 'a111') group by a1;
1949
1783
id select_type table type possible_keys key key_len ref rows Extra
1950
1 SIMPLE t2 index NULL idx_t2_1 163 NULL 164 Using where; Using index
1784
1 SIMPLE t2 index NULL idx_t2_1 651 NULL 164 Using where; Using index
1951
1785
select a1,a2,min(b),c from t2 where (a2 = 'a') and (c = 'a111') group by a1;
1954
1788
explain select a1,a2,b,max(c),min(c) from t2 where (a2 = 'a') and (b = 'b') or (b = 'a') group by a1;
1955
1789
id select_type table type possible_keys key key_len ref rows Extra
1956
1 SIMPLE t2 index NULL idx_t2_1 163 NULL 164 Using where; Using index
1790
1 SIMPLE t2 index NULL idx_t2_1 651 NULL 164 Using where; Using index
1957
1791
explain select a1,a2,b,min(c),max(c) from t2
1958
1792
where (c > 'a000') and (c <= 'd999') and (c like '_8__') group by a1,a2,b;
1959
1793
id select_type table type possible_keys key key_len ref rows Extra
1960
1 SIMPLE t2 index NULL idx_t2_1 163 NULL 164 Using where; Using index
1794
1 SIMPLE t2 index NULL idx_t2_1 651 NULL 164 Using where; Using index
1961
1795
explain select a1, a2, b, c, min(d), max(d) from t1 group by a1,a2,b,c;
1962
1796
id select_type table type possible_keys key key_len ref rows Extra
1963
1797
1 SIMPLE t1 ALL NULL NULL NULL NULL 128 Using temporary; Using filesort
1964
1798
explain select a1,a2,count(a2) from t1 group by a1,a2,b;
1965
1799
id select_type table type possible_keys key key_len ref rows Extra
1966
1 SIMPLE t1 index NULL idx_t1_2 147 NULL 128 Using index
1800
1 SIMPLE t1 index NULL idx_t1_2 585 NULL 128 Using index
1967
1801
explain extended select a1,a2,count(a2) from t1 where (a1 > 'a') group by a1,a2,b;
1968
1802
id select_type table type possible_keys key key_len ref rows filtered Extra
1969
1 SIMPLE t1 index idx_t1_0,idx_t1_1,idx_t1_2 idx_t1_2 147 NULL 128 75.00 Using where; Using index
1803
1 SIMPLE t1 index idx_t1_0,idx_t1_1,idx_t1_2 idx_t1_1 651 NULL 128 75.00 Using where; Using index
1971
Note 1003 select "test"."t1"."a1" AS "a1","test"."t1"."a2" AS "a2",count("test"."t1"."a2") AS "count(a2)" from "test"."t1" where ("test"."t1"."a1" > 'a') group by "test"."t1"."a1","test"."t1"."a2","test"."t1"."b"
1805
Note 1003 select `test`.`t1`.`a1` AS `a1`,`test`.`t1`.`a2` AS `a2`,count(`test`.`t1`.`a2`) AS `count(a2)` from `test`.`t1` where (`test`.`t1`.`a1` > 'a') group by `test`.`t1`.`a1`,`test`.`t1`.`a2`,`test`.`t1`.`b`
1972
1806
explain extended select sum(ord(a1)) from t1 where (a1 > 'a') group by a1,a2,b;
1973
1807
id select_type table type possible_keys key key_len ref rows filtered Extra
1974
1 SIMPLE t1 index idx_t1_0,idx_t1_1,idx_t1_2 idx_t1_2 147 NULL 128 75.00 Using where; Using index
1808
1 SIMPLE t1 index idx_t1_0,idx_t1_1,idx_t1_2 idx_t1_1 651 NULL 128 75.00 Using where; Using index
1976
Note 1003 select sum(ord("test"."t1"."a1")) AS "sum(ord(a1))" from "test"."t1" where ("test"."t1"."a1" > 'a') group by "test"."t1"."a1","test"."t1"."a2","test"."t1"."b"
1810
Note 1003 select sum(ord(`test`.`t1`.`a1`)) AS `sum(ord(a1))` from `test`.`t1` where (`test`.`t1`.`a1` > 'a') group by `test`.`t1`.`a1`,`test`.`t1`.`a2`,`test`.`t1`.`b`
1977
1811
explain select distinct(a1) from t1 where ord(a2) = 98;
1978
1812
id select_type table type possible_keys key key_len ref rows Extra
1979
1 SIMPLE t1 index NULL idx_t1_2 147 NULL 128 Using where; Using index
1813
1 SIMPLE t1 index NULL idx_t1_2 585 NULL 128 Using where; Using index
1980
1814
select distinct(a1) from t1 where ord(a2) = 98;