62 lines
2.3 KiB
JSON
62 lines
2.3 KiB
JSON
[
|
|
{
|
|
"name": "TestPushLimitDownIndexLookUpReader",
|
|
"cases": [
|
|
// Limit should be pushed down into IndexLookUpReader, row count of IndexLookUpReader and TableScan should be 1.00.
|
|
"explain select * from tbl use index(idx_b_c) where b > 1 limit 2,1",
|
|
// Projection atop IndexLookUpReader, Limit should be pushed down into IndexLookUpReader, and Projection should have row count 1.00 as well.
|
|
"explain select * from tbl use index(idx_b_c) where b > 1 order by b desc limit 2,1",
|
|
// Limit should be pushed down into IndexLookUpReader when Selection on top of IndexScan.
|
|
"explain select * from tbl use index(idx_b_c) where b > 1 and c > 1 limit 2,1",
|
|
// Limit should NOT be pushed down into IndexLookUpReader when Selection on top of TableScan.
|
|
"explain select * from tbl use index(idx_b_c) where b > 1 and a > 1 limit 2,1"
|
|
]
|
|
},
|
|
{
|
|
"name": "TestIsFromUnixtimeNullRejective",
|
|
"cases": [
|
|
// fix #12385
|
|
"explain select * from t t1 left join t t2 on t1.a=t2.a where from_unixtime(t2.b);"
|
|
]
|
|
},
|
|
{
|
|
"name": "TestSimplifyOuterJoinWithCast",
|
|
"cases": [
|
|
// LeftOuterJoin should no be simplified to InnerJoin.
|
|
"explain select * from t t1 left join t t2 on t1.a = t2.a where cast(t1.b as date) >= '2019-01-01'"
|
|
]
|
|
},
|
|
{
|
|
"name": "TestMaxMinEliminate",
|
|
"cases": [
|
|
"explain (select max(a) from t) union (select min(a) from t)"
|
|
]
|
|
},
|
|
{
|
|
"name": "TestIndexJoinUniqueCompositeIndex",
|
|
"cases": [
|
|
// Row count of IndexScan should be 2.
|
|
"explain select /*+ TIDB_INLJ(t2) */ * from t1 join t2 on t1.a = t2.a and t1.c = t2.c",
|
|
// Row count of IndexScan should be 2.
|
|
"explain select /*+ TIDB_INLJ(t2) */ * from t1 join t2 on t1.a = t2.a and t1.c <= t2.b",
|
|
// Row count of IndexScan should be 1.
|
|
"explain select /*+ TIDB_INLJ(t2) */ * from t1 join t2 on t1.a = t2.a and t2.b = 1"
|
|
]
|
|
},
|
|
{
|
|
"name": "TestPartitionTableStats",
|
|
"cases": [
|
|
"explain select * from t order by a",
|
|
"select * from t order by a",
|
|
"explain select * from t order by a limit 3",
|
|
"select * from t order by a limit 3"
|
|
]
|
|
},
|
|
{
|
|
"name": "TestIndexMerge",
|
|
"cases": [
|
|
"explain select /*+ USE_INDEX_MERGE(t, a, b) */ * from t where a = 1 or b = 2"
|
|
]
|
|
}
|
|
]
|