@@ -400,3 +400,65 @@ HashAgg_15 2.00 root group by:a, funcs:firstrow(join_agg_0)
400
400
└─StreamAgg_26 1.00 root group by:a, funcs:firstrow(a), firstrow(a)
401
401
└─Projection_31 1.00 root 1
402
402
└─TableDual_32 1.00 root rows:1
403
+ drop table if exists t;
404
+ create table t(a int, nb int not null, nc int not null);
405
+ explain select ifnull(a, 0) from t;
406
+ id count task operator info
407
+ Projection_3 10000.00 root ifnull(test.t.a, 0)
408
+ └─TableReader_5 10000.00 root data:TableScan_4
409
+ └─TableScan_4 10000.00 cop table:t, range:[-inf,+inf], keep order:false, stats:pseudo
410
+ explain select ifnull(nb, 0) from t;
411
+ id count task operator info
412
+ Projection_3 10000.00 root ifnull(test.t.nb, 0)
413
+ └─TableReader_5 10000.00 root data:TableScan_4
414
+ └─TableScan_4 10000.00 cop table:t, range:[-inf,+inf], keep order:false, stats:pseudo
415
+ explain select ifnull(nb, 0), ifnull(nc, 0) from t;
416
+ id count task operator info
417
+ Projection_3 10000.00 root ifnull(test.t.nb, 0), ifnull(test.t.nc, 0)
418
+ └─TableReader_5 10000.00 root data:TableScan_4
419
+ └─TableScan_4 10000.00 cop table:t, range:[-inf,+inf], keep order:false, stats:pseudo
420
+ explain select ifnull(a, 0), ifnull(nb, 0) from t;
421
+ id count task operator info
422
+ Projection_3 10000.00 root ifnull(test.t.a, 0), ifnull(test.t.nb, 0)
423
+ └─TableReader_5 10000.00 root data:TableScan_4
424
+ └─TableScan_4 10000.00 cop table:t, range:[-inf,+inf], keep order:false, stats:pseudo
425
+ explain select ifnull(nb, 0), ifnull(nb, 0) from t;
426
+ id count task operator info
427
+ Projection_3 10000.00 root ifnull(test.t.nb, 0), ifnull(test.t.nb, 0)
428
+ └─TableReader_5 10000.00 root data:TableScan_4
429
+ └─TableScan_4 10000.00 cop table:t, range:[-inf,+inf], keep order:false, stats:pseudo
430
+ explain select 1+ifnull(nb, 0) from t;
431
+ id count task operator info
432
+ Projection_3 10000.00 root plus(1, ifnull(test.t.nb, 0))
433
+ └─TableReader_5 10000.00 root data:TableScan_4
434
+ └─TableScan_4 10000.00 cop table:t, range:[-inf,+inf], keep order:false, stats:pseudo
435
+ explain select 1+ifnull(a, 0) from t;
436
+ id count task operator info
437
+ Projection_3 10000.00 root plus(1, ifnull(test.t.a, 0))
438
+ └─TableReader_5 10000.00 root data:TableScan_4
439
+ └─TableScan_4 10000.00 cop table:t, range:[-inf,+inf], keep order:false, stats:pseudo
440
+ drop table if exists t;
441
+ drop table if exists t;
442
+ create table t(a int);
443
+ explain select * from t where _tidb_rowid = 0;
444
+ id count task operator info
445
+ Projection_4 8000.00 root test.t.a
446
+ └─TableReader_6 10000.00 root data:TableScan_5
447
+ └─TableScan_5 10000.00 cop table:t, range:[0,0], keep order:false, stats:pseudo
448
+ explain select * from t where _tidb_rowid > 0;
449
+ id count task operator info
450
+ Projection_4 8000.00 root test.t.a
451
+ └─TableReader_6 10000.00 root data:TableScan_5
452
+ └─TableScan_5 10000.00 cop table:t, range:(0,+inf], keep order:false, stats:pseudo
453
+ explain select a, _tidb_rowid from t where a > 0;
454
+ id count task operator info
455
+ TableReader_7 3333.33 root data:Selection_6
456
+ └─Selection_6 3333.33 cop gt(test.t.a, 0)
457
+ └─TableScan_5 10000.00 cop table:t, range:[-inf,+inf], keep order:false, stats:pseudo
458
+ explain select * from t where _tidb_rowid > 0 and a > 0;
459
+ id count task operator info
460
+ Projection_4 2666.67 root test.t.a
461
+ └─TableReader_7 2666.67 root data:Selection_6
462
+ └─Selection_6 2666.67 cop gt(test.t.a, 0)
463
+ └─TableScan_5 3333.33 cop table:t, range:(0,+inf], keep order:false, stats:pseudo
464
+ drop table if exists t;
0 commit comments