@@ -444,3 +444,38 @@ CTE_0 50.00 root Non-Recursive CTE
444
444
└─IndexLookUp(Probe) 1.00 root
445
445
├─IndexRangeScan(Build) 1.00 cop[tikv] table:customer, index:PRIMARY(c_customer_sk) range: decided by [eq(test.customer.c_customer_sk, test.web_sales.ws_bill_customer_sk)], keep order:false, stats:pseudo
446
446
└─TableRowIDScan(Probe) 1.00 cop[tikv] table:customer keep order:false, stats:pseudo
447
+ drop table if exists t1;
448
+ create table t1 (id int, bench_type varchar(10),version varchar(10),tps int(20));
449
+ insert into t1 (id,bench_type,version,tps) values (1,'sysbench','5.4.0',1111111);
450
+ insert into t1 (id,bench_type,version,tps) values (2,'sysbench','6.0.0',222222);
451
+ with all_data as
452
+ (select * from t1
453
+ ),version1 as (select * from all_data where version ='5.4.0'
454
+ ),version2 as(select * from all_data where version ='6.0.0')
455
+ select v1.tps v1_tps,v2.tps v2_tps
456
+ from version1 v1, version2 v2
457
+ where v1.bench_type =v2.bench_type;
458
+ v1_tps v2_tps
459
+ 1111111 222222
460
+ desc format='brief' with all_data as
461
+ (select * from t1
462
+ ),version1 as (select * from all_data where version ='5.4.0'
463
+ ),version2 as(select * from all_data where version ='6.0.0')
464
+ select v1.tps v1_tps,v2.tps v2_tps
465
+ from version1 v1, version2 v2
466
+ where v1.bench_type =v2.bench_type;
467
+ id estRows task access object operator info
468
+ HashJoin 8000.00 root inner join, equal:[eq(test.t1.bench_type, test.t1.bench_type)]
469
+ ├─Selection(Build) 6400.00 root not(isnull(test.t1.bench_type))
470
+ │ └─CTEFullScan 8000.00 root CTE:v2 data:CTE_2
471
+ └─Selection(Probe) 6400.00 root not(isnull(test.t1.bench_type))
472
+ └─CTEFullScan 8000.00 root CTE:v1 data:CTE_1
473
+ CTE_2 8000.00 root Non-Recursive CTE
474
+ └─Selection(Seed Part) 8000.00 root eq(test.t1.version, "6.0.0"), not(isnull(test.t1.bench_type))
475
+ └─CTEFullScan 10000.00 root CTE:all_data data:CTE_0
476
+ CTE_1 8000.00 root Non-Recursive CTE
477
+ └─Selection(Seed Part) 8000.00 root eq(test.t1.version, "5.4.0"), not(isnull(test.t1.bench_type))
478
+ └─CTEFullScan 10000.00 root CTE:all_data data:CTE_0
479
+ CTE_0 10000.00 root Non-Recursive CTE
480
+ └─TableReader(Seed Part) 10000.00 root data:TableFullScan
481
+ └─TableFullScan 10000.00 cop[tikv] table:t1 keep order:false, stats:pseudo
0 commit comments