From 5c4c04e4cca3dc7a1b6d187edb5a04a1c621df55 Mon Sep 17 00:00:00 2001 From: Zhuhe Fang Date: Sat, 8 May 2021 18:03:55 +0800 Subject: [PATCH] Update partition_pruner_out.json --- .../core/testdata/partition_pruner_out.json | 1037 ----------------- 1 file changed, 1037 deletions(-) diff --git a/planner/core/testdata/partition_pruner_out.json b/planner/core/testdata/partition_pruner_out.json index 944d0897ed2c2..9e2fc0d38ec42 100644 --- a/planner/core/testdata/partition_pruner_out.json +++ b/planner/core/testdata/partition_pruner_out.json @@ -175,56 +175,6 @@ "└─Selection 0.02 cop[tikv] or(and(eq(test_partition.t7.a, 1), eq(test_partition.t7.b, 2)), and(eq(test_partition.t7.a, 3), eq(test_partition.t7.b, 4)))", " └─TableFullScan 10000.00 cop[tikv] table:t7 keep order:false, stats:pseudo" ] -<<<<<<< HEAD -======= - }, - { - "SQL": "explain format = 'brief' select * from t8 where a between 10 and 11", - "Result": [ - "TableReader 250.00 root partition:p4,p5 data:Selection", - "└─Selection 250.00 cop[tikv] ge(test_partition.t8.a, 10), le(test_partition.t8.a, 11)", - " └─TableFullScan 10000.00 cop[tikv] table:t8 keep order:false, stats:pseudo" - ] - }, - { - "SQL": "explain format = 'brief' select * from t8 where (a is null) or (a between 5 and 8)", - "Result": [ - "TableReader 260.00 root partition:p0,p1,p2,p5 data:Selection", - "└─Selection 260.00 cop[tikv] or(isnull(test_partition.t8.a), and(ge(test_partition.t8.a, 5), le(test_partition.t8.a, 8)))", - " └─TableFullScan 10000.00 cop[tikv] table:t8 keep order:false, stats:pseudo" - ] - }, - { - "SQL": "explain format = 'brief' select * from t8 where a between 5 and 12", - "Result": [ - "TableReader 250.00 root partition:all data:Selection", - "└─Selection 250.00 cop[tikv] ge(test_partition.t8.a, 5), le(test_partition.t8.a, 12)", - " └─TableFullScan 10000.00 cop[tikv] table:t8 keep order:false, stats:pseudo" - ] - }, - { - "SQL": "explain format = 'brief' select * from t8 where (a <= 10 and a >= 8) or (a <= 13 and a >= 11) or (a <= 16 and a >= 14)", - "Result": [ - "TableReader 750.00 root partition:p0,p1,p2,p3,p4,p5 data:Selection", - "└─Selection 750.00 cop[tikv] or(and(le(test_partition.t8.a, 10), ge(test_partition.t8.a, 8)), or(and(le(test_partition.t8.a, 13), ge(test_partition.t8.a, 11)), and(le(test_partition.t8.a, 16), ge(test_partition.t8.a, 14))))", - " └─TableFullScan 10000.00 cop[tikv] table:t8 keep order:false, stats:pseudo" - ] - }, - { - "SQL": "explain format = 'brief' select * from t8 where a < 12 and a > 9", - "Result": [ - "TableReader 250.00 root partition:p4,p5 data:Selection", - "└─Selection 250.00 cop[tikv] gt(test_partition.t8.a, 9), lt(test_partition.t8.a, 12)", - " └─TableFullScan 10000.00 cop[tikv] table:t8 keep order:false, stats:pseudo" - ] - }, - { - "SQL": "explain format = 'brief' select * from t9", - "Result": [ - "TableReader 10000.00 root partition:p0,p1 data:TableFullScan", - "└─TableFullScan 10000.00 cop[tikv] table:t9 keep order:false, stats:pseudo" - ] ->>>>>>> 0859a3c02... planner: refactor Converting Partition Keys for shuffle hash join (#24456) } ] }, @@ -1916,993 +1866,6 @@ " └─Selection 30.00 cop[tikv] in(test_partition_1.t1.b, 6, 7, 8)", " └─IndexFullScan 10000.00 cop[tikv] table:t1, index:a(a, b, id) keep order:false, stats:pseudo" ] -<<<<<<< HEAD -======= - }, - { - "SQL": "select * from t1 where a < 1 or b < 2", - "Result": [ - "1 1 1" - ], - "Plan": [ - "TableReader 5542.21 root partition:p0 data:Selection", - "└─Selection 5542.21 cop[tikv] or(lt(test_partition.t1.a, 1), lt(test_partition.t1.b, 2))", - " └─TableFullScan 10000.00 cop[tikv] table:t1 keep order:false, stats:pseudo" - ], - "IndexPlan": [ - "IndexReader 5542.21 root partition:p0 index:Selection", - "└─Selection 5542.21 cop[tikv] or(lt(test_partition_1.t1.a, 1), lt(test_partition_1.t1.b, 2))", - " └─IndexFullScan 10000.00 cop[tikv] table:t1, index:a(a, b, id) keep order:false, stats:pseudo" - ] - }, - { - "SQL": "select count(1) from t1 where a < 1 or b < 2", - "Result": [ - "1" - ], - "Plan": [ - "StreamAgg 1.00 root funcs:count(Column#7)->Column#5", - "└─TableReader 1.00 root partition:p0 data:StreamAgg", - " └─StreamAgg 1.00 cop[tikv] funcs:count(1)->Column#7", - " └─Selection 5542.21 cop[tikv] or(lt(test_partition.t1.a, 1), lt(test_partition.t1.b, 2))", - " └─TableFullScan 10000.00 cop[tikv] table:t1 keep order:false, stats:pseudo" - ], - "IndexPlan": [ - "StreamAgg 1.00 root funcs:count(Column#10)->Column#5", - "└─IndexReader 1.00 root partition:p0 index:StreamAgg", - " └─StreamAgg 1.00 cop[tikv] funcs:count(1)->Column#10", - " └─Selection 5542.21 cop[tikv] or(lt(test_partition_1.t1.a, 1), lt(test_partition_1.t1.b, 2))", - " └─IndexFullScan 10000.00 cop[tikv] table:t1, index:a(a, b, id) keep order:false, stats:pseudo" - ] - }, - { - "SQL": "select * from t1 where a < 1 and b < 2", - "Result": null, - "Plan": [ - "TableReader 1104.45 root partition:dual data:Selection", - "└─Selection 1104.45 cop[tikv] lt(test_partition.t1.a, 1), lt(test_partition.t1.b, 2)", - " └─TableFullScan 10000.00 cop[tikv] table:t1 keep order:false, stats:pseudo" - ], - "IndexPlan": [ - "IndexReader 1104.45 root partition:dual index:Selection", - "└─Selection 1104.45 cop[tikv] lt(test_partition_1.t1.b, 2)", - " └─IndexRangeScan 3323.33 cop[tikv] table:t1, index:a(a, b, id) range:[-inf,1), keep order:false, stats:pseudo" - ] - }, - { - "SQL": "select * from t1 where a < 3 or b > 4", - "Result": [ - "1 1 1", - "2 2 2", - "5 5 5", - "6 6 6", - "7 7 7", - "8 8 8", - "9 9 9", - "10 10 10" - ], - "Plan": [ - "TableReader 5548.89 root partition:p0,p1 data:Selection", - "└─Selection 5548.89 cop[tikv] or(lt(test_partition.t1.a, 3), gt(test_partition.t1.b, 4))", - " └─TableFullScan 10000.00 cop[tikv] table:t1 keep order:false, stats:pseudo" - ], - "IndexPlan": [ - "IndexReader 5548.89 root partition:p0,p1 index:Selection", - "└─Selection 5548.89 cop[tikv] or(lt(test_partition_1.t1.a, 3), gt(test_partition_1.t1.b, 4))", - " └─IndexFullScan 10000.00 cop[tikv] table:t1, index:a(a, b, id) keep order:false, stats:pseudo" - ] - }, - { - "SQL": "select * from t1 where a < 3 and b > 4", - "Result": null, - "Plan": [ - "TableReader 1107.78 root partition:dual data:Selection", - "└─Selection 1107.78 cop[tikv] gt(test_partition.t1.b, 4), lt(test_partition.t1.a, 3)", - " └─TableFullScan 10000.00 cop[tikv] table:t1 keep order:false, stats:pseudo" - ], - "IndexPlan": [ - "IndexReader 1107.78 root partition:dual index:Selection", - "└─Selection 1107.78 cop[tikv] gt(test_partition_1.t1.b, 4)", - " └─IndexRangeScan 3323.33 cop[tikv] table:t1, index:a(a, b, id) range:[-inf,3), keep order:false, stats:pseudo" - ] - }, - { - "SQL": "select * from t1 where a < 3 and b >= 3", - "Result": null, - "Plan": [ - "TableReader 1107.78 root partition:dual data:Selection", - "└─Selection 1107.78 cop[tikv] ge(test_partition.t1.b, 3), lt(test_partition.t1.a, 3)", - " └─TableFullScan 10000.00 cop[tikv] table:t1 keep order:false, stats:pseudo" - ], - "IndexPlan": [ - "IndexReader 1107.78 root partition:dual index:Selection", - "└─Selection 1107.78 cop[tikv] ge(test_partition_1.t1.b, 3)", - " └─IndexRangeScan 3323.33 cop[tikv] table:t1, index:a(a, b, id) range:[-inf,3), keep order:false, stats:pseudo" - ] - }, - { - "SQL": "select * from t1 where a < 3 and (b >= 1 and b <= 3)", - "Result": [ - "1 1 1", - "2 2 2" - ], - "Plan": [ - "TableReader 83.08 root partition:p0 data:Selection", - "└─Selection 83.08 cop[tikv] ge(test_partition.t1.b, 1), le(test_partition.t1.b, 3), lt(test_partition.t1.a, 3)", - " └─TableFullScan 10000.00 cop[tikv] table:t1 keep order:false, stats:pseudo" - ], - "IndexPlan": [ - "IndexReader 83.08 root partition:p0 index:Selection", - "└─Selection 83.08 cop[tikv] ge(test_partition_1.t1.b, 1), le(test_partition_1.t1.b, 3)", - " └─IndexRangeScan 3323.33 cop[tikv] table:t1, index:a(a, b, id) range:[-inf,3), keep order:false, stats:pseudo" - ] - }, - { - "SQL": "select * from t1 where a <= 3 or b <= 3", - "Result": [ - "1 1 1", - "2 2 2", - "3 3 3" - ], - "Plan": [ - "TableReader 5542.21 root partition:p0 data:Selection", - "└─Selection 5542.21 cop[tikv] or(le(test_partition.t1.a, 3), le(test_partition.t1.b, 3))", - " └─TableFullScan 10000.00 cop[tikv] table:t1 keep order:false, stats:pseudo" - ], - "IndexPlan": [ - "IndexReader 5542.21 root partition:p0 index:Selection", - "└─Selection 5542.21 cop[tikv] or(le(test_partition_1.t1.a, 3), le(test_partition_1.t1.b, 3))", - " └─IndexFullScan 10000.00 cop[tikv] table:t1, index:a(a, b, id) keep order:false, stats:pseudo" - ] - }, - { - "SQL": "select * from t1 where (a<=1 and b<=1) or (a >=6 and b>=6)", - "Result": [ - "1 1 1", - "6 6 6", - "7 7 7", - "8 8 8", - "9 9 9", - "10 10 10" - ], - "Plan": [ - "TableReader 2092.85 root partition:p0,p1 data:Selection", - "└─Selection 2092.85 cop[tikv] or(and(le(test_partition.t1.a, 1), le(test_partition.t1.b, 1)), and(ge(test_partition.t1.a, 6), ge(test_partition.t1.b, 6)))", - " └─TableFullScan 10000.00 cop[tikv] table:t1 keep order:false, stats:pseudo" - ], - "IndexPlan": [ - "IndexReader 5325.33 root partition:p0,p1 index:Selection", - "└─Selection 5325.33 cop[tikv] or(and(le(test_partition_1.t1.a, 1), le(test_partition_1.t1.b, 1)), and(ge(test_partition_1.t1.a, 6), ge(test_partition_1.t1.b, 6)))", - " └─IndexRangeScan 6656.67 cop[tikv] table:t1, index:a(a, b, id) range:[-inf,1], [6,+inf], keep order:false, stats:pseudo" - ] - }, - { - "SQL": "select * from t1 where a <= 100 and b <= 100", - "Result": [ - "1 1 1", - "2 2 2", - "3 3 3", - "4 4 4", - "5 5 5", - "6 6 6", - "7 7 7", - "8 8 8", - "9 9 9", - "10 10 10" - ], - "Plan": [ - "TableReader 1104.45 root partition:p0,p1 data:Selection", - "└─Selection 1104.45 cop[tikv] le(test_partition.t1.a, 100), le(test_partition.t1.b, 100)", - " └─TableFullScan 10000.00 cop[tikv] table:t1 keep order:false, stats:pseudo" - ], - "IndexPlan": [ - "IndexReader 1104.45 root partition:p0,p1 index:Selection", - "└─Selection 1104.45 cop[tikv] le(test_partition_1.t1.b, 100)", - " └─IndexRangeScan 3323.33 cop[tikv] table:t1, index:a(a, b, id) range:[-inf,100], keep order:false, stats:pseudo" - ] - }, - { - "SQL": "select * from t1 join t2 on t1.id = t2.id where (t1.a <= 3 and (t1.b >= 3 and t1.b <= 5)) and (t2.a >= 6 and t2.a <= 8) and t2.b>=7 and t2.id>=7", - "Result": null, - "Plan": [ - "HashJoin 34.62 root inner join, equal:[eq(test_partition.t1.id, test_partition.t2.id)]", - "├─TableReader(Build) 27.69 root partition:p0 data:Selection", - "│ └─Selection 27.69 cop[tikv] ge(test_partition.t1.b, 3), ge(test_partition.t1.id, 7), le(test_partition.t1.a, 3), le(test_partition.t1.b, 5), not(isnull(test_partition.t1.id))", - "│ └─TableFullScan 10000.00 cop[tikv] table:t1 keep order:false, stats:pseudo", - "└─TableReader(Probe) 27.78 root partition:p1 data:Selection", - " └─Selection 27.78 cop[tikv] ge(test_partition.t2.a, 6), ge(test_partition.t2.b, 7), ge(test_partition.t2.id, 7), le(test_partition.t2.a, 8), not(isnull(test_partition.t2.id))", - " └─TableFullScan 10000.00 cop[tikv] table:t2 keep order:false, stats:pseudo" - ], - "IndexPlan": [ - "HashJoin 34.62 root inner join, equal:[eq(test_partition_1.t1.id, test_partition_1.t2.id)]", - "├─IndexReader(Build) 27.69 root partition:p0 index:Selection", - "│ └─Selection 27.69 cop[tikv] ge(test_partition_1.t1.b, 3), ge(test_partition_1.t1.id, 7), le(test_partition_1.t1.b, 5), not(isnull(test_partition_1.t1.id))", - "│ └─IndexRangeScan 3323.33 cop[tikv] table:t1, index:a(a, b, id) range:[-inf,3], keep order:false, stats:pseudo", - "└─IndexReader(Probe) 27.78 root partition:p1 index:Selection", - " └─Selection 27.78 cop[tikv] ge(test_partition_1.t2.b, 7), ge(test_partition_1.t2.id, 7), not(isnull(test_partition_1.t2.id))", - " └─IndexRangeScan 250.00 cop[tikv] table:t2, index:a(a, b, id) range:[6,8], keep order:false, stats:pseudo" - ] - }, - { - "SQL": "select * from t1 left join t2 on true where (t1.a <=1 or t1.a <= 3 and (t1.b >=3 and t1.b <= 5)) and (t2.a >= 6 and t2.a <= 8) and t2.b>=7 and t2.id>=7 order by t1.id,t1.a", - "Result": [ - "1 1 1 8 8 8", - "1 1 1 7 7 7", - "3 3 3 8 8 8", - "3 3 3 7 7 7" - ], - "Plan": [ - "Sort 675761.06 root test_partition.t1.id, test_partition.t1.a", - "└─Projection 675761.06 root test_partition.t1.id, test_partition.t1.a, test_partition.t1.b, test_partition.t2.id, test_partition.t2.a, test_partition.t2.b", - " └─HashJoin 675761.06 root CARTESIAN inner join", - " ├─TableReader(Build) 200.00 root partition:p1 data:Selection", - " │ └─Selection 200.00 cop[tikv] 1, ge(test_partition.t2.a, 6), ge(test_partition.t2.b, 7), ge(test_partition.t2.id, 7), le(test_partition.t2.a, 8)", - " │ └─TableFullScan 10000.00 cop[tikv] table:t2 keep order:false, stats:pseudo", - " └─TableReader(Probe) 3378.81 root partition:p0 data:Selection", - " └─Selection 3378.81 cop[tikv] 1, or(le(test_partition.t1.a, 1), and(le(test_partition.t1.a, 3), and(ge(test_partition.t1.b, 3), le(test_partition.t1.b, 5))))", - " └─TableFullScan 10000.00 cop[tikv] table:t1 keep order:false, stats:pseudo" - ], - "IndexPlan": [ - "Sort 224577.93 root test_partition_1.t1.id, test_partition_1.t1.a", - "└─Projection 224577.93 root test_partition_1.t1.id, test_partition_1.t1.a, test_partition_1.t1.b, test_partition_1.t2.id, test_partition_1.t2.a, test_partition_1.t2.b", - " └─HashJoin 224577.93 root CARTESIAN inner join", - " ├─IndexReader(Build) 200.00 root partition:p1 index:Selection", - " │ └─Selection 200.00 cop[tikv] ge(test_partition_1.t2.b, 7), ge(test_partition_1.t2.id, 7)", - " │ └─IndexRangeScan 250.00 cop[tikv] table:t2, index:a(a, b, id) range:[6,8], keep order:false, stats:pseudo", - " └─IndexReader(Probe) 1122.89 root partition:p0 index:Selection", - " └─Selection 1122.89 cop[tikv] or(le(test_partition_1.t1.a, 1), and(le(test_partition_1.t1.a, 3), and(ge(test_partition_1.t1.b, 3), le(test_partition_1.t1.b, 5))))", - " └─IndexRangeScan 3323.33 cop[tikv] table:t1, index:a(a, b, id) range:[-inf,3], keep order:false, stats:pseudo" - ] - }, - { - "SQL": "select * from t1 where a <= 1", - "Result": [ - "1 1 1" - ], - "Plan": [ - "TableReader 3323.33 root partition:p0 data:Selection", - "└─Selection 3323.33 cop[tikv] le(test_partition.t1.a, 1)", - " └─TableFullScan 10000.00 cop[tikv] table:t1 keep order:false, stats:pseudo" - ], - "IndexPlan": [ - "IndexReader 3323.33 root partition:p0 index:IndexRangeScan", - "└─IndexRangeScan 3323.33 cop[tikv] table:t1, index:a(a, b, id) range:[-inf,1], keep order:false, stats:pseudo" - ] - }, - { - "SQL": "select * from t1 where b <= 1", - "Result": [ - "1 1 1" - ], - "Plan": [ - "TableReader 3323.33 root partition:p0 data:Selection", - "└─Selection 3323.33 cop[tikv] le(test_partition.t1.b, 1)", - " └─TableFullScan 10000.00 cop[tikv] table:t1 keep order:false, stats:pseudo" - ], - "IndexPlan": [ - "IndexReader 3323.33 root partition:p0 index:Selection", - "└─Selection 3323.33 cop[tikv] le(test_partition_1.t1.b, 1)", - " └─IndexFullScan 10000.00 cop[tikv] table:t1, index:a(a, b, id) keep order:false, stats:pseudo" - ] - }, - { - "SQL": "select * from t1 where a <= 1 or b <= 2", - "Result": [ - "1 1 1", - "2 2 2" - ], - "Plan": [ - "TableReader 5542.21 root partition:p0 data:Selection", - "└─Selection 5542.21 cop[tikv] or(le(test_partition.t1.a, 1), le(test_partition.t1.b, 2))", - " └─TableFullScan 10000.00 cop[tikv] table:t1 keep order:false, stats:pseudo" - ], - "IndexPlan": [ - "IndexReader 5542.21 root partition:p0 index:Selection", - "└─Selection 5542.21 cop[tikv] or(le(test_partition_1.t1.a, 1), le(test_partition_1.t1.b, 2))", - " └─IndexFullScan 10000.00 cop[tikv] table:t1, index:a(a, b, id) keep order:false, stats:pseudo" - ] - }, - { - "SQL": "select * from t1 where a <= 1 or (a <= 2 and b <= 2) or (a <= 5 or b <= 5)", - "Result": [ - "1 1 1", - "2 2 2", - "3 3 3", - "4 4 4", - "5 5 5" - ], - "Plan": [ - "TableReader 6034.55 root partition:p0 data:Selection", - "└─Selection 6034.55 cop[tikv] or(or(le(test_partition.t1.a, 1), and(le(test_partition.t1.a, 2), le(test_partition.t1.b, 2))), or(le(test_partition.t1.a, 5), le(test_partition.t1.b, 5)))", - " └─TableFullScan 10000.00 cop[tikv] table:t1 keep order:false, stats:pseudo" - ], - "IndexPlan": [ - "IndexReader 6034.55 root partition:p0 index:Selection", - "└─Selection 6034.55 cop[tikv] or(or(le(test_partition_1.t1.a, 1), and(le(test_partition_1.t1.a, 2), le(test_partition_1.t1.b, 2))), or(le(test_partition_1.t1.a, 5), le(test_partition_1.t1.b, 5)))", - " └─IndexFullScan 10000.00 cop[tikv] table:t1, index:a(a, b, id) keep order:false, stats:pseudo" - ] - }, - { - "SQL": "select * from t1 where a <= 1 or (a is null and b >= 10)", - "Result": [ - "1 1 1" - ], - "Plan": [ - "TableReader 3325.56 root partition:p0 data:Selection", - "└─Selection 3325.56 cop[tikv] or(le(test_partition.t1.a, 1), and(isnull(test_partition.t1.a), ge(test_partition.t1.b, 10)))", - " └─TableFullScan 10000.00 cop[tikv] table:t1 keep order:false, stats:pseudo" - ], - "IndexPlan": [ - "IndexReader 200.00 root partition:p0 index:Selection", - "└─Selection 200.00 cop[tikv] or(le(test_partition_1.t1.a, 1), and(isnull(test_partition_1.t1.a), ge(test_partition_1.t1.b, 10)))", - " └─IndexRangeScan 250.00 cop[tikv] table:t1, index:a(a, b, id) range:[NULL,1], keep order:false, stats:pseudo" - ] - }, - { - "SQL": "select * from t1 where a <= 1 or (a <= 10 and b is null)", - "Result": [ - "1 1 1", - " 10 " - ], - "Plan": [ - "TableReader 3325.55 root partition:p0,p1 data:Selection", - "└─Selection 3325.55 cop[tikv] or(le(test_partition.t1.a, 1), and(le(test_partition.t1.a, 10), isnull(test_partition.t1.b)))", - " └─TableFullScan 10000.00 cop[tikv] table:t1 keep order:false, stats:pseudo" - ], - "IndexPlan": [ - "IndexReader 2658.67 root partition:p0,p1 index:Selection", - "└─Selection 2658.67 cop[tikv] or(le(test_partition_1.t1.a, 1), and(le(test_partition_1.t1.a, 10), isnull(test_partition_1.t1.b)))", - " └─IndexRangeScan 3323.33 cop[tikv] table:t1, index:a(a, b, id) range:[-inf,10], keep order:false, stats:pseudo" - ] - }, - { - "SQL": "select * from t1 where a <= 8 or b <= 9", - "Result": [ - "1 1 1", - "2 2 2", - "3 3 3", - "4 4 4", - "5 5 5", - "6 6 6", - "7 7 7", - "8 8 8", - "9 9 9" - ], - "Plan": [ - "TableReader 5542.21 root partition:p0,p1 data:Selection", - "└─Selection 5542.21 cop[tikv] or(le(test_partition.t1.a, 8), le(test_partition.t1.b, 9))", - " └─TableFullScan 10000.00 cop[tikv] table:t1 keep order:false, stats:pseudo" - ], - "IndexPlan": [ - "IndexReader 5542.21 root partition:p0,p1 index:Selection", - "└─Selection 5542.21 cop[tikv] or(le(test_partition_1.t1.a, 8), le(test_partition_1.t1.b, 9))", - " └─IndexFullScan 10000.00 cop[tikv] table:t1, index:a(a, b, id) keep order:false, stats:pseudo" - ] - }, - { - "SQL": "select * from t1 where a <= 3 and false", - "Result": null, - "Plan": [ - "TableDual 0.00 root rows:0" - ], - "IndexPlan": [ - "TableDual 0.00 root rows:0" - ] - }, - { - "SQL": "select * from t1 where a <= 3 and true", - "Result": [ - "1 1 1", - "2 2 2", - "3 3 3" - ], - "Plan": [ - "TableReader 3323.33 root partition:p0 data:Selection", - "└─Selection 3323.33 cop[tikv] le(test_partition.t1.a, 3)", - " └─TableFullScan 10000.00 cop[tikv] table:t1 keep order:false, stats:pseudo" - ], - "IndexPlan": [ - "IndexReader 3323.33 root partition:p0 index:IndexRangeScan", - "└─IndexRangeScan 3323.33 cop[tikv] table:t1, index:a(a, b, id) range:[-inf,3], keep order:false, stats:pseudo" - ] - }, - { - "SQL": "select * from t1 where a <= 3 or false", - "Result": [ - "1 1 1", - "2 2 2", - "3 3 3" - ], - "Plan": [ - "TableReader 3323.33 root partition:p0 data:Selection", - "└─Selection 3323.33 cop[tikv] or(le(test_partition.t1.a, 3), 0)", - " └─TableFullScan 10000.00 cop[tikv] table:t1 keep order:false, stats:pseudo" - ], - "IndexPlan": [ - "IndexReader 3323.33 root partition:p0 index:IndexRangeScan", - "└─IndexRangeScan 3323.33 cop[tikv] table:t1, index:a(a, b, id) range:[-inf,3], keep order:false, stats:pseudo" - ] - }, - { - "SQL": "select * from t1 where a = 3 or true order by id,a", - "Result": [ - " 10 ", - "1 1 1", - "2 2 2", - "3 3 3", - "4 4 4", - "5 5 5", - "6 6 6", - "7 7 7", - "8 8 8", - "9 9 9", - "10 10 10" - ], - "Plan": [ - "Sort 10000.00 root test_partition.t1.id, test_partition.t1.a", - "└─TableReader 10000.00 root partition:all data:Selection", - " └─Selection 10000.00 cop[tikv] or(eq(test_partition.t1.a, 3), 1)", - " └─TableFullScan 10000.00 cop[tikv] table:t1 keep order:false, stats:pseudo" - ], - "IndexPlan": [ - "Sort 10000.00 root test_partition_1.t1.id, test_partition_1.t1.a", - "└─IndexReader 10000.00 root partition:all index:IndexFullScan", - " └─IndexFullScan 10000.00 cop[tikv] table:t1, index:a(a, b, id) keep order:false, stats:pseudo" - ] - }, - { - "SQL": "select * from t1 where a = 3 or (b >= 100 and b <= 200)", - "Result": [ - "3 3 3" - ], - "Plan": [ - "TableReader 259.75 root partition:p0 data:Selection", - "└─Selection 259.75 cop[tikv] or(eq(test_partition.t1.a, 3), and(ge(test_partition.t1.b, 100), le(test_partition.t1.b, 200)))", - " └─TableFullScan 10000.00 cop[tikv] table:t1 keep order:false, stats:pseudo" - ], - "IndexPlan": [ - "IndexReader 259.75 root partition:p0 index:Selection", - "└─Selection 259.75 cop[tikv] or(eq(test_partition_1.t1.a, 3), and(ge(test_partition_1.t1.b, 100), le(test_partition_1.t1.b, 200)))", - " └─IndexFullScan 10000.00 cop[tikv] table:t1, index:a(a, b, id) keep order:false, stats:pseudo" - ] - }, - { - "SQL": "select * from t1 where a = 100 or b >= 1 and b <= 2", - "Result": [ - "1 1 1", - "2 2 2" - ], - "Plan": [ - "TableReader 259.75 root partition:p0 data:Selection", - "└─Selection 259.75 cop[tikv] or(eq(test_partition.t1.a, 100), and(ge(test_partition.t1.b, 1), le(test_partition.t1.b, 2)))", - " └─TableFullScan 10000.00 cop[tikv] table:t1 keep order:false, stats:pseudo" - ], - "IndexPlan": [ - "IndexReader 259.75 root partition:p0 index:Selection", - "└─Selection 259.75 cop[tikv] or(eq(test_partition_1.t1.a, 100), and(ge(test_partition_1.t1.b, 1), le(test_partition_1.t1.b, 2)))", - " └─IndexFullScan 10000.00 cop[tikv] table:t1, index:a(a, b, id) keep order:false, stats:pseudo" - ] - }, - { - "SQL": "select * from t1 where a = 100 or b >= 1 and b <= 6", - "Result": [ - "1 1 1", - "2 2 2", - "3 3 3", - "4 4 4", - "5 5 5", - "6 6 6" - ], - "Plan": [ - "TableReader 259.75 root partition:p0,p1 data:Selection", - "└─Selection 259.75 cop[tikv] or(eq(test_partition.t1.a, 100), and(ge(test_partition.t1.b, 1), le(test_partition.t1.b, 6)))", - " └─TableFullScan 10000.00 cop[tikv] table:t1 keep order:false, stats:pseudo" - ], - "IndexPlan": [ - "IndexReader 259.75 root partition:p0,p1 index:Selection", - "└─Selection 259.75 cop[tikv] or(eq(test_partition_1.t1.a, 100), and(ge(test_partition_1.t1.b, 1), le(test_partition_1.t1.b, 6)))", - " └─IndexFullScan 10000.00 cop[tikv] table:t1, index:a(a, b, id) keep order:false, stats:pseudo" - ] - }, - { - "SQL": "select * from t1 where a = 100 or (b >= 100 and b <= 200)", - "Result": null, - "Plan": [ - "TableReader 259.75 root partition:dual data:Selection", - "└─Selection 259.75 cop[tikv] or(eq(test_partition.t1.a, 100), and(ge(test_partition.t1.b, 100), le(test_partition.t1.b, 200)))", - " └─TableFullScan 10000.00 cop[tikv] table:t1 keep order:false, stats:pseudo" - ], - "IndexPlan": [ - "IndexReader 259.75 root partition:dual index:Selection", - "└─Selection 259.75 cop[tikv] or(eq(test_partition_1.t1.a, 100), and(ge(test_partition_1.t1.b, 100), le(test_partition_1.t1.b, 200)))", - " └─IndexFullScan 10000.00 cop[tikv] table:t1, index:a(a, b, id) keep order:false, stats:pseudo" - ] - }, - { - "SQL": "select * from t1 where (a >= 1 and a <= 6) or (b >= 1 and b <= 2) or (a<=3 and b <=3)", - "Result": [ - "1 1 1", - "2 2 2", - "3 3 3", - "4 4 4", - "5 5 5", - "6 6 6" - ], - "Plan": [ - "TableReader 1543.67 root partition:p0,p1 data:Selection", - "└─Selection 1543.67 cop[tikv] or(and(ge(test_partition.t1.a, 1), le(test_partition.t1.a, 6)), or(and(ge(test_partition.t1.b, 1), le(test_partition.t1.b, 2)), and(le(test_partition.t1.a, 3), le(test_partition.t1.b, 3))))", - " └─TableFullScan 10000.00 cop[tikv] table:t1 keep order:false, stats:pseudo" - ], - "IndexPlan": [ - "IndexReader 1543.67 root partition:p0,p1 index:Selection", - "└─Selection 1543.67 cop[tikv] or(and(ge(test_partition_1.t1.a, 1), le(test_partition_1.t1.a, 6)), or(and(ge(test_partition_1.t1.b, 1), le(test_partition_1.t1.b, 2)), and(le(test_partition_1.t1.a, 3), le(test_partition_1.t1.b, 3))))", - " └─IndexFullScan 10000.00 cop[tikv] table:t1, index:a(a, b, id) keep order:false, stats:pseudo" - ] - }, - { - "SQL": "select * from t1 where a >= 1 and a <= 6", - "Result": [ - "1 1 1", - "2 2 2", - "3 3 3", - "4 4 4", - "5 5 5", - "6 6 6" - ], - "Plan": [ - "TableReader 250.00 root partition:p0,p1 data:Selection", - "└─Selection 250.00 cop[tikv] ge(test_partition.t1.a, 1), le(test_partition.t1.a, 6)", - " └─TableFullScan 10000.00 cop[tikv] table:t1 keep order:false, stats:pseudo" - ], - "IndexPlan": [ - "IndexReader 250.00 root partition:p0,p1 index:IndexRangeScan", - "└─IndexRangeScan 250.00 cop[tikv] table:t1, index:a(a, b, id) range:[1,6], keep order:false, stats:pseudo" - ] - }, - { - "SQL": "select * from t1 where (a >= 1 and a <= 6) or (a>=3 and b >=3)", - "Result": [ - "1 1 1", - "2 2 2", - "3 3 3", - "4 4 4", - "5 5 5", - "6 6 6", - "7 7 7", - "8 8 8", - "9 9 9", - "10 10 10" - ], - "Plan": [ - "TableReader 1333.33 root partition:p0,p1 data:Selection", - "└─Selection 1333.33 cop[tikv] or(and(ge(test_partition.t1.a, 1), le(test_partition.t1.a, 6)), and(ge(test_partition.t1.a, 3), ge(test_partition.t1.b, 3)))", - " └─TableFullScan 10000.00 cop[tikv] table:t1 keep order:false, stats:pseudo" - ], - "IndexPlan": [ - "IndexReader 2666.67 root partition:p0,p1 index:Selection", - "└─Selection 2666.67 cop[tikv] or(and(ge(test_partition_1.t1.a, 1), le(test_partition_1.t1.a, 6)), and(ge(test_partition_1.t1.a, 3), ge(test_partition_1.t1.b, 3)))", - " └─IndexRangeScan 3333.33 cop[tikv] table:t1, index:a(a, b, id) range:[1,+inf], keep order:false, stats:pseudo" - ] - }, - { - "SQL": "select * from t1 where a in (1,6) and (a=3 and b =3)", - "Result": null, - "Plan": [ - "TableDual 8000.00 root rows:0" - ], - "IndexPlan": [ - "TableDual 8000.00 root rows:0" - ] - }, - { - "SQL": "select * from t1 where a <= 1 and (b>=6 or a>=6)", - "Result": null, - "Plan": [ - "TableReader 1846.30 root partition:dual data:Selection", - "└─Selection 1846.30 cop[tikv] le(test_partition.t1.a, 1), or(ge(test_partition.t1.b, 6), ge(test_partition.t1.a, 6))", - " └─TableFullScan 10000.00 cop[tikv] table:t1 keep order:false, stats:pseudo" - ], - "IndexPlan": [ - "IndexReader 1846.30 root partition:dual index:Selection", - "└─Selection 1846.30 cop[tikv] or(ge(test_partition_1.t1.b, 6), ge(test_partition_1.t1.a, 6))", - " └─IndexRangeScan 3323.33 cop[tikv] table:t1, index:a(a, b, id) range:[-inf,1], keep order:false, stats:pseudo" - ] - }, - { - "SQL": "select * from t1 where a = 100 and (b<=200 or a<=200)", - "Result": null, - "Plan": [ - "TableReader 10.00 root partition:dual data:Selection", - "└─Selection 10.00 cop[tikv] eq(test_partition.t1.a, 100), or(le(test_partition.t1.b, 200), 1)", - " └─TableFullScan 10000.00 cop[tikv] table:t1 keep order:false, stats:pseudo" - ], - "IndexPlan": [ - "IndexReader 100.00 root partition:dual index:IndexRangeScan", - "└─IndexRangeScan 100.00 cop[tikv] table:t1, index:a(a, b, id) range:[100 NULL,100 +inf], keep order:false, stats:pseudo" - ] - }, - { - "SQL": "select * from t1 where a <= 5 or (a+b=3)", - "Result": [ - "1 1 1", - "2 2 2", - "3 3 3", - "4 4 4", - "5 5 5" - ], - "Plan": [ - "TableReader 8664.67 root partition:all data:Selection", - "└─Selection 8664.67 cop[tikv] or(le(test_partition.t1.a, 5), eq(plus(test_partition.t1.a, test_partition.t1.b), 3))", - " └─TableFullScan 10000.00 cop[tikv] table:t1 keep order:false, stats:pseudo" - ], - "IndexPlan": [ - "IndexReader 8664.67 root partition:all index:Selection", - "└─Selection 8664.67 cop[tikv] or(le(test_partition_1.t1.a, 5), eq(plus(test_partition_1.t1.a, test_partition_1.t1.b), 3))", - " └─IndexFullScan 10000.00 cop[tikv] table:t1, index:a(a, b, id) keep order:false, stats:pseudo" - ] - }, - { - "SQL": "select * from t1 where id <= 1 or id<=2", - "Result": [ - "1 1 1", - "2 2 2" - ], - "Plan": [ - "TableReader 3323.33 root partition:all data:Selection", - "└─Selection 3323.33 cop[tikv] or(le(test_partition.t1.id, 1), le(test_partition.t1.id, 2))", - " └─TableFullScan 10000.00 cop[tikv] table:t1 keep order:false, stats:pseudo" - ], - "IndexPlan": [ - "IndexReader 3323.33 root partition:all index:Selection", - "└─Selection 3323.33 cop[tikv] or(le(test_partition_1.t1.id, 1), le(test_partition_1.t1.id, 2))", - " └─IndexFullScan 10000.00 cop[tikv] table:t1, index:a(a, b, id) keep order:false, stats:pseudo" - ] - }, - { - "SQL": "select * from t1 where id <= 1 and a<=1", - "Result": [ - "1 1 1" - ], - "Plan": [ - "TableReader 1104.45 root partition:p0 data:Selection", - "└─Selection 1104.45 cop[tikv] le(test_partition.t1.a, 1), le(test_partition.t1.id, 1)", - " └─TableFullScan 10000.00 cop[tikv] table:t1 keep order:false, stats:pseudo" - ], - "IndexPlan": [ - "IndexReader 1104.45 root partition:p0 index:Selection", - "└─Selection 1104.45 cop[tikv] le(test_partition_1.t1.id, 1)", - " └─IndexRangeScan 3323.33 cop[tikv] table:t1, index:a(a, b, id) range:[-inf,1], keep order:false, stats:pseudo" - ] - }, - { - "SQL": "select * from t1 partition(p1) where a <= 1 or b <= 2", - "Result": null, - "Plan": [ - "TableReader 5542.21 root partition:dual data:Selection", - "└─Selection 5542.21 cop[tikv] or(le(test_partition.t1.a, 1), le(test_partition.t1.b, 2))", - " └─TableFullScan 10000.00 cop[tikv] table:t1 keep order:false, stats:pseudo" - ], - "IndexPlan": [ - "IndexReader 5542.21 root partition:dual index:Selection", - "└─Selection 5542.21 cop[tikv] or(le(test_partition_1.t1.a, 1), le(test_partition_1.t1.b, 2))", - " └─IndexFullScan 10000.00 cop[tikv] table:t1, index:a(a, b, id) keep order:false, stats:pseudo" - ] - }, - { - "SQL": "select * from t1 join t2 on t1.id = t2.id where (t1.a<=1 or t1.a <= 3) and (t2.a <= 6 and t2.b <= 6)", - "Result": [ - "1 1 1 1 1 1", - "2 2 2 2 2 2", - "3 3 3 3 3 3" - ], - "Plan": [ - "Projection 1379.19 root test_partition.t1.id, test_partition.t1.a, test_partition.t1.b, test_partition.t2.id, test_partition.t2.a, test_partition.t2.b", - "└─HashJoin 1379.19 root inner join, equal:[eq(test_partition.t2.id, test_partition.t1.id)]", - " ├─TableReader(Build) 1103.35 root partition:p0,p1 data:Selection", - " │ └─Selection 1103.35 cop[tikv] le(test_partition.t2.a, 6), le(test_partition.t2.b, 6), not(isnull(test_partition.t2.id))", - " │ └─TableFullScan 10000.00 cop[tikv] table:t2 keep order:false, stats:pseudo", - " └─TableReader(Probe) 3320.01 root partition:p0 data:Selection", - " └─Selection 3320.01 cop[tikv] not(isnull(test_partition.t1.id)), or(le(test_partition.t1.a, 1), le(test_partition.t1.a, 3))", - " └─TableFullScan 10000.00 cop[tikv] table:t1 keep order:false, stats:pseudo" - ], - "IndexPlan": [ - "Projection 1379.19 root test_partition_1.t1.id, test_partition_1.t1.a, test_partition_1.t1.b, test_partition_1.t2.id, test_partition_1.t2.a, test_partition_1.t2.b", - "└─HashJoin 1379.19 root inner join, equal:[eq(test_partition_1.t2.id, test_partition_1.t1.id)]", - " ├─IndexReader(Build) 1103.35 root partition:p0,p1 index:Selection", - " │ └─Selection 1103.35 cop[tikv] le(test_partition_1.t2.b, 6), not(isnull(test_partition_1.t2.id))", - " │ └─IndexRangeScan 3323.33 cop[tikv] table:t2, index:a(a, b, id) range:[-inf,6], keep order:false, stats:pseudo", - " └─IndexReader(Probe) 3320.01 root partition:p0 index:Selection", - " └─Selection 3320.01 cop[tikv] not(isnull(test_partition_1.t1.id))", - " └─IndexRangeScan 3323.33 cop[tikv] table:t1, index:a(a, b, id) range:[-inf,3], keep order:false, stats:pseudo" - ] - }, - { - "SQL": "select * from t1 join t1 as t2 on t1.id = t2.id where (t1.a<=1 or t1.a <= 3) and (t2.a <= 6 and t2.b <= 6)", - "Result": [ - "1 1 1 1 1 1", - "2 2 2 2 2 2", - "3 3 3 3 3 3" - ], - "Plan": [ - "Projection 1379.19 root test_partition.t1.id, test_partition.t1.a, test_partition.t1.b, test_partition.t1.id, test_partition.t1.a, test_partition.t1.b", - "└─HashJoin 1379.19 root inner join, equal:[eq(test_partition.t1.id, test_partition.t1.id)]", - " ├─TableReader(Build) 1103.35 root partition:p0,p1 data:Selection", - " │ └─Selection 1103.35 cop[tikv] le(test_partition.t1.a, 6), le(test_partition.t1.b, 6), not(isnull(test_partition.t1.id))", - " │ └─TableFullScan 10000.00 cop[tikv] table:t2 keep order:false, stats:pseudo", - " └─TableReader(Probe) 3320.01 root partition:p0 data:Selection", - " └─Selection 3320.01 cop[tikv] not(isnull(test_partition.t1.id)), or(le(test_partition.t1.a, 1), le(test_partition.t1.a, 3))", - " └─TableFullScan 10000.00 cop[tikv] table:t1 keep order:false, stats:pseudo" - ], - "IndexPlan": [ - "Projection 1379.19 root test_partition_1.t1.id, test_partition_1.t1.a, test_partition_1.t1.b, test_partition_1.t1.id, test_partition_1.t1.a, test_partition_1.t1.b", - "└─HashJoin 1379.19 root inner join, equal:[eq(test_partition_1.t1.id, test_partition_1.t1.id)]", - " ├─IndexReader(Build) 1103.35 root partition:p0,p1 index:Selection", - " │ └─Selection 1103.35 cop[tikv] le(test_partition_1.t1.b, 6), not(isnull(test_partition_1.t1.id))", - " │ └─IndexRangeScan 3323.33 cop[tikv] table:t2, index:a(a, b, id) range:[-inf,6], keep order:false, stats:pseudo", - " └─IndexReader(Probe) 3320.01 root partition:p0 index:Selection", - " └─Selection 3320.01 cop[tikv] not(isnull(test_partition_1.t1.id))", - " └─IndexRangeScan 3323.33 cop[tikv] table:t1, index:a(a, b, id) range:[-inf,3], keep order:false, stats:pseudo" - ] - }, - { - "SQL": "select * from t1 where t1.a in (select b from t2 where a BETWEEN 1 AND 2) order by a", - "Result": [ - "1 1 1", - "2 2 2" - ], - "Plan": [ - "Sort 249.75 root test_partition.t1.a", - "└─HashJoin 249.75 root inner join, equal:[eq(test_partition.t2.b, test_partition.t1.a)]", - " ├─HashAgg(Build) 199.80 root group by:test_partition.t2.b, funcs:firstrow(test_partition.t2.b)->test_partition.t2.b", - " │ └─TableReader 199.80 root partition:p0 data:HashAgg", - " │ └─HashAgg 199.80 cop[tikv] group by:test_partition.t2.b, ", - " │ └─Selection 249.75 cop[tikv] ge(test_partition.t2.a, 1), le(test_partition.t2.a, 2), not(isnull(test_partition.t2.b))", - " │ └─TableFullScan 10000.00 cop[tikv] table:t2 keep order:false, stats:pseudo", - " └─TableReader(Probe) 9990.00 root partition:p0,p1 data:Selection", - " └─Selection 9990.00 cop[tikv] not(isnull(test_partition.t1.a))", - " └─TableFullScan 10000.00 cop[tikv] table:t1 keep order:false, stats:pseudo" - ], - "IndexPlan": [ - "Sort 249.75 root test_partition_1.t1.a", - "└─IndexJoin 249.75 root inner join, inner:IndexReader, outer key:test_partition_1.t2.b, inner key:test_partition_1.t1.a, equal cond:eq(test_partition_1.t2.b, test_partition_1.t1.a)", - " ├─HashAgg(Build) 199.80 root group by:test_partition_1.t2.b, funcs:firstrow(test_partition_1.t2.b)->test_partition_1.t2.b", - " │ └─IndexReader 199.80 root partition:p0 index:HashAgg", - " │ └─HashAgg 199.80 cop[tikv] group by:test_partition_1.t2.b, ", - " │ └─Selection 249.75 cop[tikv] not(isnull(test_partition_1.t2.b))", - " │ └─IndexRangeScan 250.00 cop[tikv] table:t2, index:a(a, b, id) range:[1,2], keep order:false, stats:pseudo", - " └─IndexReader(Probe) 1.25 root partition:p0,p1 index:Selection", - " └─Selection 1.25 cop[tikv] not(isnull(test_partition_1.t1.a))", - " └─IndexRangeScan 1.25 cop[tikv] table:t1, index:a(a, b, id) range: decided by [eq(test_partition_1.t1.a, test_partition_1.t2.b)], keep order:false, stats:pseudo" - ] - }, - { - "SQL": "select * from t1 where t1.a in (select b from t1 where a BETWEEN 1 AND 2) order by a", - "Result": [ - "1 1 1", - "2 2 2" - ], - "Plan": [ - "Sort 249.75 root test_partition.t1.a", - "└─HashJoin 249.75 root inner join, equal:[eq(test_partition.t1.b, test_partition.t1.a)]", - " ├─HashAgg(Build) 199.80 root group by:test_partition.t1.b, funcs:firstrow(test_partition.t1.b)->test_partition.t1.b", - " │ └─TableReader 199.80 root partition:p0 data:HashAgg", - " │ └─HashAgg 199.80 cop[tikv] group by:test_partition.t1.b, ", - " │ └─Selection 249.75 cop[tikv] ge(test_partition.t1.a, 1), le(test_partition.t1.a, 2), not(isnull(test_partition.t1.b))", - " │ └─TableFullScan 10000.00 cop[tikv] table:t1 keep order:false, stats:pseudo", - " └─TableReader(Probe) 9990.00 root partition:p0,p1 data:Selection", - " └─Selection 9990.00 cop[tikv] not(isnull(test_partition.t1.a))", - " └─TableFullScan 10000.00 cop[tikv] table:t1 keep order:false, stats:pseudo" - ], - "IndexPlan": [ - "Sort 249.75 root test_partition_1.t1.a", - "└─IndexJoin 249.75 root inner join, inner:IndexReader, outer key:test_partition_1.t1.b, inner key:test_partition_1.t1.a, equal cond:eq(test_partition_1.t1.b, test_partition_1.t1.a)", - " ├─HashAgg(Build) 199.80 root group by:test_partition_1.t1.b, funcs:firstrow(test_partition_1.t1.b)->test_partition_1.t1.b", - " │ └─IndexReader 199.80 root partition:p0 index:HashAgg", - " │ └─HashAgg 199.80 cop[tikv] group by:test_partition_1.t1.b, ", - " │ └─Selection 249.75 cop[tikv] not(isnull(test_partition_1.t1.b))", - " │ └─IndexRangeScan 250.00 cop[tikv] table:t1, index:a(a, b, id) range:[1,2], keep order:false, stats:pseudo", - " └─IndexReader(Probe) 1.25 root partition:p0,p1 index:Selection", - " └─Selection 1.25 cop[tikv] not(isnull(test_partition_1.t1.a))", - " └─IndexRangeScan 1.25 cop[tikv] table:t1, index:a(a, b, id) range: decided by [eq(test_partition_1.t1.a, test_partition_1.t1.b)], keep order:false, stats:pseudo" - ] - }, - { - "SQL": "select * from t1 left join t2 on t1.id = t2.id where (t1.a<=1 or t1.a <= 3) and t2.a BETWEEN 6 AND 8", - "Result": null, - "Plan": [ - "Projection 312.19 root test_partition.t1.id, test_partition.t1.a, test_partition.t1.b, test_partition.t2.id, test_partition.t2.a, test_partition.t2.b", - "└─HashJoin 312.19 root inner join, equal:[eq(test_partition.t2.id, test_partition.t1.id)]", - " ├─TableReader(Build) 249.75 root partition:p1 data:Selection", - " │ └─Selection 249.75 cop[tikv] ge(test_partition.t2.a, 6), le(test_partition.t2.a, 8), not(isnull(test_partition.t2.id))", - " │ └─TableFullScan 10000.00 cop[tikv] table:t2 keep order:false, stats:pseudo", - " └─TableReader(Probe) 3320.01 root partition:p0 data:Selection", - " └─Selection 3320.01 cop[tikv] not(isnull(test_partition.t1.id)), or(le(test_partition.t1.a, 1), le(test_partition.t1.a, 3))", - " └─TableFullScan 10000.00 cop[tikv] table:t1 keep order:false, stats:pseudo" - ], - "IndexPlan": [ - "Projection 312.19 root test_partition_1.t1.id, test_partition_1.t1.a, test_partition_1.t1.b, test_partition_1.t2.id, test_partition_1.t2.a, test_partition_1.t2.b", - "└─HashJoin 312.19 root inner join, equal:[eq(test_partition_1.t2.id, test_partition_1.t1.id)]", - " ├─IndexReader(Build) 249.75 root partition:p1 index:Selection", - " │ └─Selection 249.75 cop[tikv] not(isnull(test_partition_1.t2.id))", - " │ └─IndexRangeScan 250.00 cop[tikv] table:t2, index:a(a, b, id) range:[6,8], keep order:false, stats:pseudo", - " └─IndexReader(Probe) 3320.01 root partition:p0 index:Selection", - " └─Selection 3320.01 cop[tikv] not(isnull(test_partition_1.t1.id))", - " └─IndexRangeScan 3323.33 cop[tikv] table:t1, index:a(a, b, id) range:[-inf,3], keep order:false, stats:pseudo" - ] - }, - { - "SQL": "select * from t1 right join t2 on t1.id = t2.id where (t1.a<=1 or t1.a <= 3) and t2.a BETWEEN 1 AND 3", - "Result": [ - "1 1 1 1 1 1", - "2 2 2 2 2 2", - "3 3 3 3 3 3" - ], - "Plan": [ - "Projection 312.19 root test_partition.t1.id, test_partition.t1.a, test_partition.t1.b, test_partition.t2.id, test_partition.t2.a, test_partition.t2.b", - "└─HashJoin 312.19 root inner join, equal:[eq(test_partition.t2.id, test_partition.t1.id)]", - " ├─TableReader(Build) 249.75 root partition:p0 data:Selection", - " │ └─Selection 249.75 cop[tikv] ge(test_partition.t2.a, 1), le(test_partition.t2.a, 3), not(isnull(test_partition.t2.id))", - " │ └─TableFullScan 10000.00 cop[tikv] table:t2 keep order:false, stats:pseudo", - " └─TableReader(Probe) 3320.01 root partition:p0 data:Selection", - " └─Selection 3320.01 cop[tikv] not(isnull(test_partition.t1.id)), or(le(test_partition.t1.a, 1), le(test_partition.t1.a, 3))", - " └─TableFullScan 10000.00 cop[tikv] table:t1 keep order:false, stats:pseudo" - ], - "IndexPlan": [ - "Projection 312.19 root test_partition_1.t1.id, test_partition_1.t1.a, test_partition_1.t1.b, test_partition_1.t2.id, test_partition_1.t2.a, test_partition_1.t2.b", - "└─HashJoin 312.19 root inner join, equal:[eq(test_partition_1.t2.id, test_partition_1.t1.id)]", - " ├─IndexReader(Build) 249.75 root partition:p0 index:Selection", - " │ └─Selection 249.75 cop[tikv] not(isnull(test_partition_1.t2.id))", - " │ └─IndexRangeScan 250.00 cop[tikv] table:t2, index:a(a, b, id) range:[1,3], keep order:false, stats:pseudo", - " └─IndexReader(Probe) 3320.01 root partition:p0 index:Selection", - " └─Selection 3320.01 cop[tikv] not(isnull(test_partition_1.t1.id))", - " └─IndexRangeScan 3323.33 cop[tikv] table:t1, index:a(a, b, id) range:[-inf,3], keep order:false, stats:pseudo" - ] - }, - { - "SQL": "select * from t1 join t2 on true where t1.a=5 and t2.a BETWEEN 6 AND 8 and t2.b >= 6", - "Result": [ - "5 5 5 6 6 6", - "5 5 5 7 7 7", - "5 5 5 8 8 8" - ], - "Plan": [ - "HashJoin 2000.00 root CARTESIAN inner join", - "├─TableReader(Build) 10.00 root partition:p0 data:Selection", - "│ └─Selection 10.00 cop[tikv] 1, eq(test_partition.t1.a, 5)", - "│ └─TableFullScan 10000.00 cop[tikv] table:t1 keep order:false, stats:pseudo", - "└─TableReader(Probe) 200.00 root partition:p1 data:Selection", - " └─Selection 200.00 cop[tikv] 1, ge(test_partition.t2.a, 6), ge(test_partition.t2.b, 6), le(test_partition.t2.a, 8)", - " └─TableFullScan 10000.00 cop[tikv] table:t2 keep order:false, stats:pseudo" - ], - "IndexPlan": [ - "HashJoin 20000.00 root CARTESIAN inner join", - "├─IndexReader(Build) 100.00 root partition:p0 index:IndexRangeScan", - "│ └─IndexRangeScan 100.00 cop[tikv] table:t1, index:a(a, b, id) range:[5 NULL,5 +inf], keep order:false, stats:pseudo", - "└─IndexReader(Probe) 200.00 root partition:p1 index:Selection", - " └─Selection 200.00 cop[tikv] ge(test_partition_1.t2.b, 6)", - " └─IndexRangeScan 250.00 cop[tikv] table:t2, index:a(a, b, id) range:[6,8], keep order:false, stats:pseudo" - ] - }, - { - "SQL": "select count(*) from t1 join t2 on t1.b = t2.b where t1.a BETWEEN 1 AND 2 and t2.a BETWEEN 1 AND 6 and t1.b BETWEEN 1 AND 6", - "Result": [ - "2" - ], - "Plan": [ - "StreamAgg 1.00 root funcs:count(1)->Column#9", - "└─HashJoin 7.81 root inner join, equal:[eq(test_partition.t1.b, test_partition.t2.b)]", - " ├─TableReader(Build) 6.25 root partition:p0,p1 data:Selection", - " │ └─Selection 6.25 cop[tikv] ge(test_partition.t2.a, 1), ge(test_partition.t2.b, 1), le(test_partition.t2.a, 6), le(test_partition.t2.b, 6), not(isnull(test_partition.t2.b))", - " │ └─TableFullScan 10000.00 cop[tikv] table:t2 keep order:false, stats:pseudo", - " └─TableReader(Probe) 6.25 root partition:p0 data:Selection", - " └─Selection 6.25 cop[tikv] ge(test_partition.t1.a, 1), ge(test_partition.t1.b, 1), le(test_partition.t1.a, 2), le(test_partition.t1.b, 6), not(isnull(test_partition.t1.b))", - " └─TableFullScan 10000.00 cop[tikv] table:t1 keep order:false, stats:pseudo" - ], - "IndexPlan": [ - "StreamAgg 1.00 root funcs:count(1)->Column#9", - "└─HashJoin 7.81 root inner join, equal:[eq(test_partition_1.t1.b, test_partition_1.t2.b)]", - " ├─IndexReader(Build) 6.25 root partition:p0,p1 index:Selection", - " │ └─Selection 6.25 cop[tikv] ge(test_partition_1.t2.b, 1), le(test_partition_1.t2.b, 6), not(isnull(test_partition_1.t2.b))", - " │ └─IndexRangeScan 250.00 cop[tikv] table:t2, index:a(a, b, id) range:[1,6], keep order:false, stats:pseudo", - " └─IndexReader(Probe) 6.25 root partition:p0 index:Selection", - " └─Selection 6.25 cop[tikv] ge(test_partition_1.t1.b, 1), le(test_partition_1.t1.b, 6), not(isnull(test_partition_1.t1.b))", - " └─IndexRangeScan 250.00 cop[tikv] table:t1, index:a(a, b, id) range:[1,2], keep order:false, stats:pseudo" - ] - }, - { - "SQL": "select /*+ INL_JOIN(t2,t1) */ count(*) from t2 join t1 on t2.b = t1.b where t2.a BETWEEN 1 AND 2 and t1.a BETWEEN 1 AND 6 and t1.b BETWEEN 1 AND 6", - "Result": [ - "2" - ], - "Plan": [ - "StreamAgg 1.00 root funcs:count(1)->Column#9", - "└─HashJoin 7.81 root inner join, equal:[eq(test_partition.t2.b, test_partition.t1.b)]", - " ├─TableReader(Build) 6.25 root partition:p0,p1 data:Selection", - " │ └─Selection 6.25 cop[tikv] ge(test_partition.t1.a, 1), ge(test_partition.t1.b, 1), le(test_partition.t1.a, 6), le(test_partition.t1.b, 6), not(isnull(test_partition.t1.b))", - " │ └─TableFullScan 10000.00 cop[tikv] table:t1 keep order:false, stats:pseudo", - " └─TableReader(Probe) 6.25 root partition:p0 data:Selection", - " └─Selection 6.25 cop[tikv] ge(test_partition.t2.a, 1), ge(test_partition.t2.b, 1), le(test_partition.t2.a, 2), le(test_partition.t2.b, 6), not(isnull(test_partition.t2.b))", - " └─TableFullScan 10000.00 cop[tikv] table:t2 keep order:false, stats:pseudo" - ], - "IndexPlan": [ - "StreamAgg 1.00 root funcs:count(1)->Column#9", - "└─HashJoin 7.81 root inner join, equal:[eq(test_partition_1.t2.b, test_partition_1.t1.b)]", - " ├─IndexReader(Build) 6.25 root partition:p0,p1 index:Selection", - " │ └─Selection 6.25 cop[tikv] ge(test_partition_1.t1.b, 1), le(test_partition_1.t1.b, 6), not(isnull(test_partition_1.t1.b))", - " │ └─IndexRangeScan 250.00 cop[tikv] table:t1, index:a(a, b, id) range:[1,6], keep order:false, stats:pseudo", - " └─IndexReader(Probe) 6.25 root partition:p0 index:Selection", - " └─Selection 6.25 cop[tikv] ge(test_partition_1.t2.b, 1), le(test_partition_1.t2.b, 6), not(isnull(test_partition_1.t2.b))", - " └─IndexRangeScan 250.00 cop[tikv] table:t2, index:a(a, b, id) range:[1,2], keep order:false, stats:pseudo" - ] - } - ] - }, - { - "Name": "TestRangePartitionPredicatePruner", - "Cases": [ - { - "SQL": "explain format = 'brief' select * from t where a = 1", - "Result": [ - "TableReader 10000.00 root data:TableFullScan", - "└─TableFullScan 10000.00 cop[tikv] table:t, partition:p1 keep order:false, stats:pseudo" - ] - }, - { - "SQL": "explain format = 'brief' select * from t where a = 2", - "Result": [ - "TableReader 10000.00 root data:TableFullScan", - "└─TableFullScan 10000.00 cop[tikv] table:t, partition:p2 keep order:false, stats:pseudo" - ] - }, - { - "SQL": "explain format = 'brief' select * from t where a = 10", - "Result": [ - "TableReader 10.00 root data:Selection", - "└─Selection 10.00 cop[tikv] eq(test_partition.t.a, 10)", - " └─TableFullScan 10000.00 cop[tikv] table:t, partition:p_max keep order:false, stats:pseudo" - ] - }, - { - "SQL": "explain format = 'brief' select * from t where a = -1", - "Result": [ - "TableReader 10.00 root data:Selection", - "└─Selection 10.00 cop[tikv] eq(test_partition.t.a, -1)", - " └─TableFullScan 10000.00 cop[tikv] table:t, partition:p0 keep order:false, stats:pseudo" - ] - }, - { - "SQL": "explain format = 'brief' select * from t where a is NULL", - "Result": [ - "TableReader 10.00 root data:Selection", - "└─Selection 10.00 cop[tikv] isnull(test_partition.t.a)", - " └─TableFullScan 10000.00 cop[tikv] table:t, partition:p0 keep order:false, stats:pseudo" - ] - }, - { - "SQL": "explain format = 'brief' select * from t where a = 1.5", - "Result": [ - "PartitionUnion 32000.00 root ", - "├─TableReader 8000.00 root data:Selection", - "│ └─Selection 8000.00 cop[tikv] eq(cast(test_partition.t.a, decimal(20,0) BINARY), 1.5)", - "│ └─TableFullScan 10000.00 cop[tikv] table:t, partition:p0 keep order:false, stats:pseudo", - "├─TableReader 8000.00 root data:Selection", - "│ └─Selection 8000.00 cop[tikv] eq(cast(test_partition.t.a, decimal(20,0) BINARY), 1.5)", - "│ └─TableFullScan 10000.00 cop[tikv] table:t, partition:p1 keep order:false, stats:pseudo", - "├─TableReader 8000.00 root data:Selection", - "│ └─Selection 8000.00 cop[tikv] eq(cast(test_partition.t.a, decimal(20,0) BINARY), 1.5)", - "│ └─TableFullScan 10000.00 cop[tikv] table:t, partition:p2 keep order:false, stats:pseudo", - "└─TableReader 8000.00 root data:Selection", - " └─Selection 8000.00 cop[tikv] eq(cast(test_partition.t.a, decimal(20,0) BINARY), 1.5)", - " └─TableFullScan 10000.00 cop[tikv] table:t, partition:p_max keep order:false, stats:pseudo" - ] - }, - { - "SQL": "explain format = 'brief' select * from t where a in (2)", - "Result": [ - "TableReader 10000.00 root data:TableFullScan", - "└─TableFullScan 10000.00 cop[tikv] table:t, partition:p2 keep order:false, stats:pseudo" - ] ->>>>>>> 0859a3c02... planner: refactor Converting Partition Keys for shuffle hash join (#24456) } ] }