Files
tidb/expression/testdata/partition_pruner_out.json
2020-03-10 20:38:02 +08:00

83 lines
2.9 KiB
JSON

[
{
"Name": "TestHashPartitionPruner",
"Cases": [
{
"SQL": "explain select * from t1 where id = 7 and a = 6",
"Result": [
"Selection_7 0.00 root eq(test_partition.t1.a, 6)",
"└─Point_Get_6 1.00 root table:t1, handle:7, partition:p7"
]
},
{
"SQL": "explain select * from t3 where id = 9 and a = 1",
"Result": [
"Point_Get_1 1.00 root table:t3, index:id a, partition:p9"
]
},
{
"SQL": "explain select * from t2 where id = 9 and a = -110",
"Result": [
"Point_Get_6 1.00 root table:t2, index:id a, partition:p1"
]
},
{
"SQL": "explain select * from t1 where id = -17",
"Result": [
"Point_Get_6 1.00 root table:t1, handle:-17, partition:p7"
]
},
{
"SQL": "explain select * from t2 where id = a and a = b and b = 2",
"Result": [
"TableReader_8 8.00 root data:Selection_7",
"└─Selection_7 8.00 cop[tikv] eq(test_partition.t2.a, test_partition.t2.b), eq(test_partition.t2.b, 2), eq(test_partition.t2.id, test_partition.t2.a)",
" └─TableFullScan_6 10000.00 cop[tikv] table:t2, partition:p4, keep order:false, stats:pseudo"
]
},
{
"SQL": "explain select * from t1 join t2 on (t1.id = t2.id) where t1.id = 5 and t2.a = 7",
"Result": [
"HashLeftJoin_10 1.00 root CARTESIAN inner join",
"├─Point_Get_13(Build) 1.00 root table:t2, index:id a, partition:p2",
"└─Point_Get_12(Probe) 1.00 root table:t1, handle:5, partition:p5"
]
},
{
"SQL": "explain select * from t1 left join t2 on t1.id = 1 and t2.a = 2 where t2.id = 7",
"Result": [
"HashLeftJoin_9 1.00 root CARTESIAN inner join",
"├─Point_Get_12(Build) 1.00 root table:t2, index:id a, partition:p9",
"└─Point_Get_11(Probe) 1.00 root table:t1, handle:1, partition:p1"
]
},
{
"SQL": "explain select * from t2 join t1 on t1.id = t2.id and t2.a = t1.id and t2.id = 12",
"Result": [
"HashLeftJoin_9 1.00 root CARTESIAN inner join",
"├─Point_Get_12(Build) 1.00 root table:t1, handle:12, partition:p2",
"└─Point_Get_11(Probe) 1.00 root table:t2, index:id a, partition:p4"
]
},
{
"SQL": "explain select * from t1 left join t2 on true where t1.a = 1 and false",
"Result": [
"TableDual_8 0.00 root rows:0"
]
},
{
"SQL": "explain select * from t1 left join t2 on true where t1.a = 1 and null",
"Result": [
"TableDual_8 0.00 root rows:0"
]
},
{
"SQL": "explain select * from t1 left join t2 on true where t1.a = null",
"Result": [
"TableDual_8 0.00 root rows:0"
]
}
]
}
]