306
307
select min(a1) from t1;
307
308
id select_type table type possible_keys key key_len ref rows Extra
308
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized away
309
1 SIMPLE t1 index NULL PRIMARY 14 NULL 15 Using index
309
310
select min(a1) from t1;
313
314
select max(a4) from t1;
314
315
id select_type table type possible_keys key key_len ref rows Extra
315
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized away
316
1 SIMPLE t1 index NULL PRIMARY 14 NULL 15
316
317
select max(a4) from t1;
320
321
select min(a5), max(a5) from t1;
321
322
id select_type table type possible_keys key key_len ref rows Extra
322
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized away
323
1 SIMPLE t1 index NULL PRIMARY 14 NULL 15
323
324
select min(a5), max(a5) from t1;
325
326
1942-02-19 1977-09-23
327
328
select min(a3) from t1 where a2 = 2;
328
329
id select_type table type possible_keys key key_len ref rows Extra
329
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized away
330
1 SIMPLE t1 ref k1 k1 5 const 3 Using index
330
331
select min(a3) from t1 where a2 = 2;
334
335
select min(a1), max(a1) from t1 where a4 = 0.080;
335
336
id select_type table type possible_keys key key_len ref rows Extra
336
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized away
337
1 SIMPLE t1 ref k2 k2 9 const 3 Using where; Using index
337
338
select min(a1), max(a1) from t1 where a4 = 0.080;
341
342
select min(t1.a5), max(t2.a3) from t1, t2;
342
343
id select_type table type possible_keys key key_len ref rows Extra
343
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized away
344
1 SIMPLE t2 index NULL PRIMARY 14 NULL 7
345
1 SIMPLE t1 index NULL PRIMARY 14 NULL 15 Using join buffer
344
346
select min(t1.a5), max(t2.a3) from t1, t2;
345
347
min(t1.a5) max(t2.a3)
348
350
select min(t1.a3), max(t2.a2) from t1, t2 where t1.a2 = 0 and t2.a3 = 'CA';
349
351
id select_type table type possible_keys key key_len ref rows Extra
350
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized away
352
1 SIMPLE t1 ref k1 k1 5 const 3 Using index
353
1 SIMPLE t2 ref k1 k1 11 const 3 Using where; Using index
351
354
select min(t1.a3), max(t2.a2) from t1, t2 where t1.a2 = 0 and t2.a3 = 'CA';
352
355
min(t1.a3) max(t2.a2)
355
358
select min(a1) from t1 where a1 > 'KKK';
356
359
id select_type table type possible_keys key key_len ref rows Extra
357
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized away
360
1 SIMPLE t1 range PRIMARY PRIMARY 14 NULL 7 Using where; Using index
358
361
select min(a1) from t1 where a1 > 'KKK';
362
365
select min(a1) from t1 where a1 >= 'KKK';
363
366
id select_type table type possible_keys key key_len ref rows Extra
364
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized away
367
1 SIMPLE t1 range PRIMARY PRIMARY 14 NULL 7 Using where; Using index
365
368
select min(a1) from t1 where a1 >= 'KKK';
369
372
select max(a3) from t1 where a2 = 2 and a3 < 'SEA';
370
373
id select_type table type possible_keys key key_len ref rows Extra
371
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized away
374
1 SIMPLE t1 range k1 k1 20 NULL 1 Using where; Using index
372
375
select max(a3) from t1 where a2 = 2 and a3 < 'SEA';
376
379
select max(a5) from t1 where a5 < date'1970-01-01';
377
380
id select_type table type possible_keys key key_len ref rows Extra
378
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized away
381
1 SIMPLE t1 range k3 k3 4 NULL 7 Using where; Using index
379
382
select max(a5) from t1 where a5 < date'1970-01-01';
383
386
select max(a3) from t1 where a2 is null;
384
387
id select_type table type possible_keys key key_len ref rows Extra
385
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized away
388
1 SIMPLE t1 ref k1 k1 5 const 2 Using where; Using index
386
389
select max(a3) from t1 where a2 is null;
390
393
select max(a3) from t1 where a2 = 0 and a3 between 'K' and 'Q';
391
394
id select_type table type possible_keys key key_len ref rows Extra
392
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized away
395
1 SIMPLE t1 range k1 k1 20 NULL 1 Using where; Using index
393
396
select max(a3) from t1 where a2 = 0 and a3 between 'K' and 'Q';
397
400
select min(a1), max(a1) from t1 where a1 between 'A' and 'P';
398
401
id select_type table type possible_keys key key_len ref rows Extra
399
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized away
402
1 SIMPLE t1 range PRIMARY PRIMARY 14 NULL 7 Using where; Using index
400
403
select min(a1), max(a1) from t1 where a1 between 'A' and 'P';
404
407
select max(a3) from t1 where a3 < 'SEA' and a2 = 2 and a3 <= 'MIN';
405
408
id select_type table type possible_keys key key_len ref rows Extra
406
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized away
409
1 SIMPLE t1 range k1 k1 20 NULL 2 Using where; Using index
407
410
select max(a3) from t1 where a3 < 'SEA' and a2 = 2 and a3 <= 'MIN';
411
414
select max(a3) from t1 where a3 = 'MIN' and a2 = 2;
412
415
id select_type table type possible_keys key key_len ref rows Extra
413
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized away
416
1 SIMPLE t1 ref k1 k1 20 const,const 1 Using where; Using index
414
417
select max(a3) from t1 where a3 = 'MIN' and a2 = 2;
418
421
select max(a3) from t1 where a3 = 'DEN' and a2 = 2;
419
422
id select_type table type possible_keys key key_len ref rows Extra
420
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No matching min/max row
423
1 SIMPLE t1 ref k1 k1 20 const,const 1 Using where; Using index
421
424
select max(a3) from t1 where a3 = 'DEN' and a2 = 2;
425
428
select max(t1.a3), min(t2.a2) from t1, t2 where t1.a2 = 2 and t1.a3 < 'MIN' and t2.a3 = 'CA';
426
429
id select_type table type possible_keys key key_len ref rows Extra
427
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized away
430
1 SIMPLE t1 range k1 k1 20 NULL 1 Using where; Using index
431
1 SIMPLE t2 ref k1 k1 11 const 3 Using where; Using index
428
432
select max(t1.a3), min(t2.a2) from t1, t2 where t1.a2 = 2 and t1.a3 < 'MIN' and t2.a3 = 'CA';
429
433
max(t1.a3) min(t2.a2)
439
443
select max(a2) from t1 where a2 >= 1;
440
444
id select_type table type possible_keys key key_len ref rows Extra
441
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized away
445
1 SIMPLE t1 range k1 k1 5 NULL 7 Using where; Using index
442
446
select max(a2) from t1 where a2 >= 1;
446
450
select min(a3) from t1 where a2 = 2 and a3 < 'SEA';
447
451
id select_type table type possible_keys key key_len ref rows Extra
448
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized away
452
1 SIMPLE t1 range k1 k1 20 NULL 1 Using where; Using index
449
453
select min(a3) from t1 where a2 = 2 and a3 < 'SEA';
453
457
select min(a3) from t1 where a2 = 4;
454
458
id select_type table type possible_keys key key_len ref rows Extra
455
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No matching min/max row
459
1 SIMPLE t1 ref k1 k1 5 const 1 Using index
456
460
select min(a3) from t1 where a2 = 4;
460
464
select min(a3) from t1 where a2 = 2 and a3 > 'SEA';
461
465
id select_type table type possible_keys key key_len ref rows Extra
462
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No matching min/max row
466
1 SIMPLE t1 range k1 k1 20 NULL 1 Using where; Using index
463
467
select min(a3) from t1 where a2 = 2 and a3 > 'SEA';
467
471
select (min(a4)+max(a4))/2 from t1;
468
472
id select_type table type possible_keys key key_len ref rows Extra
469
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized away
473
1 SIMPLE t1 index NULL PRIMARY 14 NULL 15
470
474
select (min(a4)+max(a4))/2 from t1;
471
475
(min(a4)+max(a4))/2
474
478
select min(a3) from t1 where 2 = a2;
475
479
id select_type table type possible_keys key key_len ref rows Extra
476
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized away
480
1 SIMPLE t1 ref k1 k1 5 const 3 Using index
477
481
select min(a3) from t1 where 2 = a2;
481
485
select max(a3) from t1 where a2 = 2 and 'SEA' > a3;
482
486
id select_type table type possible_keys key key_len ref rows Extra
483
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized away
487
1 SIMPLE t1 range k1 k1 20 NULL 1 Using where; Using index
484
488
select max(a3) from t1 where a2 = 2 and 'SEA' > a3;
488
492
select max(a3) from t1 where a2 = 2 and 'SEA' < a3;
489
493
id select_type table type possible_keys key key_len ref rows Extra
490
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No matching min/max row
494
1 SIMPLE t1 range k1 k1 20 NULL 1 Using where; Using index
491
495
select max(a3) from t1 where a2 = 2 and 'SEA' < a3;
495
499
select min(a3) from t1 where a2 = 2 and a3 >= 'CHI';
496
500
id select_type table type possible_keys key key_len ref rows Extra
497
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized away
501
1 SIMPLE t1 range k1 k1 20 NULL 3 Using where; Using index
498
502
select min(a3) from t1 where a2 = 2 and a3 >= 'CHI';
502
506
select min(a3) from t1 where a2 = 2 and a3 >= 'CHI' and a3 < 'SEA';
503
507
id select_type table type possible_keys key key_len ref rows Extra
504
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized away
508
1 SIMPLE t1 range k1 k1 20 NULL 1 Using where; Using index
505
509
select min(a3) from t1 where a2 = 2 and a3 >= 'CHI' and a3 < 'SEA';
509
513
select min(a3) from t1 where a2 = 2 and a3 >= 'CHI' and a3 = 'MIN';
510
514
id select_type table type possible_keys key key_len ref rows Extra
511
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized away
515
1 SIMPLE t1 ref k1 k1 20 const,const 1 Using where; Using index
512
516
select min(a3) from t1 where a2 = 2 and a3 >= 'CHI' and a3 = 'MIN';