@@ -390,7 +390,7 @@ Sort_13 2.00 root a:asc
390
390
└─HashAgg_26 1.00 root group by:a, funcs:firstrow(a), firstrow(a)
391
391
└─Projection_27 1.00 root 1
392
392
└─TableDual_28 1.00 root rows:1
393
- explain SELECT 0 AS a FROM dual UNION (SELECT 1 AS a FROM dual ORDER BY a)
393
+ explain SELECT 0 AS a FROM dual UNION (SELECT 1 AS a FROM dual ORDER BY a);
394
394
id count task operator info
395
395
HashAgg_15 2.00 root group by:a, funcs:firstrow(join_agg_0)
396
396
└─Union_16 2.00 root
@@ -400,3 +400,26 @@ 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);
405
+ explain select * from t where _tidb_rowid = 0;
406
+ id count task operator info
407
+ Projection_4 8000.00 root test.t.a
408
+ └─TableReader_6 10000.00 root data:TableScan_5
409
+ └─TableScan_5 10000.00 cop table:t, range:[0,0], keep order:false, stats:pseudo
410
+ explain select * from t where _tidb_rowid > 0;
411
+ id count task operator info
412
+ Projection_4 8000.00 root test.t.a
413
+ └─TableReader_6 10000.00 root data:TableScan_5
414
+ └─TableScan_5 10000.00 cop table:t, range:(0,+inf], keep order:false, stats:pseudo
415
+ explain select a, _tidb_rowid from t where a > 0;
416
+ id count task operator info
417
+ TableReader_7 3333.33 root data:Selection_6
418
+ └─Selection_6 3333.33 cop gt(test.t.a, 0)
419
+ └─TableScan_5 10000.00 cop table:t, range:[-inf,+inf], keep order:false, stats:pseudo
420
+ explain select * from t where _tidb_rowid > 0 and a > 0;
421
+ id count task operator info
422
+ Projection_4 2666.67 root test.t.a
423
+ └─TableReader_7 2666.67 root data:Selection_6
424
+ └─Selection_6 2666.67 cop gt(test.t.a, 0)
425
+ └─TableScan_5 3333.33 cop table:t, range:(0,+inf], keep order:false, stats:pseudo
0 commit comments