~posulliv/drizzle/optimizer-style-cleanup

« back to all changes in this revision

Viewing changes to tests/r/func_group.result

  • Committer: Padraig O'Sullivan
  • Date: 2010-04-17 02:30:24 UTC
  • Revision ID: osullivan.padraig@gmail.com-20100417023024-6skl7ox23ym526pp
Updated the func_group result file after removing the optimizer related code around sum functions.

Show diffs side-by-side

added added

removed removed

Lines of Context:
184
184
NULL    NULL
185
185
explain select min(a2) from t1;
186
186
id      select_type     table   type    possible_keys   key     key_len ref     rows    Extra
187
 
1       SIMPLE  NULL    NULL    NULL    NULL    NULL    NULL    NULL    Select tables optimized away
 
187
1       SIMPLE  t1      index   NULL    k2      15      NULL    4       Using index
188
188
explain select max(t1.a1), max(t2.a2) from t1, t2;
189
189
id      select_type     table   type    possible_keys   key     key_len ref     rows    Extra
190
 
1       SIMPLE  NULL    NULL    NULL    NULL    NULL    NULL    NULL    No matching min/max row
 
190
1       SIMPLE  t2      index   NULL    k2      20      NULL    1       Using index
 
191
1       SIMPLE  t1      index   NULL    k1      5       NULL    4       Using index; Using join buffer
191
192
insert into t2 values('AAA', 10, 0.5);
192
193
insert into t2 values('BBB', 20, 1.0);
193
194
select t1.a1, t1.a2, t2.a1, t2.a2 from t1,t2;
305
306
explain 
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;
310
311
min(a1)
311
312
AME
312
313
explain 
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;
317
318
max(a4)
318
319
0.1
319
320
explain 
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;
324
325
min(a5) max(a5)
325
326
1942-02-19      1977-09-23
326
327
explain 
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;
331
332
min(a3)
332
333
CHI
333
334
explain 
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;
338
339
min(a1) max(a1)
339
340
BDL     TWU
340
341
explain 
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)
346
348
1942-02-19      WA
347
349
explain 
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)
353
356
DEN     San Diego
354
357
explain 
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';
359
362
min(a1)
360
363
PLS
361
364
explain 
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';
366
369
min(a1)
367
370
KKK
368
371
explain 
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';
373
376
max(a3)
374
377
MIN
375
378
explain 
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';
380
383
max(a5)
381
384
1969-10-05
382
385
explain 
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;
387
390
max(a3)
388
391
MIN
389
392
explain 
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';
394
397
max(a3)
395
398
LAX
396
399
explain
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';
401
404
min(a1) max(a1)
402
405
AME     KKK
403
406
explain 
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';
408
411
max(a3)
409
412
MIN
410
413
explain 
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;
415
418
max(a3)
416
419
MIN
417
420
explain 
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;
422
425
max(a3)
423
426
NULL
424
427
explain
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)
430
434
CHI     Los Angeles
438
442
explain
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;
443
447
max(a2)
444
448
3
445
449
explain
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';
450
454
min(a3)
451
455
CHI
452
456
explain
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;
457
461
min(a3)
458
462
NULL
459
463
explain
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';
464
468
min(a3)
465
469
NULL
466
470
explain
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
472
476
0.085
473
477
explain
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;
478
482
min(a3)
479
483
CHI
480
484
explain
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;
485
489
max(a3)
486
490
MIN
487
491
explain
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;
492
496
max(a3)
493
497
NULL
494
498
explain
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';
499
503
min(a3)
500
504
CHI
501
505
explain
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';
506
510
min(a3)
507
511
CHI
508
512
explain
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';
513
517
min(a3)
514
518
MIN
522
526
explain
523
527
select min(t1.a1), min(t2.a4) from t1,t2 where t1.a1 < 'KKK' and t2.a4 < 'KKK';
524
528
id      select_type     table   type    possible_keys   key     key_len ref     rows    Extra
525
 
1       SIMPLE  NULL    NULL    NULL    NULL    NULL    NULL    NULL    Select tables optimized away
 
529
1       SIMPLE  t2      range   k2      k2      15      NULL    3       Using where; Using index
 
530
1       SIMPLE  t1      range   PRIMARY PRIMARY 14      NULL    7       Using where; Using index; Using join buffer
526
531
select min(t1.a1), min(t2.a4) from t1,t2 where t1.a1 < 'KKK' and t2.a4 < 'KKK';
527
532
min(t1.a1)      min(t2.a4)
528
533
AME     AME
1235
1240
INSERT INTO t3 VALUES (1, NULL, 1), (2, NULL, 2),  (2, NULL, 2),  (3, NULL, 3);
1236
1241
EXPLAIN SELECT MIN(a), MIN(b) FROM t3 where a = 2;
1237
1242
id      select_type     table   type    possible_keys   key     key_len ref     rows    Extra
1238
 
1       SIMPLE  NULL    NULL    NULL    NULL    NULL    NULL    NULL    Select tables optimized away
 
1243
1       SIMPLE  t3      ref     a       a       5       const   2       Using index
1239
1244
SELECT MIN(a), MIN(b) FROM t3 where a = 2;
1240
1245
MIN(a)  MIN(b)
1241
1246
2       NULL
1243
1248
INSERT INTO t4 VALUES (1, 1, 1), (2, NULL, 2),  (2, NULL, 2),  (3, 1, 3);
1244
1249
EXPLAIN SELECT MIN(a), MIN(b) FROM t4 where a = 2;
1245
1250
id      select_type     table   type    possible_keys   key     key_len ref     rows    Extra
1246
 
1       SIMPLE  NULL    NULL    NULL    NULL    NULL    NULL    NULL    Select tables optimized away
 
1251
1       SIMPLE  t4      ref     a       a       5       const   2       Using index
1247
1252
SELECT MIN(a), MIN(b) FROM t4 where a = 2;
1248
1253
MIN(a)  MIN(b)
1249
1254
2       NULL
1254
1259
INSERT INTO t5 VALUES( 1, 1 ), ( 1, 2 );
1255
1260
EXPLAIN SELECT MIN(a), MIN(b) FROM t5 WHERE a = 1;
1256
1261
id      select_type     table   type    possible_keys   key     key_len ref     rows    Extra
1257
 
1       SIMPLE  NULL    NULL    NULL    NULL    NULL    NULL    NULL    Select tables optimized away
 
1262
1       SIMPLE  t5      ref     a       a       5       const   1       Using index
1258
1263
SELECT MIN(a), MIN(b) FROM t5 WHERE a = 1;
1259
1264
MIN(a)  MIN(b)
1260
1265
1       1