diff --git a/pkg/planner/cardinality/BUILD.bazel b/pkg/planner/cardinality/BUILD.bazel index 911368cf9135a..e6f38c7722172 100644 --- a/pkg/planner/cardinality/BUILD.bazel +++ b/pkg/planner/cardinality/BUILD.bazel @@ -25,7 +25,11 @@ go_library( "//pkg/planner/property", "//pkg/planner/util", "//pkg/planner/util/debugtrace", +<<<<<<< HEAD "//pkg/sessionctx", +======= + "//pkg/planner/util/fixcontrol", +>>>>>>> f2c278ddc6b (Planner: Do not allow cardinality to go below 1 (#55242)) "//pkg/sessionctx/stmtctx", "//pkg/statistics", "//pkg/tablecodec", diff --git a/pkg/planner/cardinality/row_count_column.go b/pkg/planner/cardinality/row_count_column.go index 6b771a59f4f14..4805b0a6ac3a1 100644 --- a/pkg/planner/cardinality/row_count_column.go +++ b/pkg/planner/cardinality/row_count_column.go @@ -17,7 +17,11 @@ package cardinality import ( "github.com/pingcap/errors" "github.com/pingcap/tidb/pkg/planner/util/debugtrace" +<<<<<<< HEAD "github.com/pingcap/tidb/pkg/sessionctx" +======= + "github.com/pingcap/tidb/pkg/planner/util/fixcontrol" +>>>>>>> f2c278ddc6b (Planner: Do not allow cardinality to go below 1 (#55242)) "github.com/pingcap/tidb/pkg/statistics" "github.com/pingcap/tidb/pkg/types" "github.com/pingcap/tidb/pkg/util/codec" @@ -308,7 +312,17 @@ func GetColumnRowCount(sctx sessionctx.Context, c *statistics.Column, ranges []* } rowCount += cnt } - rowCount = mathutil.Clamp(rowCount, 0, float64(realtimeRowCount)) + allowZeroEst := fixcontrol.GetBoolWithDefault( + sctx.GetSessionVars().GetOptimizerFixControlMap(), + fixcontrol.Fix47400, + false, + ) + if allowZeroEst { + rowCount = mathutil.Clamp(rowCount, 0, float64(realtimeRowCount)) + } else { + // Don't allow the final result to go below 1 row + rowCount = mathutil.Clamp(rowCount, 1, float64(realtimeRowCount)) + } return rowCount, nil } diff --git a/pkg/planner/cardinality/row_count_index.go b/pkg/planner/cardinality/row_count_index.go index 74e185d789c11..5c8db45e14044 100644 --- a/pkg/planner/cardinality/row_count_index.go +++ b/pkg/planner/cardinality/row_count_index.go @@ -24,7 +24,11 @@ import ( "github.com/pingcap/failpoint" "github.com/pingcap/tidb/pkg/kv" "github.com/pingcap/tidb/pkg/planner/util/debugtrace" +<<<<<<< HEAD "github.com/pingcap/tidb/pkg/sessionctx" +======= + "github.com/pingcap/tidb/pkg/planner/util/fixcontrol" +>>>>>>> f2c278ddc6b (Planner: Do not allow cardinality to go below 1 (#55242)) "github.com/pingcap/tidb/pkg/sessionctx/stmtctx" "github.com/pingcap/tidb/pkg/statistics" "github.com/pingcap/tidb/pkg/types" @@ -344,7 +348,17 @@ func getIndexRowCountForStatsV2(sctx sessionctx.Context, idx *statistics.Index, } totalCount += count } - totalCount = mathutil.Clamp(totalCount, 0, float64(realtimeRowCount)) + allowZeroEst := fixcontrol.GetBoolWithDefault( + sctx.GetSessionVars().GetOptimizerFixControlMap(), + fixcontrol.Fix47400, + false, + ) + if allowZeroEst { + totalCount = mathutil.Clamp(totalCount, 0, float64(realtimeRowCount)) + } else { + // Don't allow the final result to go below 1 row + totalCount = mathutil.Clamp(totalCount, 1, float64(realtimeRowCount)) + } return totalCount, nil } diff --git a/pkg/planner/cardinality/selectivity_test.go b/pkg/planner/cardinality/selectivity_test.go index a241e38cbd2a3..ecd7ac58b1b88 100644 --- a/pkg/planner/cardinality/selectivity_test.go +++ b/pkg/planner/cardinality/selectivity_test.go @@ -234,7 +234,7 @@ func TestEstimationForUnknownValues(t *testing.T) { colID := table.Meta().Columns[0].ID count, err := cardinality.GetRowCountByColumnRanges(sctx, &statsTbl.HistColl, colID, getRange(30, 30)) require.NoError(t, err) - require.Equal(t, 0.2, count) + require.Equal(t, 1.0, count) count, err = cardinality.GetRowCountByColumnRanges(sctx, &statsTbl.HistColl, colID, getRange(9, 30)) require.NoError(t, err) @@ -263,7 +263,7 @@ func TestEstimationForUnknownValues(t *testing.T) { colID = table.Meta().Columns[0].ID count, err = cardinality.GetRowCountByColumnRanges(sctx, &statsTbl.HistColl, colID, getRange(1, 30)) require.NoError(t, err) - require.Equal(t, 0.0, count) + require.Equal(t, 1.0, count) testKit.MustExec("drop table t") testKit.MustExec("create table t(a int, b int, index idx(b))") @@ -276,7 +276,7 @@ func TestEstimationForUnknownValues(t *testing.T) { colID = table.Meta().Columns[0].ID count, err = cardinality.GetRowCountByColumnRanges(sctx, &statsTbl.HistColl, colID, getRange(2, 2)) require.NoError(t, err) - require.Equal(t, 0.0, count) + require.Equal(t, 1.0, count) idxID = table.Meta().Indices[0].ID count, err = cardinality.GetRowCountByIndexRanges(sctx, &statsTbl.HistColl, idxID, getRange(2, 2)) @@ -400,8 +400,8 @@ func TestSelectivity(t *testing.T) { }, { exprs: "a >= 1 and b > 1 and a < 2", - selectivity: 0.01783264746, - selectivityAfterIncrease: 0.01851851852, + selectivity: 0.017832647462277088, + selectivityAfterIncrease: 0.018518518518518517, }, { exprs: "a >= 1 and c > 1 and a < 2", @@ -420,13 +420,13 @@ func TestSelectivity(t *testing.T) { }, { exprs: "b > 1", - selectivity: 0.96296296296, + selectivity: 0.9629629629629629, selectivityAfterIncrease: 1, }, { exprs: "a > 1 and b < 2 and c > 3 and d < 4 and e > 5", - selectivity: 0, - selectivityAfterIncrease: 0, + selectivity: 5.870830440255832e-05, + selectivityAfterIncrease: 1.51329827770157e-05, }, { exprs: longExpr, @@ -1098,8 +1098,8 @@ func TestCrossValidationSelectivity(t *testing.T) { require.NoError(t, h.DumpStatsDeltaToKV(true)) tk.MustExec("analyze table t") tk.MustQuery("explain format = 'brief' select * from t where a = 1 and b > 0 and b < 1000 and c > 1000").Check(testkit.Rows( - "TableReader 0.00 root data:Selection", - "└─Selection 0.00 cop[tikv] gt(test.t.c, 1000)", + "TableReader 1.00 root data:Selection", + "└─Selection 1.00 cop[tikv] gt(test.t.c, 1000)", " └─TableRangeScan 2.00 cop[tikv] table:t range:(1 0,1 1000), keep order:false")) } diff --git a/pkg/planner/cardinality/testdata/cardinality_suite_out.json b/pkg/planner/cardinality/testdata/cardinality_suite_out.json index 7360396d69701..ebfe63b44e30a 100644 --- a/pkg/planner/cardinality/testdata/cardinality_suite_out.json +++ b/pkg/planner/cardinality/testdata/cardinality_suite_out.json @@ -24,7 +24,11 @@ { "Start": 800, "End": 900, +<<<<<<< HEAD "Count": 752.004166655054 +======= + "Count": 791.004166655054 +>>>>>>> f2c278ddc6b (Planner: Do not allow cardinality to go below 1 (#55242)) }, { "Start": 900, @@ -79,7 +83,11 @@ { "Start": 800, "End": 1000, +<<<<<<< HEAD "Count": 1201.196869573942 +======= + "Count": 1249.196869573942 +>>>>>>> f2c278ddc6b (Planner: Do not allow cardinality to go below 1 (#55242)) }, { "Start": 900, @@ -104,7 +112,11 @@ { "Start": 200, "End": 400, +<<<<<<< HEAD "Count": 1211.5288209899081 +======= + "Count": 1188.7788209899081 +>>>>>>> f2c278ddc6b (Planner: Do not allow cardinality to go below 1 (#55242)) }, { "Start": 200, @@ -2403,7 +2415,7 @@ }, { "Name": "a", - "Result": 0 + "Result": 1 } ] }, @@ -2684,7 +2696,7 @@ }, { "End estimate range": { - "RowCount": 0, + "RowCount": 1, "Type": "Range" } } @@ -2692,7 +2704,7 @@ }, { "Name": "iab", - "Result": 0 + "Result": 1 } ] }, @@ -3244,11 +3256,11 @@ "Expressions": [ "lt(test.t.a, -1500)" ], - "Selectivity": 0, + "Selectivity": 0.0003246753246753247, "partial cover": false }, { - "Result": 0 + "Result": 2.1082813290605499e-7 } ] } @@ -3677,7 +3689,7 @@ }, { "Name": "iab", - "Result": 0 + "Result": 1 } ] }, @@ -3804,11 +3816,11 @@ "Expressions": [ "lt(test.t.a, -1500)" ], - "Selectivity": 0, + "Selectivity": 0.0003246753246753247, "partial cover": false }, { - "Result": 0 + "Result": 1.9066503965832828e-7 } ] } diff --git a/pkg/planner/core/casetest/cbotest/testdata/analyze_suite_out.json b/pkg/planner/core/casetest/cbotest/testdata/analyze_suite_out.json index d7f636836f6e5..df2ab196747d7 100644 --- a/pkg/planner/core/casetest/cbotest/testdata/analyze_suite_out.json +++ b/pkg/planner/core/casetest/cbotest/testdata/analyze_suite_out.json @@ -364,13 +364,13 @@ "└─TableRowIDScan(Probe) 2.00 cop[tikv] table:t keep order:false" ], [ - "TableReader 0.00 root data:Selection", - "└─Selection 0.00 cop[tikv] eq(test.t.b, 1)", + "TableReader 1.00 root data:Selection", + "└─Selection 1.00 cop[tikv] eq(test.t.b, 1)", " └─TableFullScan 2.00 cop[tikv] table:t keep order:false" ], [ - "TableReader 0.00 root data:Selection", - "└─Selection 0.00 cop[tikv] lt(test.t.b, 1)", + "TableReader 1.00 root data:Selection", + "└─Selection 1.00 cop[tikv] lt(test.t.b, 1)", " └─TableFullScan 2.00 cop[tikv] table:t keep order:false" ] ] diff --git a/pkg/planner/core/casetest/partition/testdata/integration_partition_suite_out.json b/pkg/planner/core/casetest/partition/testdata/integration_partition_suite_out.json index 8ae2b35395618..923d21ddd8da5 100644 --- a/pkg/planner/core/casetest/partition/testdata/integration_partition_suite_out.json +++ b/pkg/planner/core/casetest/partition/testdata/integration_partition_suite_out.json @@ -709,7 +709,7 @@ "└─IndexRangeScan 1.00 cop[tikv] table:t, index:b(b) range:[1,1], keep order:false" ], "StaticPlan": [ - "PartitionUnion 1.00 root ", + "PartitionUnion 3.00 root ", "├─IndexReader 1.00 root index:IndexRangeScan", "│ └─IndexRangeScan 1.00 cop[tikv] table:t, partition:P0, index:b(b) range:[1,1], keep order:false", "├─IndexReader 1.00 root index:IndexRangeScan", @@ -725,7 +725,7 @@ "└─IndexRangeScan 1.00 cop[tikv] table:t, index:b(b) range:[2,2], keep order:false" ], "StaticPlan": [ - "PartitionUnion 1.00 root ", + "PartitionUnion 3.00 root ", "├─IndexReader 1.00 root index:IndexRangeScan", "│ └─IndexRangeScan 1.00 cop[tikv] table:t, partition:P0, index:b(b) range:[2,2], keep order:false", "├─IndexReader 1.00 root index:IndexRangeScan", @@ -741,7 +741,7 @@ "└─IndexRangeScan 2.00 cop[tikv] table:t, index:b(b) range:[1,2], keep order:false" ], "StaticPlan": [ - "PartitionUnion 2.00 root ", + "PartitionUnion 3.00 root ", "├─IndexReader 1.00 root index:IndexRangeScan", "│ └─IndexRangeScan 1.00 cop[tikv] table:t, partition:P0, index:b(b) range:[1,2], keep order:false", "├─IndexReader 1.00 root index:IndexRangeScan", @@ -757,7 +757,7 @@ "└─IndexRangeScan 2.00 cop[tikv] table:t, index:b(b) range:[2,2], [3,3], [4,4], keep order:false" ], "StaticPlan": [ - "PartitionUnion 2.00 root ", + "PartitionUnion 3.00 root ", "├─IndexReader 1.00 root index:IndexRangeScan", "│ └─IndexRangeScan 1.00 cop[tikv] table:t, partition:P0, index:b(b) range:[2,2], [3,3], [4,4], keep order:false", "├─IndexReader 1.00 root index:IndexRangeScan", @@ -773,7 +773,7 @@ "└─IndexRangeScan 2.00 cop[tikv] table:t, index:b(b) range:[2,2], [3,3], keep order:false" ], "StaticPlan": [ - "PartitionUnion 2.00 root ", + "PartitionUnion 3.00 root ", "├─IndexReader 1.00 root index:IndexRangeScan", "│ └─IndexRangeScan 1.00 cop[tikv] table:t, partition:P0, index:b(b) range:[2,2], [3,3], keep order:false", "├─IndexReader 1.00 root index:IndexRangeScan", @@ -854,7 +854,7 @@ "└─IndexRangeScan 1.00 cop[tikv] table:t, index:b(b) range:[1,1], keep order:false" ], "StaticPlan": [ - "PartitionUnion 1.00 root ", + "PartitionUnion 2.00 root ", "├─IndexReader 1.00 root index:IndexRangeScan", "│ └─IndexRangeScan 1.00 cop[tikv] table:t, partition:P0, index:b(b) range:[1,1], keep order:false", "└─IndexReader 1.00 root index:IndexRangeScan", diff --git a/pkg/planner/core/casetest/planstats/testdata/plan_stats_suite_out.json b/pkg/planner/core/casetest/planstats/testdata/plan_stats_suite_out.json index 544d8c6c885e5..569e730b6639d 100644 --- a/pkg/planner/core/casetest/planstats/testdata/plan_stats_suite_out.json +++ b/pkg/planner/core/casetest/planstats/testdata/plan_stats_suite_out.json @@ -116,11 +116,19 @@ { "Query": "explain format = brief select * from t join tp where tp.a = 10 and t.b = tp.c", "Result": [ +<<<<<<< HEAD "Projection 0.00 root test.t.a, test.t.b, test.t.c, test.tp.a, test.tp.b, test.tp.c", "└─HashJoin 0.00 root inner join, equal:[eq(test.tp.c, test.t.b)]", " ├─TableReader(Build) 0.00 root partition:p1 data:Selection", " │ └─Selection 0.00 cop[tikv] eq(test.tp.a, 10), not(isnull(test.tp.c))", " │ └─TableFullScan 6.00 cop[tikv] table:tp keep order:false, stats:partial[ic:allEvicted, c:allEvicted]", +======= + "Projection 1.00 root test.t.a, test.t.b, test.t.c, test.tp.a, test.tp.b, test.tp.c", + "└─HashJoin 1.00 root inner join, equal:[eq(test.tp.c, test.t.b)]", + " ├─TableReader(Build) 1.00 root partition:p1 data:Selection", + " │ └─Selection 1.00 cop[tikv] eq(test.tp.a, 10), not(isnull(test.tp.c))", + " │ └─TableFullScan 6.00 cop[tikv] table:tp keep order:false, stats:partial[c:allEvicted]", +>>>>>>> f2c278ddc6b (Planner: Do not allow cardinality to go below 1 (#55242)) " └─TableReader(Probe) 3.00 root data:Selection", " └─Selection 3.00 cop[tikv] not(isnull(test.t.b))", " └─TableFullScan 3.00 cop[tikv] table:t keep order:false, stats:partial[idx:allEvicted, a:allEvicted, b:allEvicted]" diff --git a/pkg/planner/core/casetest/testdata/integration_suite_out.json b/pkg/planner/core/casetest/testdata/integration_suite_out.json index b4661050d3523..1e71722a51910 100644 --- a/pkg/planner/core/casetest/testdata/integration_suite_out.json +++ b/pkg/planner/core/casetest/testdata/integration_suite_out.json @@ -286,25 +286,25 @@ "SQL": "explain format = 'verbose' select count(*) from t3 where b = 0", "Plan": [ "StreamAgg_10 1.00 64.98 root funcs:count(1)->Column#4", - "└─IndexReader_15 0.00 15.08 root index:IndexRangeScan_14", - " └─IndexRangeScan_14 0.00 162.80 cop[tikv] table:t3, index:c(b) range:[0,0], keep order:false" + "└─IndexReader_15 1.00 15.08 root index:IndexRangeScan_14", + " └─IndexRangeScan_14 1.00 162.80 cop[tikv] table:t3, index:c(b) range:[0,0], keep order:false" ] }, { "SQL": "explain format = 'verbose' select /*+ use_index(t3, c) */ count(a) from t3 where b = 0", "Plan": [ "StreamAgg_10 1.00 2001.63 root funcs:count(test.t3.a)->Column#4", - "└─IndexLookUp_17 0.00 1951.73 root ", - " ├─IndexRangeScan_15(Build) 0.00 203.50 cop[tikv] table:t3, index:c(b) range:[0,0], keep order:false", - " └─TableRowIDScan_16(Probe) 0.00 227.31 cop[tikv] table:t3 keep order:false" + "└─IndexLookUp_17 1.00 1951.73 root ", + " ├─IndexRangeScan_15(Build) 1.00 203.50 cop[tikv] table:t3, index:c(b) range:[0,0], keep order:false", + " └─TableRowIDScan_16(Probe) 1.00 227.31 cop[tikv] table:t3 keep order:false" ] }, { "SQL": "explain format = 'verbose' select count(*) from t2 where a = 0", "Plan": [ "StreamAgg_12 1.00 109.57 root funcs:count(1)->Column#4", - "└─TableReader_20 0.00 59.67 root data:Selection_19", - " └─Selection_19 0.00 831.62 cop[tikv] eq(test.t2.a, 0)", + "└─TableReader_20 1.00 59.67 root data:Selection_19", + " └─Selection_19 1.00 831.62 cop[tikv] eq(test.t2.a, 0)", " └─TableFullScan_18 3.00 681.92 cop[tikv] table:t2 keep order:false" ] }, diff --git a/pkg/planner/core/testdata/index_merge_suite_out.json b/pkg/planner/core/testdata/index_merge_suite_out.json index cfa13020f7c1a..f03e52ed29c2a 100644 --- a/pkg/planner/core/testdata/index_merge_suite_out.json +++ b/pkg/planner/core/testdata/index_merge_suite_out.json @@ -252,7 +252,7 @@ { "SQL": "select * from vh", "Plan": [ - "PartitionUnion 0.50 root ", + "PartitionUnion 1.50 root ", "├─IndexMerge 0.50 root type: intersection", "│ ├─IndexRangeScan(Build) 2.00 cop[tikv] table:t1, partition:p0, index:ia(a) range:[10,10], keep order:false", "│ ├─IndexRangeScan(Build) 1.00 cop[tikv] table:t1, partition:p0, index:ibc(b, c) range:[20 -inf,20 30), keep order:false", @@ -276,7 +276,7 @@ { "SQL": "select /*+ qb_name(v, v), use_index_merge(@v t1, ia, ibc, id) */ * from v", "Plan": [ - "PartitionUnion 0.50 root ", + "PartitionUnion 1.50 root ", "├─IndexMerge 0.50 root type: intersection", "│ ├─IndexRangeScan(Build) 2.00 cop[tikv] table:t1, partition:p0, index:ia(a) range:[10,10], keep order:false", "│ ├─IndexRangeScan(Build) 1.00 cop[tikv] table:t1, partition:p0, index:ibc(b, c) range:[20 -inf,20 30), keep order:false", @@ -300,7 +300,7 @@ { "SQL": "select /*+ qb_name(v, v@sel_1), use_index_merge(@v t1, ia, ibc, id) */ * from v", "Plan": [ - "PartitionUnion 0.50 root ", + "PartitionUnion 1.50 root ", "├─IndexMerge 0.50 root type: intersection", "│ ├─IndexRangeScan(Build) 2.00 cop[tikv] table:t1, partition:p0, index:ia(a) range:[10,10], keep order:false", "│ ├─IndexRangeScan(Build) 1.00 cop[tikv] table:t1, partition:p0, index:ibc(b, c) range:[20 -inf,20 30), keep order:false", @@ -324,7 +324,7 @@ { "SQL": "select /*+ qb_name(v, v@sel_1 .@sel_1), use_index_merge(@v t1, ia, ibc, id) */ * from v", "Plan": [ - "PartitionUnion 0.50 root ", + "PartitionUnion 1.50 root ", "├─IndexMerge 0.50 root type: intersection", "│ ├─IndexRangeScan(Build) 2.00 cop[tikv] table:t1, partition:p0, index:ia(a) range:[10,10], keep order:false", "│ ├─IndexRangeScan(Build) 1.00 cop[tikv] table:t1, partition:p0, index:ibc(b, c) range:[20 -inf,20 30), keep order:false", @@ -348,7 +348,7 @@ { "SQL": "select /*+ qb_name(v, v@sel_1 .@sel_1), use_index_merge(@v t1, ia, ibc, id) */ * from v", "Plan": [ - "PartitionUnion 0.50 root ", + "PartitionUnion 1.50 root ", "├─IndexMerge 0.50 root type: intersection", "│ ├─IndexRangeScan(Build) 2.00 cop[tikv] table:t1, partition:p0, index:ia(a) range:[10,10], keep order:false", "│ ├─IndexRangeScan(Build) 1.00 cop[tikv] table:t1, partition:p0, index:ibc(b, c) range:[20 -inf,20 30), keep order:false", diff --git a/pkg/planner/core/testdata/runtime_filter_generator_suite_out.json b/pkg/planner/core/testdata/runtime_filter_generator_suite_out.json index 66cdc81b7ef32..2ed605ec09d9e 100644 --- a/pkg/planner/core/testdata/runtime_filter_generator_suite_out.json +++ b/pkg/planner/core/testdata/runtime_filter_generator_suite_out.json @@ -5,14 +5,14 @@ { "SQL": "select /*+ hash_join_build(t1) */ * from t1, t2 where t1.k1=t2.k1 and t2.k2 = 1", "Plan": [ - "TableReader_32 0.00 root MppVersion: 2, data:ExchangeSender_31", - "└─ExchangeSender_31 0.00 mpp[tiflash] ExchangeType: PassThrough", - " └─HashJoin_24 0.00 mpp[tiflash] inner join, equal:[eq(test.t1.k1, test.t2.k1)], runtime filter:0[IN] <- test.t1.k1", + "TableReader_32 1.00 root MppVersion: 2, data:ExchangeSender_31", + "└─ExchangeSender_31 1.00 mpp[tiflash] ExchangeType: PassThrough", + " └─HashJoin_24 1.00 mpp[tiflash] inner join, equal:[eq(test.t1.k1, test.t2.k1)], runtime filter:0[IN] <- test.t1.k1", " ├─ExchangeReceiver_28(Build) 1.00 mpp[tiflash] ", " │ └─ExchangeSender_27 1.00 mpp[tiflash] ExchangeType: Broadcast, Compression: FAST", " │ └─Selection_26 1.00 mpp[tiflash] not(isnull(test.t1.k1))", " │ └─TableFullScan_25 1.00 mpp[tiflash] table:t1 pushed down filter:empty, keep order:false", - " └─Selection_30(Probe) 0.00 mpp[tiflash] eq(test.t2.k2, 1), not(isnull(test.t2.k1))", + " └─Selection_30(Probe) 1.00 mpp[tiflash] eq(test.t2.k2, 1), not(isnull(test.t2.k1))", " └─TableFullScan_29 1.00 mpp[tiflash] table:t2 pushed down filter:empty, keep order:false, runtime filter:0[IN] -> test.t2.k1" ] }, diff --git a/pkg/planner/util/fixcontrol/get.go b/pkg/planner/util/fixcontrol/get.go index 122d3aa833917..daf7288985f4a 100644 --- a/pkg/planner/util/fixcontrol/get.go +++ b/pkg/planner/util/fixcontrol/get.go @@ -11,6 +11,9 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +// +// NOTE: For assigning new fix control numbers - use the issue number associated with the fix. +// package fixcontrol @@ -36,6 +39,19 @@ const ( Fix45132 uint64 = 45132 // Fix46177 controls whether to explore enforced plans for DataSource if it has already found an unenforced plan. Fix46177 uint64 = 46177 +<<<<<<< HEAD +======= + // Fix47400 controls whether to allow a rowEst below 1 + Fix47400 uint64 = 47400 + // Fix49736 controls whether to force the optimizer to use plan cache even if there is risky optimization. + // This fix-control is test-only. + Fix49736 uint64 = 49736 + // Fix52869 controls whether to disable the limitation that index merge path won't be generated automatically when + // there exist other single-index access paths that do range scan. + Fix52869 uint64 = 52869 + // Fix54337 controls whether to apply or not range intersection for index access. + Fix54337 uint64 = 54337 +>>>>>>> f2c278ddc6b (Planner: Do not allow cardinality to go below 1 (#55242)) ) // GetStr fetches the given key from the fix control map as a string type. diff --git a/pkg/statistics/handle/globalstats/globalstats_test.go b/pkg/statistics/handle/globalstats/globalstats_test.go index d22f5cd287474..78e7adbbd01ef 100644 --- a/pkg/statistics/handle/globalstats/globalstats_test.go +++ b/pkg/statistics/handle/globalstats/globalstats_test.go @@ -787,9 +787,9 @@ func TestGlobalStats(t *testing.T) { // Even if we have global-stats, we will not use it when the switch is set to `static`. tk.MustExec("set @@tidb_partition_prune_mode = 'static';") tk.MustQuery("explain format = 'brief' select a from t where a > 5").Check(testkit.Rows( - "PartitionUnion 4.00 root ", - "├─IndexReader 0.00 root index:IndexRangeScan", - "│ └─IndexRangeScan 0.00 cop[tikv] table:t, partition:p0, index:a(a) range:(5,+inf], keep order:false", + "PartitionUnion 5.00 root ", + "├─IndexReader 1.00 root index:IndexRangeScan", + "│ └─IndexRangeScan 1.00 cop[tikv] table:t, partition:p0, index:a(a) range:(5,+inf], keep order:false", "├─IndexReader 2.00 root index:IndexRangeScan", "│ └─IndexRangeScan 2.00 cop[tikv] table:t, partition:p1, index:a(a) range:(5,+inf], keep order:false", "└─IndexReader 2.00 root index:IndexRangeScan", diff --git a/pkg/statistics/handle/handletest/handle_test.go b/pkg/statistics/handle/handletest/handle_test.go index 50c3d3f630bb4..2b7aea32104ae 100644 --- a/pkg/statistics/handle/handletest/handle_test.go +++ b/pkg/statistics/handle/handletest/handle_test.go @@ -95,7 +95,7 @@ func TestColumnIDs(t *testing.T) { // At that time, we should get c2's stats instead of c1's. count, err = cardinality.GetRowCountByColumnRanges(sctx, &statsTbl.HistColl, tableInfo.Columns[0].ID, []*ranger.Range{ran}) require.NoError(t, err) - require.Equal(t, 0.0, count) + require.Equal(t, 1.0, count) } func TestDurationToTS(t *testing.T) { diff --git a/pkg/statistics/statistics_test.go b/pkg/statistics/statistics_test.go index d126d5922e8dc..0da1aa64a86c2 100644 --- a/pkg/statistics/statistics_test.go +++ b/pkg/statistics/statistics_test.go @@ -450,7 +450,7 @@ func SubTestIndexRanges() func(*testing.T) { ran[0].HighVal[0] = types.NewIntDatum(1000) count, err = GetRowCountByIndexRanges(ctx, &tbl.HistColl, 0, ran) require.NoError(t, err) - require.Equal(t, 0, int(count)) + require.Equal(t, 1, int(count)) } } diff --git a/pkg/statistics/testdata/integration_suite_out.json b/pkg/statistics/testdata/integration_suite_out.json index e2706b96dd588..14cdc66e90ce0 100644 --- a/pkg/statistics/testdata/integration_suite_out.json +++ b/pkg/statistics/testdata/integration_suite_out.json @@ -26,8 +26,8 @@ "└─IndexRangeScan_5 1.36 cop[tikv] table:exp_backoff, index:idx(a, b, c, d) range:[1 1 1 3,1 1 1 5], keep order:false" ], [ - "IndexReader_6 0.00 root index:IndexRangeScan_5", - "└─IndexRangeScan_5 0.00 cop[tikv] table:exp_backoff, index:idx(a, b, c, d) range:[1 1 1 3,1 1 1 5], keep order:false" + "IndexReader_6 1.00 root index:IndexRangeScan_5", + "└─IndexRangeScan_5 1.00 cop[tikv] table:exp_backoff, index:idx(a, b, c, d) range:[1 1 1 3,1 1 1 5], keep order:false" ] ] }, diff --git a/pkg/table/tables/test/partition/partition_test.go b/pkg/table/tables/test/partition/partition_test.go index b2083a0418ae7..a4d68c0293bec 100644 --- a/pkg/table/tables/test/partition/partition_test.go +++ b/pkg/table/tables/test/partition/partition_test.go @@ -3058,6 +3058,132 @@ func TestPointGetKeyPartitioning(t *testing.T) { tk.MustQuery(`SELECT * FROM t WHERE b = 'Ab'`).Check(testkit.Rows("Aa Ab Ac")) } +<<<<<<< HEAD +======= +func TestExplainPartition(t *testing.T) { + store := testkit.CreateMockStore(t) + tk := testkit.NewTestKit(t, store) + tk.MustExec(`use test`) + tk.MustExec(`CREATE TABLE t (a int, b int) PARTITION BY hash(a) PARTITIONS 3`) + tk.MustExec(`INSERT INTO t VALUES (1,1),(2,2),(3,3),(4,4),(5,5),(6,6)`) + tk.MustExec(`analyze table t all columns`) + tk.MustExec(`set tidb_partition_prune_mode = 'static'`) + tk.MustQuery(`EXPLAIN FORMAT = 'brief' SELECT * FROM t WHERE a = 3`).Check(testkit.Rows(""+ + `TableReader 1.00 root data:Selection`, + `└─Selection 1.00 cop[tikv] eq(test.t.a, 3)`, + ` └─TableFullScan 2.00 cop[tikv] table:t, partition:p0 keep order:false`)) + tk.MustExec(`set tidb_partition_prune_mode = 'dynamic'`) + tk.MustQuery(`EXPLAIN FORMAT = 'brief' SELECT * FROM t WHERE a = 3`).Check(testkit.Rows(""+ + `TableReader 1.00 root partition:p0 data:Selection`, + `└─Selection 1.00 cop[tikv] eq(test.t.a, 3)`, + ` └─TableFullScan 6.00 cop[tikv] table:t keep order:false`)) + tk.MustExec(`drop table t`) + + tk.MustExec(`CREATE TABLE t (a int unsigned primary key, b int) PARTITION BY hash(a) PARTITIONS 3`) + tk.MustExec(`INSERT INTO t VALUES (1,1),(2,2),(3,3),(4,4),(5,5),(6,6)`) + tk.MustExec(`analyze table t`) + tk.MustQuery(`SELECT * FROM t WHERE a = 3`).Check(testkit.Rows("3 3")) + tk.MustQuery(`EXPLAIN FORMAT = 'brief' SELECT * FROM t WHERE a = 3`).Check(testkit.Rows("Point_Get 1.00 root table:t, partition:p0 handle:3")) +} + +func TestPruningOverflow(t *testing.T) { + store := testkit.CreateMockStore(t) + tk := testkit.NewTestKit(t, store) + tk.MustExec(`use test`) + tk.MustExec("CREATE TABLE t (a int NOT NULL, b bigint NOT NULL,PRIMARY KEY (a,b)) PARTITION BY HASH ((a*b))PARTITIONS 13") + tk.MustExec(`insert into t values(0, 3522101843073676459)`) + tk.MustQuery(`SELECT a, b FROM t WHERE a IN (0,14158354938390,0) AND b IN (3522101843073676459,-2846203247576845955,838395691793635638)`).Check(testkit.Rows("0 3522101843073676459")) +} + +func TestPartitionCoverage(t *testing.T) { + store := testkit.CreateMockStore(t) + tk := testkit.NewTestKit(t, store) + tk.MustExec(`use test`) + tk.MustExec(`set tidb_partition_prune_mode = 'dynamic'`) + tk.MustExec(`create table t (id int, d date, filler varchar(255))`) + tk.MustExec(`insert into t (id, d) values (1, '2024-02-29'), (2,'2024-03-01')`) + tk.MustExec(`alter table t partition by list (YEAR(d)) (partition p0 values in (2024,2025), partition p1 values in (2023))`) + tk.MustQuery(`select id,d from t partition (p0)`).Check(testkit.Rows("1 2024-02-29", "2 2024-03-01")) + tk.MustQuery(`show warnings`).Check(testkit.Rows()) + tk.MustQuery(`select id,d from t partition (p0)`).Check(testkit.Rows("1 2024-02-29", "2 2024-03-01")) + tk.MustQuery(`show warnings`).Check(testkit.Rows()) + tk.MustQuery(`select id,d from t partition (p1)`).Check(testkit.Rows()) + tk.MustQuery(`show warnings`).Check(testkit.Rows()) + tk.MustQuery(`select id,d from t partition (p1)`).Check(testkit.Rows()) + tk.MustQuery(`show warnings`).Check(testkit.Rows()) + tk.MustExec(`update t set filler = 'updated' where id = 1`) + tk.MustQuery(`show warnings`).Check(testkit.Rows()) + tk.MustExec(`drop table t`) + tk.MustExec(`create table t (a int, b int, primary key (a,b)) partition by hash(b) partitions 3`) + tk.MustExec(`insert into t values (1,1),(1,2),(2,1),(2,2),(1,3)`) + tk.MustExec(`analyze table t all columns`) + tk.MustExec(`set tidb_partition_prune_mode = 'static'`) + query := `select * from t where a in (1,2) and b = 1 order by a` + tk.MustQuery(`explain format='brief' ` + query).Check(testkit.Rows("Batch_Point_Get 2.00 root table:t, partition:p1, clustered index:PRIMARY(a, b) keep order:true, desc:false")) + tk.MustQuery(query).Check(testkit.Rows("1 1", "2 1")) + tk.MustExec(`set tidb_partition_prune_mode = 'dynamic'`) + tk.MustQuery(`explain format='brief' ` + query).Check(testkit.Rows(""+ + "TableReader 2.00 root partition:p1 data:TableRangeScan", + "└─TableRangeScan 2.00 cop[tikv] table:t range:[1 1,1 1], [2 1,2 1], keep order:true")) + tk.MustQuery(query).Check(testkit.Rows("1 1", "2 1")) + + query = `select * from t where a = 1 and b in (1,2)` + tk.MustExec(`set tidb_partition_prune_mode = 'static'`) + tk.MustQuery(`explain format='brief' ` + query).Check(testkit.Rows(""+ + "PartitionUnion 2.00 root ", + "├─Batch_Point_Get 2.00 root table:t, partition:p1, clustered index:PRIMARY(a, b) keep order:false, desc:false", + "└─Batch_Point_Get 2.00 root table:t, partition:p2, clustered index:PRIMARY(a, b) keep order:false, desc:false")) + + tk.MustQuery(query).Sort().Check(testkit.Rows("1 1", "1 2")) + tk.MustExec(`set tidb_partition_prune_mode = 'dynamic'`) + tk.MustQuery(`explain format='brief' ` + query).Check(testkit.Rows(""+ + "TableReader 3.00 root partition:p1,p2 data:TableRangeScan", + "└─TableRangeScan 3.00 cop[tikv] table:t range:[1 1,1 1], [1 2,1 2], keep order:false")) + tk.MustQuery(query).Sort().Check(testkit.Rows("1 1", "1 2")) + tk.MustExec(`drop table t`) + + tk.MustExec(`create table t (a int) partition by range (a) (partition p values less than (10))`) + tk.MustExec(`insert into t values (1)`) + tk.MustQuery(`explain format='brief' select * from t where a = 10`).Check(testkit.Rows(""+ + "TableReader 10.00 root partition:dual data:Selection", + "└─Selection 10.00 cop[tikv] eq(test.t.a, 10)", + " └─TableFullScan 10000.00 cop[tikv] table:t keep order:false, stats:pseudo")) + tk.MustExec(`analyze table t all columns`) + tk.MustQuery(`explain format='brief' select * from t where a = 10`).Check(testkit.Rows(""+ + `TableReader 1.00 root partition:dual data:Selection`, + `└─Selection 1.00 cop[tikv] eq(test.t.a, 10)`, + ` └─TableFullScan 1.00 cop[tikv] table:t keep order:false`)) + tk.MustQuery(`select * from t where a = 10`).Check(testkit.Rows()) + + tk.MustExec(`drop table t`) + tk.MustExec(`set @p=1,@q=2,@u=3;`) + tk.MustExec(`create table t(a int, b int, primary key(a)) partition by hash(a) partitions 2`) + tk.MustExec(`insert into t values(1,0),(2,0),(3,0),(4,0)`) + tk.MustQuery(`explain format = 'brief' select * from t where ((a >= 3 and a <= 1) or a = 2) and 1 = 1`).Check(testkit.Rows("Point_Get 1.00 root table:t, partition:p0 handle:2")) + tk.MustQuery(`select * from t where ((a >= 3 and a <= 1) or a = 2) and 1 = 1`).Sort().Check(testkit.Rows("2 0")) + tk.MustExec(`prepare stmt from 'select * from t where ((a >= ? and a <= ?) or a = 2) and 1 = 1'`) + tk.MustQuery(`execute stmt using @p,@p`).Sort().Check(testkit.Rows("1 0", "2 0")) + tk.MustQuery(`execute stmt using @q,@q`).Sort().Check(testkit.Rows("2 0")) + tk.MustQuery(`execute stmt using @p,@u`).Sort().Check(testkit.Rows("1 0", "2 0", "3 0")) + tk.MustQuery(`execute stmt using @u,@p`).Sort().Check(testkit.Rows("2 0")) + + tk.MustExec(`create table t19141 (c_int int, primary key (c_int)) partition by hash ( c_int ) partitions 4`) + tk.MustExec(`insert into t19141 values (1), (2), (3), (4)`) + tk.MustQuery(`explain format = 'brief' select * from t19141 partition (p0)`).Check(testkit.Rows(""+ + "TableReader 10000.00 root partition:p0 data:TableFullScan", + "└─TableFullScan 10000.00 cop[tikv] table:t19141 keep order:false, stats:pseudo")) + tk.MustQuery(`select * from t19141 partition (p0)`).Sort().Check(testkit.Rows("4")) + tk.MustQuery(`select * from t19141 partition (p0) where c_int = 1`).Sort().Check(testkit.Rows()) + tk.MustExec(`update t19141 partition (p0) set c_int = -c_int where c_int = 1`) + tk.MustQuery(`select * from t19141 order by c_int`).Sort().Check(testkit.Rows("1", "2", "3", "4")) + tk.MustQuery(`select * from t19141 partition (p0, p2) where c_int in (1,2,3)`).Sort().Check(testkit.Rows("2")) + tk.MustExec(`update t19141 partition (p1) set c_int = -c_int where c_int in (2,3)`) + tk.MustQuery(`select * from t19141 order by c_int`).Sort().Check(testkit.Rows("1", "2", "3", "4")) + tk.MustExec(`delete from t19141 partition (p0) where c_int in (2,3)`) + tk.MustQuery(`select * from t19141 order by c_int`).Sort().Check(testkit.Rows("1", "2", "3", "4")) +} + +>>>>>>> f2c278ddc6b (Planner: Do not allow cardinality to go below 1 (#55242)) // Issue TiDB #51090. func TestAlterTablePartitionRollback(t *testing.T) { store := testkit.CreateMockStore(t) diff --git a/tests/integrationtest/r/executor/partition/partition_boundaries.result b/tests/integrationtest/r/executor/partition/partition_boundaries.result new file mode 100644 index 0000000000000..5148ee5e34696 --- /dev/null +++ b/tests/integrationtest/r/executor/partition/partition_boundaries.result @@ -0,0 +1,5260 @@ +SET @@tidb_partition_prune_mode = 'dynamic'; +DROP TABLE IF EXISTS t; +CREATE TABLE t +(a INT, b varchar(255)) +PARTITION BY RANGE (a) ( +PARTITION p0 VALUES LESS THAN (1000000), +PARTITION p1 VALUES LESS THAN (2000000), +PARTITION p2 VALUES LESS THAN (3000000)); +INSERT INTO t VALUES (999998, '999998 Filler ...'), (999999, '999999 Filler ...'), (1000000, '1000000 Filler ...'), (1000001, '1000001 Filler ...'), (1000002, '1000002 Filler ...'); +INSERT INTO t VALUES (1999998, '1999998 Filler ...'), (1999999, '1999999 Filler ...'), (2000000, '2000000 Filler ...'), (2000001, '2000001 Filler ...'), (2000002, '2000002 Filler ...'); +INSERT INTO t VALUES (2999998, '2999998 Filler ...'), (2999999, '2999999 Filler ...'); +INSERT INTO t VALUES (-2147483648, 'MIN_INT filler...'), (0, '0 Filler...'); +ANALYZE TABLE t all columns; +explain format='brief' SELECT * FROM t WHERE a = -2147483648; +id estRows task access object operator info +TableReader 1.00 root partition:p0 data:Selection +└─Selection 1.00 cop[tikv] eq(executor__partition__partition_boundaries.t.a, -2147483648) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a = -2147483648; +a b +-2147483648 MIN_INT filler... +explain format='brief' SELECT * FROM t WHERE a IN (-2147483648); +id estRows task access object operator info +TableReader 1.00 root partition:p0 data:Selection +└─Selection 1.00 cop[tikv] eq(executor__partition__partition_boundaries.t.a, -2147483648) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a IN (-2147483648); +a b +-2147483648 MIN_INT filler... +explain format='brief' SELECT * FROM t WHERE a = 0; +id estRows task access object operator info +TableReader 1.00 root partition:p0 data:Selection +└─Selection 1.00 cop[tikv] eq(executor__partition__partition_boundaries.t.a, 0) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a = 0; +a b +0 0 Filler... +explain format='brief' SELECT * FROM t WHERE a IN (0); +id estRows task access object operator info +TableReader 1.00 root partition:p0 data:Selection +└─Selection 1.00 cop[tikv] eq(executor__partition__partition_boundaries.t.a, 0) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a IN (0); +a b +0 0 Filler... +explain format='brief' SELECT * FROM t WHERE a = 999998; +id estRows task access object operator info +TableReader 1.00 root partition:p0 data:Selection +└─Selection 1.00 cop[tikv] eq(executor__partition__partition_boundaries.t.a, 999998) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a = 999998; +a b +999998 999998 Filler ... +explain format='brief' SELECT * FROM t WHERE a IN (999998); +id estRows task access object operator info +TableReader 1.00 root partition:p0 data:Selection +└─Selection 1.00 cop[tikv] eq(executor__partition__partition_boundaries.t.a, 999998) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a IN (999998); +a b +999998 999998 Filler ... +explain format='brief' SELECT * FROM t WHERE a = 999999; +id estRows task access object operator info +TableReader 1.00 root partition:p0 data:Selection +└─Selection 1.00 cop[tikv] eq(executor__partition__partition_boundaries.t.a, 999999) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a = 999999; +a b +999999 999999 Filler ... +explain format='brief' SELECT * FROM t WHERE a IN (999999); +id estRows task access object operator info +TableReader 1.00 root partition:p0 data:Selection +└─Selection 1.00 cop[tikv] eq(executor__partition__partition_boundaries.t.a, 999999) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a IN (999999); +a b +999999 999999 Filler ... +explain format='brief' SELECT * FROM t WHERE a = 1000000; +id estRows task access object operator info +TableReader 1.00 root partition:p1 data:Selection +└─Selection 1.00 cop[tikv] eq(executor__partition__partition_boundaries.t.a, 1000000) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a = 1000000; +a b +1000000 1000000 Filler ... +explain format='brief' SELECT * FROM t WHERE a IN (1000000); +id estRows task access object operator info +TableReader 1.00 root partition:p1 data:Selection +└─Selection 1.00 cop[tikv] eq(executor__partition__partition_boundaries.t.a, 1000000) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a IN (1000000); +a b +1000000 1000000 Filler ... +explain format='brief' SELECT * FROM t WHERE a = 1000001; +id estRows task access object operator info +TableReader 1.00 root partition:p1 data:Selection +└─Selection 1.00 cop[tikv] eq(executor__partition__partition_boundaries.t.a, 1000001) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a = 1000001; +a b +1000001 1000001 Filler ... +explain format='brief' SELECT * FROM t WHERE a IN (1000001); +id estRows task access object operator info +TableReader 1.00 root partition:p1 data:Selection +└─Selection 1.00 cop[tikv] eq(executor__partition__partition_boundaries.t.a, 1000001) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a IN (1000001); +a b +1000001 1000001 Filler ... +explain format='brief' SELECT * FROM t WHERE a = 1000002; +id estRows task access object operator info +TableReader 1.00 root partition:p1 data:Selection +└─Selection 1.00 cop[tikv] eq(executor__partition__partition_boundaries.t.a, 1000002) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a = 1000002; +a b +1000002 1000002 Filler ... +explain format='brief' SELECT * FROM t WHERE a IN (1000002); +id estRows task access object operator info +TableReader 1.00 root partition:p1 data:Selection +└─Selection 1.00 cop[tikv] eq(executor__partition__partition_boundaries.t.a, 1000002) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a IN (1000002); +a b +1000002 1000002 Filler ... +explain format='brief' SELECT * FROM t WHERE a = 3000000; +id estRows task access object operator info +TableReader 1.00 root partition:dual data:Selection +└─Selection 1.00 cop[tikv] eq(executor__partition__partition_boundaries.t.a, 3000000) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a = 3000000; +a b +explain format='brief' SELECT * FROM t WHERE a IN (3000000); +id estRows task access object operator info +TableReader 1.00 root partition:dual data:Selection +└─Selection 1.00 cop[tikv] eq(executor__partition__partition_boundaries.t.a, 3000000) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a IN (3000000); +a b +explain format='brief' SELECT * FROM t WHERE a = 3000001; +id estRows task access object operator info +TableReader 1.00 root partition:dual data:Selection +└─Selection 1.00 cop[tikv] eq(executor__partition__partition_boundaries.t.a, 3000001) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a = 3000001; +a b +explain format='brief' SELECT * FROM t WHERE a IN (3000001); +id estRows task access object operator info +TableReader 1.00 root partition:dual data:Selection +└─Selection 1.00 cop[tikv] eq(executor__partition__partition_boundaries.t.a, 3000001) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a IN (3000001); +a b +explain format='brief' SELECT * FROM t WHERE a IN (-2147483648, -2147483647); +id estRows task access object operator info +TableReader 1.00 root partition:p0 data:Selection +└─Selection 1.00 cop[tikv] in(executor__partition__partition_boundaries.t.a, -2147483648, -2147483647) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a IN (-2147483648, -2147483647); +a b +-2147483648 MIN_INT filler... +explain format='brief' SELECT * FROM t WHERE a IN (-2147483647, -2147483646); +id estRows task access object operator info +TableReader 1.00 root partition:p0 data:Selection +└─Selection 1.00 cop[tikv] in(executor__partition__partition_boundaries.t.a, -2147483647, -2147483646) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a IN (-2147483647, -2147483646); +a b +explain format='brief' SELECT * FROM t WHERE a IN (999997, 999998, 999999); +id estRows task access object operator info +TableReader 2.00 root partition:p0 data:Selection +└─Selection 2.00 cop[tikv] in(executor__partition__partition_boundaries.t.a, 999997, 999998, 999999) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a IN (999997, 999998, 999999); +a b +999998 999998 Filler ... +999999 999999 Filler ... +explain format='brief' SELECT * FROM t WHERE a IN (999998, 999999, 1000000); +id estRows task access object operator info +TableReader 3.00 root partition:p0,p1 data:Selection +└─Selection 3.00 cop[tikv] in(executor__partition__partition_boundaries.t.a, 999998, 999999, 1000000) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a IN (999998, 999999, 1000000); +a b +1000000 1000000 Filler ... +999998 999998 Filler ... +999999 999999 Filler ... +explain format='brief' SELECT * FROM t WHERE a IN (999999, 1000000, 1000001); +id estRows task access object operator info +TableReader 3.00 root partition:p0,p1 data:Selection +└─Selection 3.00 cop[tikv] in(executor__partition__partition_boundaries.t.a, 999999, 1000000, 1000001) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a IN (999999, 1000000, 1000001); +a b +1000000 1000000 Filler ... +1000001 1000001 Filler ... +999999 999999 Filler ... +explain format='brief' SELECT * FROM t WHERE a IN (1000000, 1000001, 1000002); +id estRows task access object operator info +TableReader 3.00 root partition:p1 data:Selection +└─Selection 3.00 cop[tikv] in(executor__partition__partition_boundaries.t.a, 1000000, 1000001, 1000002) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a IN (1000000, 1000001, 1000002); +a b +1000000 1000000 Filler ... +1000001 1000001 Filler ... +1000002 1000002 Filler ... +explain format='brief' SELECT * FROM t WHERE a IN (1999997, 1999998, 1999999); +id estRows task access object operator info +TableReader 2.00 root partition:p1 data:Selection +└─Selection 2.00 cop[tikv] in(executor__partition__partition_boundaries.t.a, 1999997, 1999998, 1999999) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a IN (1999997, 1999998, 1999999); +a b +1999998 1999998 Filler ... +1999999 1999999 Filler ... +explain format='brief' SELECT * FROM t WHERE a IN (1999998, 1999999, 2000000); +id estRows task access object operator info +TableReader 3.00 root partition:p1,p2 data:Selection +└─Selection 3.00 cop[tikv] in(executor__partition__partition_boundaries.t.a, 1999998, 1999999, 2000000) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a IN (1999998, 1999999, 2000000); +a b +1999998 1999998 Filler ... +1999999 1999999 Filler ... +2000000 2000000 Filler ... +explain format='brief' SELECT * FROM t WHERE a IN (1999999, 2000000, 2000001); +id estRows task access object operator info +TableReader 3.00 root partition:p1,p2 data:Selection +└─Selection 3.00 cop[tikv] in(executor__partition__partition_boundaries.t.a, 1999999, 2000000, 2000001) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a IN (1999999, 2000000, 2000001); +a b +1999999 1999999 Filler ... +2000000 2000000 Filler ... +2000001 2000001 Filler ... +explain format='brief' SELECT * FROM t WHERE a IN (2000000, 2000001, 2000002); +id estRows task access object operator info +TableReader 3.00 root partition:p2 data:Selection +└─Selection 3.00 cop[tikv] in(executor__partition__partition_boundaries.t.a, 2000000, 2000001, 2000002) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a IN (2000000, 2000001, 2000002); +a b +2000000 2000000 Filler ... +2000001 2000001 Filler ... +2000002 2000002 Filler ... +explain format='brief' SELECT * FROM t WHERE a IN (2999997, 2999998, 2999999); +id estRows task access object operator info +TableReader 2.00 root partition:p2 data:Selection +└─Selection 2.00 cop[tikv] in(executor__partition__partition_boundaries.t.a, 2999997, 2999998, 2999999) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a IN (2999997, 2999998, 2999999); +a b +2999998 2999998 Filler ... +2999999 2999999 Filler ... +explain format='brief' SELECT * FROM t WHERE a IN (2999998, 2999999, 3000000); +id estRows task access object operator info +TableReader 2.00 root partition:p2 data:Selection +└─Selection 2.00 cop[tikv] in(executor__partition__partition_boundaries.t.a, 2999998, 2999999, 3000000) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a IN (2999998, 2999999, 3000000); +a b +2999998 2999998 Filler ... +2999999 2999999 Filler ... +explain format='brief' SELECT * FROM t WHERE a IN (2999999, 3000000, 3000001); +id estRows task access object operator info +TableReader 1.00 root partition:p2 data:Selection +└─Selection 1.00 cop[tikv] in(executor__partition__partition_boundaries.t.a, 2999999, 3000000, 3000001) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a IN (2999999, 3000000, 3000001); +a b +2999999 2999999 Filler ... +explain format='brief' SELECT * FROM t WHERE a IN (3000000, 3000001, 3000002); +id estRows task access object operator info +TableReader 1.00 root partition:dual data:Selection +└─Selection 1.00 cop[tikv] in(executor__partition__partition_boundaries.t.a, 3000000, 3000001, 3000002) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a IN (3000000, 3000001, 3000002); +a b +SET @@tidb_partition_prune_mode = default; +SET @@tidb_partition_prune_mode = 'dynamic'; +DROP TABLE IF EXISTS t; +CREATE TABLE t +(a INT, b varchar(255)) +PARTITION BY RANGE (a) ( +PARTITION p0 VALUES LESS THAN (1), +PARTITION p1 VALUES LESS THAN (2), +PARTITION p2 VALUES LESS THAN (3), +PARTITION p3 VALUES LESS THAN (4), +PARTITION p4 VALUES LESS THAN (5), +PARTITION p5 VALUES LESS THAN (6), +PARTITION p6 VALUES LESS THAN (7)); +INSERT INTO t VALUES (0, '0 Filler...'); +INSERT INTO t VALUES (1, '1 Filler...'); +INSERT INTO t VALUES (2, '2 Filler...'); +INSERT INTO t VALUES (3, '3 Filler...'); +INSERT INTO t VALUES (4, '4 Filler...'); +INSERT INTO t VALUES (5, '5 Filler...'); +INSERT INTO t VALUES (6, '6 Filler...'); +ANALYZE TABLE t all columns; +explain format='brief' SELECT * FROM t WHERE a != -1; +id estRows task access object operator info +TableReader 7.00 root partition:all data:Selection +└─Selection 7.00 cop[tikv] ne(executor__partition__partition_boundaries.t.a, -1) + └─TableFullScan 7.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a != -1; +a b +0 0 Filler... +1 1 Filler... +2 2 Filler... +3 3 Filler... +4 4 Filler... +5 5 Filler... +6 6 Filler... +explain format='brief' SELECT * FROM t WHERE 1 = 1 AND a != -1; +id estRows task access object operator info +TableReader 7.00 root partition:all data:Selection +└─Selection 7.00 cop[tikv] ne(executor__partition__partition_boundaries.t.a, -1) + └─TableFullScan 7.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE 1 = 1 AND a != -1; +a b +0 0 Filler... +1 1 Filler... +2 2 Filler... +3 3 Filler... +4 4 Filler... +5 5 Filler... +6 6 Filler... +explain format='brief' SELECT * FROM t WHERE a NOT IN (-2, -1); +id estRows task access object operator info +TableReader 7.00 root partition:all data:Selection +└─Selection 7.00 cop[tikv] not(in(executor__partition__partition_boundaries.t.a, -2, -1)) + └─TableFullScan 7.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a NOT IN (-2, -1); +a b +0 0 Filler... +1 1 Filler... +2 2 Filler... +3 3 Filler... +4 4 Filler... +5 5 Filler... +6 6 Filler... +explain format='brief' SELECT * FROM t WHERE 1 = 0 OR a = -1; +id estRows task access object operator info +TableReader 1.00 root partition:p0 data:Selection +└─Selection 1.00 cop[tikv] or(0, eq(executor__partition__partition_boundaries.t.a, -1)) + └─TableFullScan 7.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE 1 = 0 OR a = -1; +a b +explain format='brief' SELECT * FROM t WHERE a != 0; +id estRows task access object operator info +TableReader 6.00 root partition:all data:Selection +└─Selection 6.00 cop[tikv] ne(executor__partition__partition_boundaries.t.a, 0) + └─TableFullScan 7.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a != 0; +a b +1 1 Filler... +2 2 Filler... +3 3 Filler... +4 4 Filler... +5 5 Filler... +6 6 Filler... +explain format='brief' SELECT * FROM t WHERE 1 = 1 AND a != -1 AND a != 0; +id estRows task access object operator info +TableReader 6.00 root partition:all data:Selection +└─Selection 6.00 cop[tikv] ne(executor__partition__partition_boundaries.t.a, -1), ne(executor__partition__partition_boundaries.t.a, 0) + └─TableFullScan 7.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE 1 = 1 AND a != -1 AND a != 0; +a b +1 1 Filler... +2 2 Filler... +3 3 Filler... +4 4 Filler... +5 5 Filler... +6 6 Filler... +explain format='brief' SELECT * FROM t WHERE a NOT IN (-2, -1, 0); +id estRows task access object operator info +TableReader 6.00 root partition:all data:Selection +└─Selection 6.00 cop[tikv] not(in(executor__partition__partition_boundaries.t.a, -2, -1, 0)) + └─TableFullScan 7.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a NOT IN (-2, -1, 0); +a b +1 1 Filler... +2 2 Filler... +3 3 Filler... +4 4 Filler... +5 5 Filler... +6 6 Filler... +explain format='brief' SELECT * FROM t WHERE 1 = 0 OR a = -1 OR a = 0; +id estRows task access object operator info +TableReader 1.00 root partition:p0 data:Selection +└─Selection 1.00 cop[tikv] or(0, or(eq(executor__partition__partition_boundaries.t.a, -1), eq(executor__partition__partition_boundaries.t.a, 0))) + └─TableFullScan 7.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE 1 = 0 OR a = -1 OR a = 0; +a b +0 0 Filler... +explain format='brief' SELECT * FROM t WHERE a != 1; +id estRows task access object operator info +TableReader 6.00 root partition:all data:Selection +└─Selection 6.00 cop[tikv] ne(executor__partition__partition_boundaries.t.a, 1) + └─TableFullScan 7.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a != 1; +a b +0 0 Filler... +2 2 Filler... +3 3 Filler... +4 4 Filler... +5 5 Filler... +6 6 Filler... +explain format='brief' SELECT * FROM t WHERE 1 = 1 AND a != -1 AND a != 0 AND a != 1; +id estRows task access object operator info +TableReader 5.00 root partition:all data:Selection +└─Selection 5.00 cop[tikv] ne(executor__partition__partition_boundaries.t.a, -1), ne(executor__partition__partition_boundaries.t.a, 0), ne(executor__partition__partition_boundaries.t.a, 1) + └─TableFullScan 7.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE 1 = 1 AND a != -1 AND a != 0 AND a != 1; +a b +2 2 Filler... +3 3 Filler... +4 4 Filler... +5 5 Filler... +6 6 Filler... +explain format='brief' SELECT * FROM t WHERE a NOT IN (-2, -1, 0, 1); +id estRows task access object operator info +TableReader 5.00 root partition:all data:Selection +└─Selection 5.00 cop[tikv] not(in(executor__partition__partition_boundaries.t.a, -2, -1, 0, 1)) + └─TableFullScan 7.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a NOT IN (-2, -1, 0, 1); +a b +2 2 Filler... +3 3 Filler... +4 4 Filler... +5 5 Filler... +6 6 Filler... +explain format='brief' SELECT * FROM t WHERE 1 = 0 OR a = -1 OR a = 0 OR a = 1; +id estRows task access object operator info +TableReader 2.00 root partition:p0,p1 data:Selection +└─Selection 2.00 cop[tikv] or(or(0, eq(executor__partition__partition_boundaries.t.a, -1)), or(eq(executor__partition__partition_boundaries.t.a, 0), eq(executor__partition__partition_boundaries.t.a, 1))) + └─TableFullScan 7.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE 1 = 0 OR a = -1 OR a = 0 OR a = 1; +a b +0 0 Filler... +1 1 Filler... +explain format='brief' SELECT * FROM t WHERE a != 2; +id estRows task access object operator info +TableReader 6.00 root partition:all data:Selection +└─Selection 6.00 cop[tikv] ne(executor__partition__partition_boundaries.t.a, 2) + └─TableFullScan 7.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a != 2; +a b +0 0 Filler... +1 1 Filler... +3 3 Filler... +4 4 Filler... +5 5 Filler... +6 6 Filler... +explain format='brief' SELECT * FROM t WHERE 1 = 1 AND a != -1 AND a != 0 AND a != 1 AND a != 2; +id estRows task access object operator info +TableReader 4.00 root partition:all data:Selection +└─Selection 4.00 cop[tikv] ne(executor__partition__partition_boundaries.t.a, -1), ne(executor__partition__partition_boundaries.t.a, 0), ne(executor__partition__partition_boundaries.t.a, 1), ne(executor__partition__partition_boundaries.t.a, 2) + └─TableFullScan 7.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE 1 = 1 AND a != -1 AND a != 0 AND a != 1 AND a != 2; +a b +3 3 Filler... +4 4 Filler... +5 5 Filler... +6 6 Filler... +explain format='brief' SELECT * FROM t WHERE a NOT IN (-2, -1, 0, 1, 2); +id estRows task access object operator info +TableReader 4.00 root partition:all data:Selection +└─Selection 4.00 cop[tikv] not(in(executor__partition__partition_boundaries.t.a, -2, -1, 0, 1, 2)) + └─TableFullScan 7.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a NOT IN (-2, -1, 0, 1, 2); +a b +3 3 Filler... +4 4 Filler... +5 5 Filler... +6 6 Filler... +explain format='brief' SELECT * FROM t WHERE 1 = 0 OR a = -1 OR a = 0 OR a = 1 OR a = 2; +id estRows task access object operator info +TableReader 3.00 root partition:p0,p1,p2 data:Selection +└─Selection 3.00 cop[tikv] or(or(0, eq(executor__partition__partition_boundaries.t.a, -1)), or(eq(executor__partition__partition_boundaries.t.a, 0), or(eq(executor__partition__partition_boundaries.t.a, 1), eq(executor__partition__partition_boundaries.t.a, 2)))) + └─TableFullScan 7.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE 1 = 0 OR a = -1 OR a = 0 OR a = 1 OR a = 2; +a b +0 0 Filler... +1 1 Filler... +2 2 Filler... +explain format='brief' SELECT * FROM t WHERE a != 3; +id estRows task access object operator info +TableReader 6.00 root partition:all data:Selection +└─Selection 6.00 cop[tikv] ne(executor__partition__partition_boundaries.t.a, 3) + └─TableFullScan 7.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a != 3; +a b +0 0 Filler... +1 1 Filler... +2 2 Filler... +4 4 Filler... +5 5 Filler... +6 6 Filler... +explain format='brief' SELECT * FROM t WHERE 1 = 1 AND a != -1 AND a != 0 AND a != 1 AND a != 2 AND a != 3; +id estRows task access object operator info +TableReader 3.00 root partition:all data:Selection +└─Selection 3.00 cop[tikv] ne(executor__partition__partition_boundaries.t.a, -1), ne(executor__partition__partition_boundaries.t.a, 0), ne(executor__partition__partition_boundaries.t.a, 1), ne(executor__partition__partition_boundaries.t.a, 2), ne(executor__partition__partition_boundaries.t.a, 3) + └─TableFullScan 7.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE 1 = 1 AND a != -1 AND a != 0 AND a != 1 AND a != 2 AND a != 3; +a b +4 4 Filler... +5 5 Filler... +6 6 Filler... +explain format='brief' SELECT * FROM t WHERE a NOT IN (-2, -1, 0, 1, 2, 3); +id estRows task access object operator info +TableReader 3.00 root partition:all data:Selection +└─Selection 3.00 cop[tikv] not(in(executor__partition__partition_boundaries.t.a, -2, -1, 0, 1, 2, 3)) + └─TableFullScan 7.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a NOT IN (-2, -1, 0, 1, 2, 3); +a b +4 4 Filler... +5 5 Filler... +6 6 Filler... +explain format='brief' SELECT * FROM t WHERE 1 = 0 OR a = -1 OR a = 0 OR a = 1 OR a = 2 OR a = 3; +id estRows task access object operator info +TableReader 4.00 root partition:p0,p1,p2,p3 data:Selection +└─Selection 4.00 cop[tikv] or(or(0, or(eq(executor__partition__partition_boundaries.t.a, -1), eq(executor__partition__partition_boundaries.t.a, 0))), or(eq(executor__partition__partition_boundaries.t.a, 1), or(eq(executor__partition__partition_boundaries.t.a, 2), eq(executor__partition__partition_boundaries.t.a, 3)))) + └─TableFullScan 7.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE 1 = 0 OR a = -1 OR a = 0 OR a = 1 OR a = 2 OR a = 3; +a b +0 0 Filler... +1 1 Filler... +2 2 Filler... +3 3 Filler... +explain format='brief' SELECT * FROM t WHERE a != 4; +id estRows task access object operator info +TableReader 6.00 root partition:all data:Selection +└─Selection 6.00 cop[tikv] ne(executor__partition__partition_boundaries.t.a, 4) + └─TableFullScan 7.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a != 4; +a b +0 0 Filler... +1 1 Filler... +2 2 Filler... +3 3 Filler... +5 5 Filler... +6 6 Filler... +explain format='brief' SELECT * FROM t WHERE 1 = 1 AND a != -1 AND a != 0 AND a != 1 AND a != 2 AND a != 3 AND a != 4; +id estRows task access object operator info +TableReader 2.00 root partition:all data:Selection +└─Selection 2.00 cop[tikv] ne(executor__partition__partition_boundaries.t.a, -1), ne(executor__partition__partition_boundaries.t.a, 0), ne(executor__partition__partition_boundaries.t.a, 1), ne(executor__partition__partition_boundaries.t.a, 2), ne(executor__partition__partition_boundaries.t.a, 3), ne(executor__partition__partition_boundaries.t.a, 4) + └─TableFullScan 7.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE 1 = 1 AND a != -1 AND a != 0 AND a != 1 AND a != 2 AND a != 3 AND a != 4; +a b +5 5 Filler... +6 6 Filler... +explain format='brief' SELECT * FROM t WHERE a NOT IN (-2, -1, 0, 1, 2, 3, 4); +id estRows task access object operator info +TableReader 2.00 root partition:all data:Selection +└─Selection 2.00 cop[tikv] not(in(executor__partition__partition_boundaries.t.a, -2, -1, 0, 1, 2, 3, 4)) + └─TableFullScan 7.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a NOT IN (-2, -1, 0, 1, 2, 3, 4); +a b +5 5 Filler... +6 6 Filler... +explain format='brief' SELECT * FROM t WHERE 1 = 0 OR a = -1 OR a = 0 OR a = 1 OR a = 2 OR a = 3 OR a = 4; +id estRows task access object operator info +TableReader 5.00 root partition:p0,p1,p2,p3,p4 data:Selection +└─Selection 5.00 cop[tikv] or(or(0, or(eq(executor__partition__partition_boundaries.t.a, -1), eq(executor__partition__partition_boundaries.t.a, 0))), or(or(eq(executor__partition__partition_boundaries.t.a, 1), eq(executor__partition__partition_boundaries.t.a, 2)), or(eq(executor__partition__partition_boundaries.t.a, 3), eq(executor__partition__partition_boundaries.t.a, 4)))) + └─TableFullScan 7.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE 1 = 0 OR a = -1 OR a = 0 OR a = 1 OR a = 2 OR a = 3 OR a = 4; +a b +0 0 Filler... +1 1 Filler... +2 2 Filler... +3 3 Filler... +4 4 Filler... +explain format='brief' SELECT * FROM t WHERE a != 5; +id estRows task access object operator info +TableReader 6.00 root partition:all data:Selection +└─Selection 6.00 cop[tikv] ne(executor__partition__partition_boundaries.t.a, 5) + └─TableFullScan 7.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a != 5; +a b +0 0 Filler... +1 1 Filler... +2 2 Filler... +3 3 Filler... +4 4 Filler... +6 6 Filler... +explain format='brief' SELECT * FROM t WHERE 1 = 1 AND a != -1 AND a != 0 AND a != 1 AND a != 2 AND a != 3 AND a != 4 AND a != 5; +id estRows task access object operator info +TableReader 1.00 root partition:all data:Selection +└─Selection 1.00 cop[tikv] ne(executor__partition__partition_boundaries.t.a, -1), ne(executor__partition__partition_boundaries.t.a, 0), ne(executor__partition__partition_boundaries.t.a, 1), ne(executor__partition__partition_boundaries.t.a, 2), ne(executor__partition__partition_boundaries.t.a, 3), ne(executor__partition__partition_boundaries.t.a, 4), ne(executor__partition__partition_boundaries.t.a, 5) + └─TableFullScan 7.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE 1 = 1 AND a != -1 AND a != 0 AND a != 1 AND a != 2 AND a != 3 AND a != 4 AND a != 5; +a b +6 6 Filler... +explain format='brief' SELECT * FROM t WHERE a NOT IN (-2, -1, 0, 1, 2, 3, 4, 5); +id estRows task access object operator info +TableReader 1.00 root partition:all data:Selection +└─Selection 1.00 cop[tikv] not(in(executor__partition__partition_boundaries.t.a, -2, -1, 0, 1, 2, 3, 4, 5)) + └─TableFullScan 7.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a NOT IN (-2, -1, 0, 1, 2, 3, 4, 5); +a b +6 6 Filler... +explain format='brief' SELECT * FROM t WHERE 1 = 0 OR a = -1 OR a = 0 OR a = 1 OR a = 2 OR a = 3 OR a = 4 OR a = 5; +id estRows task access object operator info +TableReader 6.00 root partition:p0,p1,p2,p3,p4,p5 data:Selection +└─Selection 6.00 cop[tikv] or(or(or(0, eq(executor__partition__partition_boundaries.t.a, -1)), or(eq(executor__partition__partition_boundaries.t.a, 0), eq(executor__partition__partition_boundaries.t.a, 1))), or(or(eq(executor__partition__partition_boundaries.t.a, 2), eq(executor__partition__partition_boundaries.t.a, 3)), or(eq(executor__partition__partition_boundaries.t.a, 4), eq(executor__partition__partition_boundaries.t.a, 5)))) + └─TableFullScan 7.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE 1 = 0 OR a = -1 OR a = 0 OR a = 1 OR a = 2 OR a = 3 OR a = 4 OR a = 5; +a b +0 0 Filler... +1 1 Filler... +2 2 Filler... +3 3 Filler... +4 4 Filler... +5 5 Filler... +explain format='brief' SELECT * FROM t WHERE a != 6; +id estRows task access object operator info +TableReader 6.00 root partition:all data:Selection +└─Selection 6.00 cop[tikv] ne(executor__partition__partition_boundaries.t.a, 6) + └─TableFullScan 7.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a != 6; +a b +0 0 Filler... +1 1 Filler... +2 2 Filler... +3 3 Filler... +4 4 Filler... +5 5 Filler... +explain format='brief' SELECT * FROM t WHERE 1 = 1 AND a != -1 AND a != 0 AND a != 1 AND a != 2 AND a != 3 AND a != 4 AND a != 5 AND a != 6; +id estRows task access object operator info +TableReader 1.00 root partition:all data:Selection +└─Selection 1.00 cop[tikv] ne(executor__partition__partition_boundaries.t.a, -1), ne(executor__partition__partition_boundaries.t.a, 0), ne(executor__partition__partition_boundaries.t.a, 1), ne(executor__partition__partition_boundaries.t.a, 2), ne(executor__partition__partition_boundaries.t.a, 3), ne(executor__partition__partition_boundaries.t.a, 4), ne(executor__partition__partition_boundaries.t.a, 5), ne(executor__partition__partition_boundaries.t.a, 6) + └─TableFullScan 7.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE 1 = 1 AND a != -1 AND a != 0 AND a != 1 AND a != 2 AND a != 3 AND a != 4 AND a != 5 AND a != 6; +a b +explain format='brief' SELECT * FROM t WHERE a NOT IN (-2, -1, 0, 1, 2, 3, 4, 5, 6); +id estRows task access object operator info +TableReader 1.00 root partition:all data:Selection +└─Selection 1.00 cop[tikv] not(in(executor__partition__partition_boundaries.t.a, -2, -1, 0, 1, 2, 3, 4, 5, 6)) + └─TableFullScan 7.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a NOT IN (-2, -1, 0, 1, 2, 3, 4, 5, 6); +a b +explain format='brief' SELECT * FROM t WHERE 1 = 0 OR a = -1 OR a = 0 OR a = 1 OR a = 2 OR a = 3 OR a = 4 OR a = 5 OR a = 6; +id estRows task access object operator info +TableReader 7.00 root partition:all data:Selection +└─Selection 7.00 cop[tikv] or(or(or(0, eq(executor__partition__partition_boundaries.t.a, -1)), or(eq(executor__partition__partition_boundaries.t.a, 0), eq(executor__partition__partition_boundaries.t.a, 1))), or(or(eq(executor__partition__partition_boundaries.t.a, 2), eq(executor__partition__partition_boundaries.t.a, 3)), or(eq(executor__partition__partition_boundaries.t.a, 4), or(eq(executor__partition__partition_boundaries.t.a, 5), eq(executor__partition__partition_boundaries.t.a, 6))))) + └─TableFullScan 7.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE 1 = 0 OR a = -1 OR a = 0 OR a = 1 OR a = 2 OR a = 3 OR a = 4 OR a = 5 OR a = 6; +a b +0 0 Filler... +1 1 Filler... +2 2 Filler... +3 3 Filler... +4 4 Filler... +5 5 Filler... +6 6 Filler... +explain format='brief' SELECT * FROM t WHERE a != 7; +id estRows task access object operator info +TableReader 7.00 root partition:all data:Selection +└─Selection 7.00 cop[tikv] ne(executor__partition__partition_boundaries.t.a, 7) + └─TableFullScan 7.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a != 7; +a b +0 0 Filler... +1 1 Filler... +2 2 Filler... +3 3 Filler... +4 4 Filler... +5 5 Filler... +6 6 Filler... +explain format='brief' SELECT * FROM t WHERE 1 = 1 AND a != -1 AND a != 0 AND a != 1 AND a != 2 AND a != 3 AND a != 4 AND a != 5 AND a != 6 AND a != 7; +id estRows task access object operator info +TableReader 1.00 root partition:all data:Selection +└─Selection 1.00 cop[tikv] ne(executor__partition__partition_boundaries.t.a, -1), ne(executor__partition__partition_boundaries.t.a, 0), ne(executor__partition__partition_boundaries.t.a, 1), ne(executor__partition__partition_boundaries.t.a, 2), ne(executor__partition__partition_boundaries.t.a, 3), ne(executor__partition__partition_boundaries.t.a, 4), ne(executor__partition__partition_boundaries.t.a, 5), ne(executor__partition__partition_boundaries.t.a, 6), ne(executor__partition__partition_boundaries.t.a, 7) + └─TableFullScan 7.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE 1 = 1 AND a != -1 AND a != 0 AND a != 1 AND a != 2 AND a != 3 AND a != 4 AND a != 5 AND a != 6 AND a != 7; +a b +explain format='brief' SELECT * FROM t WHERE a NOT IN (-2, -1, 0, 1, 2, 3, 4, 5, 6, 7); +id estRows task access object operator info +TableReader 1.00 root partition:all data:Selection +└─Selection 1.00 cop[tikv] not(in(executor__partition__partition_boundaries.t.a, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7)) + └─TableFullScan 7.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a NOT IN (-2, -1, 0, 1, 2, 3, 4, 5, 6, 7); +a b +explain format='brief' SELECT * FROM t WHERE 1 = 0 OR a = -1 OR a = 0 OR a = 1 OR a = 2 OR a = 3 OR a = 4 OR a = 5 OR a = 6 OR a = 7; +id estRows task access object operator info +TableReader 7.00 root partition:all data:Selection +└─Selection 7.00 cop[tikv] or(or(or(0, eq(executor__partition__partition_boundaries.t.a, -1)), or(eq(executor__partition__partition_boundaries.t.a, 0), or(eq(executor__partition__partition_boundaries.t.a, 1), eq(executor__partition__partition_boundaries.t.a, 2)))), or(or(eq(executor__partition__partition_boundaries.t.a, 3), eq(executor__partition__partition_boundaries.t.a, 4)), or(eq(executor__partition__partition_boundaries.t.a, 5), or(eq(executor__partition__partition_boundaries.t.a, 6), eq(executor__partition__partition_boundaries.t.a, 7))))) + └─TableFullScan 7.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE 1 = 0 OR a = -1 OR a = 0 OR a = 1 OR a = 2 OR a = 3 OR a = 4 OR a = 5 OR a = 6 OR a = 7; +a b +0 0 Filler... +1 1 Filler... +2 2 Filler... +3 3 Filler... +4 4 Filler... +5 5 Filler... +6 6 Filler... +SET @@tidb_partition_prune_mode = default; +DROP TABLE IF EXISTS t; +CREATE TABLE t +(a INT, b varchar(255)) +PARTITION BY RANGE (a) ( +PARTITION p0 VALUES LESS THAN (1000000), +PARTITION p1 VALUES LESS THAN (2000000), +PARTITION p2 VALUES LESS THAN (3000000)); +INSERT INTO t VALUES (999998, '999998 Filler ...'), (999999, '999999 Filler ...'), (1000000, '1000000 Filler ...'), (1000001, '1000001 Filler ...'), (1000002, '1000002 Filler ...'); +INSERT INTO t VALUES (1999998, '1999998 Filler ...'), (1999999, '1999999 Filler ...'), (2000000, '2000000 Filler ...'), (2000001, '2000001 Filler ...'), (2000002, '2000002 Filler ...'); +INSERT INTO t VALUES (2999998, '2999998 Filler ...'), (2999999, '2999999 Filler ...'); +INSERT INTO t VALUES (-2147483648, 'MIN_INT filler...'), (0, '0 Filler...'); +ANALYZE TABLE t all columns; +explain format='brief' SELECT * FROM t WHERE a BETWEEN -2147483648 AND -2147483649; +id estRows task access object operator info +TableReader 1.00 root partition:p0 data:Selection +└─Selection 1.00 cop[tikv] ge(executor__partition__partition_boundaries.t.a, -2147483648), le(executor__partition__partition_boundaries.t.a, -2147483649) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a BETWEEN -2147483648 AND -2147483649; +a b +explain format='brief' SELECT * FROM t WHERE a BETWEEN -2147483648 AND -2147483648; +id estRows task access object operator info +TableReader 1.00 root partition:p0 data:Selection +└─Selection 1.00 cop[tikv] ge(executor__partition__partition_boundaries.t.a, -2147483648), le(executor__partition__partition_boundaries.t.a, -2147483648) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a BETWEEN -2147483648 AND -2147483648; +a b +-2147483648 MIN_INT filler... +explain format='brief' SELECT * FROM t WHERE a BETWEEN -2147483648 AND -2147483647; +id estRows task access object operator info +TableReader 1.00 root partition:p0 data:Selection +└─Selection 1.00 cop[tikv] ge(executor__partition__partition_boundaries.t.a, -2147483648), le(executor__partition__partition_boundaries.t.a, -2147483647) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a BETWEEN -2147483648 AND -2147483647; +a b +-2147483648 MIN_INT filler... +explain format='brief' SELECT * FROM t WHERE a BETWEEN -2147483648 AND -2147483646; +id estRows task access object operator info +TableReader 1.00 root partition:p0 data:Selection +└─Selection 1.00 cop[tikv] ge(executor__partition__partition_boundaries.t.a, -2147483648), le(executor__partition__partition_boundaries.t.a, -2147483646) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a BETWEEN -2147483648 AND -2147483646; +a b +-2147483648 MIN_INT filler... +explain format='brief' SELECT * FROM t WHERE a BETWEEN -2147483648 AND -2147483638; +id estRows task access object operator info +TableReader 1.00 root partition:p0 data:Selection +└─Selection 1.00 cop[tikv] ge(executor__partition__partition_boundaries.t.a, -2147483648), le(executor__partition__partition_boundaries.t.a, -2147483638) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a BETWEEN -2147483648 AND -2147483638; +a b +-2147483648 MIN_INT filler... +explain format='brief' SELECT * FROM t WHERE a BETWEEN -2147483648 AND -2146483650; +id estRows task access object operator info +TableReader 1.00 root partition:p0 data:Selection +└─Selection 1.00 cop[tikv] ge(executor__partition__partition_boundaries.t.a, -2147483648), le(executor__partition__partition_boundaries.t.a, -2146483650) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a BETWEEN -2147483648 AND -2146483650; +a b +-2147483648 MIN_INT filler... +explain format='brief' SELECT * FROM t WHERE a BETWEEN -2147483648 AND -2146483649; +id estRows task access object operator info +TableReader 1.00 root partition:p0 data:Selection +└─Selection 1.00 cop[tikv] ge(executor__partition__partition_boundaries.t.a, -2147483648), le(executor__partition__partition_boundaries.t.a, -2146483649) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a BETWEEN -2147483648 AND -2146483649; +a b +-2147483648 MIN_INT filler... +explain format='brief' SELECT * FROM t WHERE a BETWEEN -2147483648 AND -2146483648; +id estRows task access object operator info +TableReader 1.00 root partition:p0 data:Selection +└─Selection 1.00 cop[tikv] ge(executor__partition__partition_boundaries.t.a, -2147483648), le(executor__partition__partition_boundaries.t.a, -2146483648) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a BETWEEN -2147483648 AND -2146483648; +a b +-2147483648 MIN_INT filler... +explain format='brief' SELECT * FROM t WHERE a BETWEEN -2147483648 AND -2146483647; +id estRows task access object operator info +TableReader 1.00 root partition:p0 data:Selection +└─Selection 1.00 cop[tikv] ge(executor__partition__partition_boundaries.t.a, -2147483648), le(executor__partition__partition_boundaries.t.a, -2146483647) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a BETWEEN -2147483648 AND -2146483647; +a b +-2147483648 MIN_INT filler... +explain format='brief' SELECT * FROM t WHERE a BETWEEN -2147483648 AND -2146483646; +id estRows task access object operator info +TableReader 1.00 root partition:p0 data:Selection +└─Selection 1.00 cop[tikv] ge(executor__partition__partition_boundaries.t.a, -2147483648), le(executor__partition__partition_boundaries.t.a, -2146483646) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a BETWEEN -2147483648 AND -2146483646; +a b +-2147483648 MIN_INT filler... +explain format='brief' SELECT * FROM t WHERE a BETWEEN 0 AND -1; +id estRows task access object operator info +TableReader 1.00 root partition:p0 data:Selection +└─Selection 1.00 cop[tikv] ge(executor__partition__partition_boundaries.t.a, 0), le(executor__partition__partition_boundaries.t.a, -1) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a BETWEEN 0 AND -1; +a b +explain format='brief' SELECT * FROM t WHERE a BETWEEN 0 AND 0; +id estRows task access object operator info +TableReader 1.00 root partition:p0 data:Selection +└─Selection 1.00 cop[tikv] ge(executor__partition__partition_boundaries.t.a, 0), le(executor__partition__partition_boundaries.t.a, 0) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a BETWEEN 0 AND 0; +a b +0 0 Filler... +explain format='brief' SELECT * FROM t WHERE a BETWEEN 0 AND 1; +id estRows task access object operator info +TableReader 1.00 root partition:p0 data:Selection +└─Selection 1.00 cop[tikv] ge(executor__partition__partition_boundaries.t.a, 0), le(executor__partition__partition_boundaries.t.a, 1) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a BETWEEN 0 AND 1; +a b +0 0 Filler... +explain format='brief' SELECT * FROM t WHERE a BETWEEN 0 AND 2; +id estRows task access object operator info +TableReader 1.00 root partition:p0 data:Selection +└─Selection 1.00 cop[tikv] ge(executor__partition__partition_boundaries.t.a, 0), le(executor__partition__partition_boundaries.t.a, 2) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a BETWEEN 0 AND 2; +a b +0 0 Filler... +explain format='brief' SELECT * FROM t WHERE a BETWEEN 0 AND 10; +id estRows task access object operator info +TableReader 1.00 root partition:p0 data:Selection +└─Selection 1.00 cop[tikv] ge(executor__partition__partition_boundaries.t.a, 0), le(executor__partition__partition_boundaries.t.a, 10) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a BETWEEN 0 AND 10; +a b +0 0 Filler... +explain format='brief' SELECT * FROM t WHERE a BETWEEN 0 AND 999998; +id estRows task access object operator info +TableReader 2.00 root partition:p0 data:Selection +└─Selection 2.00 cop[tikv] ge(executor__partition__partition_boundaries.t.a, 0), le(executor__partition__partition_boundaries.t.a, 999998) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a BETWEEN 0 AND 999998; +a b +0 0 Filler... +999998 999998 Filler ... +explain format='brief' SELECT * FROM t WHERE a BETWEEN 0 AND 999999; +id estRows task access object operator info +TableReader 3.00 root partition:p0 data:Selection +└─Selection 3.00 cop[tikv] ge(executor__partition__partition_boundaries.t.a, 0), le(executor__partition__partition_boundaries.t.a, 999999) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a BETWEEN 0 AND 999999; +a b +0 0 Filler... +999998 999998 Filler ... +999999 999999 Filler ... +explain format='brief' SELECT * FROM t WHERE a BETWEEN 0 AND 1000000; +id estRows task access object operator info +TableReader 4.00 root partition:p0,p1 data:Selection +└─Selection 4.00 cop[tikv] ge(executor__partition__partition_boundaries.t.a, 0), le(executor__partition__partition_boundaries.t.a, 1000000) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a BETWEEN 0 AND 1000000; +a b +0 0 Filler... +1000000 1000000 Filler ... +999998 999998 Filler ... +999999 999999 Filler ... +explain format='brief' SELECT * FROM t WHERE a BETWEEN 0 AND 1000001; +id estRows task access object operator info +TableReader 5.00 root partition:p0,p1 data:Selection +└─Selection 5.00 cop[tikv] ge(executor__partition__partition_boundaries.t.a, 0), le(executor__partition__partition_boundaries.t.a, 1000001) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a BETWEEN 0 AND 1000001; +a b +0 0 Filler... +1000000 1000000 Filler ... +1000001 1000001 Filler ... +999998 999998 Filler ... +999999 999999 Filler ... +explain format='brief' SELECT * FROM t WHERE a BETWEEN 0 AND 1000002; +id estRows task access object operator info +TableReader 6.00 root partition:p0,p1 data:Selection +└─Selection 6.00 cop[tikv] ge(executor__partition__partition_boundaries.t.a, 0), le(executor__partition__partition_boundaries.t.a, 1000002) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a BETWEEN 0 AND 1000002; +a b +0 0 Filler... +1000000 1000000 Filler ... +1000001 1000001 Filler ... +1000002 1000002 Filler ... +999998 999998 Filler ... +999999 999999 Filler ... +explain format='brief' SELECT * FROM t WHERE a BETWEEN 999998 AND 999997; +id estRows task access object operator info +TableReader 1.00 root partition:p0 data:Selection +└─Selection 1.00 cop[tikv] ge(executor__partition__partition_boundaries.t.a, 999998), le(executor__partition__partition_boundaries.t.a, 999997) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a BETWEEN 999998 AND 999997; +a b +explain format='brief' SELECT * FROM t WHERE a BETWEEN 999998 AND 999998; +id estRows task access object operator info +TableReader 1.00 root partition:p0 data:Selection +└─Selection 1.00 cop[tikv] ge(executor__partition__partition_boundaries.t.a, 999998), le(executor__partition__partition_boundaries.t.a, 999998) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a BETWEEN 999998 AND 999998; +a b +999998 999998 Filler ... +explain format='brief' SELECT * FROM t WHERE a BETWEEN 999998 AND 999999; +id estRows task access object operator info +TableReader 2.00 root partition:p0 data:Selection +└─Selection 2.00 cop[tikv] ge(executor__partition__partition_boundaries.t.a, 999998), le(executor__partition__partition_boundaries.t.a, 999999) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a BETWEEN 999998 AND 999999; +a b +999998 999998 Filler ... +999999 999999 Filler ... +explain format='brief' SELECT * FROM t WHERE a BETWEEN 999998 AND 1000000; +id estRows task access object operator info +TableReader 3.00 root partition:p0,p1 data:Selection +└─Selection 3.00 cop[tikv] ge(executor__partition__partition_boundaries.t.a, 999998), le(executor__partition__partition_boundaries.t.a, 1000000) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a BETWEEN 999998 AND 1000000; +a b +1000000 1000000 Filler ... +999998 999998 Filler ... +999999 999999 Filler ... +explain format='brief' SELECT * FROM t WHERE a BETWEEN 999998 AND 1000008; +id estRows task access object operator info +TableReader 5.00 root partition:p0,p1 data:Selection +└─Selection 5.00 cop[tikv] ge(executor__partition__partition_boundaries.t.a, 999998), le(executor__partition__partition_boundaries.t.a, 1000008) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a BETWEEN 999998 AND 1000008; +a b +1000000 1000000 Filler ... +1000001 1000001 Filler ... +1000002 1000002 Filler ... +999998 999998 Filler ... +999999 999999 Filler ... +explain format='brief' SELECT * FROM t WHERE a BETWEEN 999998 AND 1999996; +id estRows task access object operator info +TableReader 5.00 root partition:p0,p1 data:Selection +└─Selection 5.00 cop[tikv] ge(executor__partition__partition_boundaries.t.a, 999998), le(executor__partition__partition_boundaries.t.a, 1999996) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a BETWEEN 999998 AND 1999996; +a b +1000000 1000000 Filler ... +1000001 1000001 Filler ... +1000002 1000002 Filler ... +999998 999998 Filler ... +999999 999999 Filler ... +explain format='brief' SELECT * FROM t WHERE a BETWEEN 999998 AND 1999997; +id estRows task access object operator info +TableReader 5.00 root partition:p0,p1 data:Selection +└─Selection 5.00 cop[tikv] ge(executor__partition__partition_boundaries.t.a, 999998), le(executor__partition__partition_boundaries.t.a, 1999997) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a BETWEEN 999998 AND 1999997; +a b +1000000 1000000 Filler ... +1000001 1000001 Filler ... +1000002 1000002 Filler ... +999998 999998 Filler ... +999999 999999 Filler ... +explain format='brief' SELECT * FROM t WHERE a BETWEEN 999998 AND 1999998; +id estRows task access object operator info +TableReader 6.00 root partition:p0,p1 data:Selection +└─Selection 6.00 cop[tikv] ge(executor__partition__partition_boundaries.t.a, 999998), le(executor__partition__partition_boundaries.t.a, 1999998) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a BETWEEN 999998 AND 1999998; +a b +1000000 1000000 Filler ... +1000001 1000001 Filler ... +1000002 1000002 Filler ... +1999998 1999998 Filler ... +999998 999998 Filler ... +999999 999999 Filler ... +explain format='brief' SELECT * FROM t WHERE a BETWEEN 999998 AND 1999999; +id estRows task access object operator info +TableReader 7.00 root partition:p0,p1 data:Selection +└─Selection 7.00 cop[tikv] ge(executor__partition__partition_boundaries.t.a, 999998), le(executor__partition__partition_boundaries.t.a, 1999999) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a BETWEEN 999998 AND 1999999; +a b +1000000 1000000 Filler ... +1000001 1000001 Filler ... +1000002 1000002 Filler ... +1999998 1999998 Filler ... +1999999 1999999 Filler ... +999998 999998 Filler ... +999999 999999 Filler ... +explain format='brief' SELECT * FROM t WHERE a BETWEEN 999998 AND 2000000; +id estRows task access object operator info +TableReader 8.00 root partition:all data:Selection +└─Selection 8.00 cop[tikv] ge(executor__partition__partition_boundaries.t.a, 999998), le(executor__partition__partition_boundaries.t.a, 2000000) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a BETWEEN 999998 AND 2000000; +a b +1000000 1000000 Filler ... +1000001 1000001 Filler ... +1000002 1000002 Filler ... +1999998 1999998 Filler ... +1999999 1999999 Filler ... +2000000 2000000 Filler ... +999998 999998 Filler ... +999999 999999 Filler ... +explain format='brief' SELECT * FROM t WHERE a BETWEEN 999999 AND 999998; +id estRows task access object operator info +TableReader 1.00 root partition:p0 data:Selection +└─Selection 1.00 cop[tikv] ge(executor__partition__partition_boundaries.t.a, 999999), le(executor__partition__partition_boundaries.t.a, 999998) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a BETWEEN 999999 AND 999998; +a b +explain format='brief' SELECT * FROM t WHERE a BETWEEN 999999 AND 999999; +id estRows task access object operator info +TableReader 1.00 root partition:p0 data:Selection +└─Selection 1.00 cop[tikv] ge(executor__partition__partition_boundaries.t.a, 999999), le(executor__partition__partition_boundaries.t.a, 999999) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a BETWEEN 999999 AND 999999; +a b +999999 999999 Filler ... +explain format='brief' SELECT * FROM t WHERE a BETWEEN 999999 AND 1000000; +id estRows task access object operator info +TableReader 2.00 root partition:p0,p1 data:Selection +└─Selection 2.00 cop[tikv] ge(executor__partition__partition_boundaries.t.a, 999999), le(executor__partition__partition_boundaries.t.a, 1000000) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a BETWEEN 999999 AND 1000000; +a b +1000000 1000000 Filler ... +999999 999999 Filler ... +explain format='brief' SELECT * FROM t WHERE a BETWEEN 999999 AND 1000001; +id estRows task access object operator info +TableReader 3.00 root partition:p0,p1 data:Selection +└─Selection 3.00 cop[tikv] ge(executor__partition__partition_boundaries.t.a, 999999), le(executor__partition__partition_boundaries.t.a, 1000001) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a BETWEEN 999999 AND 1000001; +a b +1000000 1000000 Filler ... +1000001 1000001 Filler ... +999999 999999 Filler ... +explain format='brief' SELECT * FROM t WHERE a BETWEEN 999999 AND 1000009; +id estRows task access object operator info +TableReader 4.00 root partition:p0,p1 data:Selection +└─Selection 4.00 cop[tikv] ge(executor__partition__partition_boundaries.t.a, 999999), le(executor__partition__partition_boundaries.t.a, 1000009) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a BETWEEN 999999 AND 1000009; +a b +1000000 1000000 Filler ... +1000001 1000001 Filler ... +1000002 1000002 Filler ... +999999 999999 Filler ... +explain format='brief' SELECT * FROM t WHERE a BETWEEN 999999 AND 1999997; +id estRows task access object operator info +TableReader 4.00 root partition:p0,p1 data:Selection +└─Selection 4.00 cop[tikv] ge(executor__partition__partition_boundaries.t.a, 999999), le(executor__partition__partition_boundaries.t.a, 1999997) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a BETWEEN 999999 AND 1999997; +a b +1000000 1000000 Filler ... +1000001 1000001 Filler ... +1000002 1000002 Filler ... +999999 999999 Filler ... +explain format='brief' SELECT * FROM t WHERE a BETWEEN 999999 AND 1999998; +id estRows task access object operator info +TableReader 5.00 root partition:p0,p1 data:Selection +└─Selection 5.00 cop[tikv] ge(executor__partition__partition_boundaries.t.a, 999999), le(executor__partition__partition_boundaries.t.a, 1999998) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a BETWEEN 999999 AND 1999998; +a b +1000000 1000000 Filler ... +1000001 1000001 Filler ... +1000002 1000002 Filler ... +1999998 1999998 Filler ... +999999 999999 Filler ... +explain format='brief' SELECT * FROM t WHERE a BETWEEN 999999 AND 1999999; +id estRows task access object operator info +TableReader 6.00 root partition:p0,p1 data:Selection +└─Selection 6.00 cop[tikv] ge(executor__partition__partition_boundaries.t.a, 999999), le(executor__partition__partition_boundaries.t.a, 1999999) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a BETWEEN 999999 AND 1999999; +a b +1000000 1000000 Filler ... +1000001 1000001 Filler ... +1000002 1000002 Filler ... +1999998 1999998 Filler ... +1999999 1999999 Filler ... +999999 999999 Filler ... +explain format='brief' SELECT * FROM t WHERE a BETWEEN 999999 AND 2000000; +id estRows task access object operator info +TableReader 7.00 root partition:all data:Selection +└─Selection 7.00 cop[tikv] ge(executor__partition__partition_boundaries.t.a, 999999), le(executor__partition__partition_boundaries.t.a, 2000000) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a BETWEEN 999999 AND 2000000; +a b +1000000 1000000 Filler ... +1000001 1000001 Filler ... +1000002 1000002 Filler ... +1999998 1999998 Filler ... +1999999 1999999 Filler ... +2000000 2000000 Filler ... +999999 999999 Filler ... +explain format='brief' SELECT * FROM t WHERE a BETWEEN 999999 AND 2000001; +id estRows task access object operator info +TableReader 8.00 root partition:all data:Selection +└─Selection 8.00 cop[tikv] ge(executor__partition__partition_boundaries.t.a, 999999), le(executor__partition__partition_boundaries.t.a, 2000001) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a BETWEEN 999999 AND 2000001; +a b +1000000 1000000 Filler ... +1000001 1000001 Filler ... +1000002 1000002 Filler ... +1999998 1999998 Filler ... +1999999 1999999 Filler ... +2000000 2000000 Filler ... +2000001 2000001 Filler ... +999999 999999 Filler ... +explain format='brief' SELECT * FROM t WHERE a BETWEEN 1000000 AND 999999; +id estRows task access object operator info +TableReader 1.00 root partition:dual data:Selection +└─Selection 1.00 cop[tikv] ge(executor__partition__partition_boundaries.t.a, 1000000), le(executor__partition__partition_boundaries.t.a, 999999) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a BETWEEN 1000000 AND 999999; +a b +explain format='brief' SELECT * FROM t WHERE a BETWEEN 1000000 AND 1000000; +id estRows task access object operator info +TableReader 1.00 root partition:p1 data:Selection +└─Selection 1.00 cop[tikv] ge(executor__partition__partition_boundaries.t.a, 1000000), le(executor__partition__partition_boundaries.t.a, 1000000) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a BETWEEN 1000000 AND 1000000; +a b +1000000 1000000 Filler ... +explain format='brief' SELECT * FROM t WHERE a BETWEEN 1000000 AND 1000001; +id estRows task access object operator info +TableReader 2.00 root partition:p1 data:Selection +└─Selection 2.00 cop[tikv] ge(executor__partition__partition_boundaries.t.a, 1000000), le(executor__partition__partition_boundaries.t.a, 1000001) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a BETWEEN 1000000 AND 1000001; +a b +1000000 1000000 Filler ... +1000001 1000001 Filler ... +explain format='brief' SELECT * FROM t WHERE a BETWEEN 1000000 AND 1000002; +id estRows task access object operator info +TableReader 3.00 root partition:p1 data:Selection +└─Selection 3.00 cop[tikv] ge(executor__partition__partition_boundaries.t.a, 1000000), le(executor__partition__partition_boundaries.t.a, 1000002) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a BETWEEN 1000000 AND 1000002; +a b +1000000 1000000 Filler ... +1000001 1000001 Filler ... +1000002 1000002 Filler ... +explain format='brief' SELECT * FROM t WHERE a BETWEEN 1000000 AND 1000010; +id estRows task access object operator info +TableReader 3.00 root partition:p1 data:Selection +└─Selection 3.00 cop[tikv] ge(executor__partition__partition_boundaries.t.a, 1000000), le(executor__partition__partition_boundaries.t.a, 1000010) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a BETWEEN 1000000 AND 1000010; +a b +1000000 1000000 Filler ... +1000001 1000001 Filler ... +1000002 1000002 Filler ... +explain format='brief' SELECT * FROM t WHERE a BETWEEN 1000000 AND 1999998; +id estRows task access object operator info +TableReader 4.00 root partition:p1 data:Selection +└─Selection 4.00 cop[tikv] ge(executor__partition__partition_boundaries.t.a, 1000000), le(executor__partition__partition_boundaries.t.a, 1999998) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a BETWEEN 1000000 AND 1999998; +a b +1000000 1000000 Filler ... +1000001 1000001 Filler ... +1000002 1000002 Filler ... +1999998 1999998 Filler ... +explain format='brief' SELECT * FROM t WHERE a BETWEEN 1000000 AND 1999999; +id estRows task access object operator info +TableReader 5.00 root partition:p1 data:Selection +└─Selection 5.00 cop[tikv] ge(executor__partition__partition_boundaries.t.a, 1000000), le(executor__partition__partition_boundaries.t.a, 1999999) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a BETWEEN 1000000 AND 1999999; +a b +1000000 1000000 Filler ... +1000001 1000001 Filler ... +1000002 1000002 Filler ... +1999998 1999998 Filler ... +1999999 1999999 Filler ... +explain format='brief' SELECT * FROM t WHERE a BETWEEN 1000000 AND 2000000; +id estRows task access object operator info +TableReader 6.00 root partition:p1,p2 data:Selection +└─Selection 6.00 cop[tikv] ge(executor__partition__partition_boundaries.t.a, 1000000), le(executor__partition__partition_boundaries.t.a, 2000000) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a BETWEEN 1000000 AND 2000000; +a b +1000000 1000000 Filler ... +1000001 1000001 Filler ... +1000002 1000002 Filler ... +1999998 1999998 Filler ... +1999999 1999999 Filler ... +2000000 2000000 Filler ... +explain format='brief' SELECT * FROM t WHERE a BETWEEN 1000000 AND 2000001; +id estRows task access object operator info +TableReader 7.00 root partition:p1,p2 data:Selection +└─Selection 7.00 cop[tikv] ge(executor__partition__partition_boundaries.t.a, 1000000), le(executor__partition__partition_boundaries.t.a, 2000001) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a BETWEEN 1000000 AND 2000001; +a b +1000000 1000000 Filler ... +1000001 1000001 Filler ... +1000002 1000002 Filler ... +1999998 1999998 Filler ... +1999999 1999999 Filler ... +2000000 2000000 Filler ... +2000001 2000001 Filler ... +explain format='brief' SELECT * FROM t WHERE a BETWEEN 1000000 AND 2000002; +id estRows task access object operator info +TableReader 8.00 root partition:p1,p2 data:Selection +└─Selection 8.00 cop[tikv] ge(executor__partition__partition_boundaries.t.a, 1000000), le(executor__partition__partition_boundaries.t.a, 2000002) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a BETWEEN 1000000 AND 2000002; +a b +1000000 1000000 Filler ... +1000001 1000001 Filler ... +1000002 1000002 Filler ... +1999998 1999998 Filler ... +1999999 1999999 Filler ... +2000000 2000000 Filler ... +2000001 2000001 Filler ... +2000002 2000002 Filler ... +explain format='brief' SELECT * FROM t WHERE a BETWEEN 1000001 AND 1000000; +id estRows task access object operator info +TableReader 1.00 root partition:p1 data:Selection +└─Selection 1.00 cop[tikv] ge(executor__partition__partition_boundaries.t.a, 1000001), le(executor__partition__partition_boundaries.t.a, 1000000) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a BETWEEN 1000001 AND 1000000; +a b +explain format='brief' SELECT * FROM t WHERE a BETWEEN 1000001 AND 1000001; +id estRows task access object operator info +TableReader 1.00 root partition:p1 data:Selection +└─Selection 1.00 cop[tikv] ge(executor__partition__partition_boundaries.t.a, 1000001), le(executor__partition__partition_boundaries.t.a, 1000001) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a BETWEEN 1000001 AND 1000001; +a b +1000001 1000001 Filler ... +explain format='brief' SELECT * FROM t WHERE a BETWEEN 1000001 AND 1000002; +id estRows task access object operator info +TableReader 2.00 root partition:p1 data:Selection +└─Selection 2.00 cop[tikv] ge(executor__partition__partition_boundaries.t.a, 1000001), le(executor__partition__partition_boundaries.t.a, 1000002) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a BETWEEN 1000001 AND 1000002; +a b +1000001 1000001 Filler ... +1000002 1000002 Filler ... +explain format='brief' SELECT * FROM t WHERE a BETWEEN 1000001 AND 1000003; +id estRows task access object operator info +TableReader 2.00 root partition:p1 data:Selection +└─Selection 2.00 cop[tikv] ge(executor__partition__partition_boundaries.t.a, 1000001), le(executor__partition__partition_boundaries.t.a, 1000003) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a BETWEEN 1000001 AND 1000003; +a b +1000001 1000001 Filler ... +1000002 1000002 Filler ... +explain format='brief' SELECT * FROM t WHERE a BETWEEN 1000001 AND 1000011; +id estRows task access object operator info +TableReader 2.00 root partition:p1 data:Selection +└─Selection 2.00 cop[tikv] ge(executor__partition__partition_boundaries.t.a, 1000001), le(executor__partition__partition_boundaries.t.a, 1000011) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a BETWEEN 1000001 AND 1000011; +a b +1000001 1000001 Filler ... +1000002 1000002 Filler ... +explain format='brief' SELECT * FROM t WHERE a BETWEEN 1000001 AND 1999999; +id estRows task access object operator info +TableReader 4.00 root partition:p1 data:Selection +└─Selection 4.00 cop[tikv] ge(executor__partition__partition_boundaries.t.a, 1000001), le(executor__partition__partition_boundaries.t.a, 1999999) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a BETWEEN 1000001 AND 1999999; +a b +1000001 1000001 Filler ... +1000002 1000002 Filler ... +1999998 1999998 Filler ... +1999999 1999999 Filler ... +explain format='brief' SELECT * FROM t WHERE a BETWEEN 1000001 AND 2000000; +id estRows task access object operator info +TableReader 5.00 root partition:p1,p2 data:Selection +└─Selection 5.00 cop[tikv] ge(executor__partition__partition_boundaries.t.a, 1000001), le(executor__partition__partition_boundaries.t.a, 2000000) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a BETWEEN 1000001 AND 2000000; +a b +1000001 1000001 Filler ... +1000002 1000002 Filler ... +1999998 1999998 Filler ... +1999999 1999999 Filler ... +2000000 2000000 Filler ... +explain format='brief' SELECT * FROM t WHERE a BETWEEN 1000001 AND 2000001; +id estRows task access object operator info +TableReader 6.00 root partition:p1,p2 data:Selection +└─Selection 6.00 cop[tikv] ge(executor__partition__partition_boundaries.t.a, 1000001), le(executor__partition__partition_boundaries.t.a, 2000001) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a BETWEEN 1000001 AND 2000001; +a b +1000001 1000001 Filler ... +1000002 1000002 Filler ... +1999998 1999998 Filler ... +1999999 1999999 Filler ... +2000000 2000000 Filler ... +2000001 2000001 Filler ... +explain format='brief' SELECT * FROM t WHERE a BETWEEN 1000001 AND 2000002; +id estRows task access object operator info +TableReader 7.00 root partition:p1,p2 data:Selection +└─Selection 7.00 cop[tikv] ge(executor__partition__partition_boundaries.t.a, 1000001), le(executor__partition__partition_boundaries.t.a, 2000002) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a BETWEEN 1000001 AND 2000002; +a b +1000001 1000001 Filler ... +1000002 1000002 Filler ... +1999998 1999998 Filler ... +1999999 1999999 Filler ... +2000000 2000000 Filler ... +2000001 2000001 Filler ... +2000002 2000002 Filler ... +explain format='brief' SELECT * FROM t WHERE a BETWEEN 1000001 AND 2000003; +id estRows task access object operator info +TableReader 7.00 root partition:p1,p2 data:Selection +└─Selection 7.00 cop[tikv] ge(executor__partition__partition_boundaries.t.a, 1000001), le(executor__partition__partition_boundaries.t.a, 2000003) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a BETWEEN 1000001 AND 2000003; +a b +1000001 1000001 Filler ... +1000002 1000002 Filler ... +1999998 1999998 Filler ... +1999999 1999999 Filler ... +2000000 2000000 Filler ... +2000001 2000001 Filler ... +2000002 2000002 Filler ... +explain format='brief' SELECT * FROM t WHERE a BETWEEN 1000002 AND 1000001; +id estRows task access object operator info +TableReader 1.00 root partition:p1 data:Selection +└─Selection 1.00 cop[tikv] ge(executor__partition__partition_boundaries.t.a, 1000002), le(executor__partition__partition_boundaries.t.a, 1000001) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a BETWEEN 1000002 AND 1000001; +a b +explain format='brief' SELECT * FROM t WHERE a BETWEEN 1000002 AND 1000002; +id estRows task access object operator info +TableReader 1.00 root partition:p1 data:Selection +└─Selection 1.00 cop[tikv] ge(executor__partition__partition_boundaries.t.a, 1000002), le(executor__partition__partition_boundaries.t.a, 1000002) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a BETWEEN 1000002 AND 1000002; +a b +1000002 1000002 Filler ... +explain format='brief' SELECT * FROM t WHERE a BETWEEN 1000002 AND 1000003; +id estRows task access object operator info +TableReader 1.00 root partition:p1 data:Selection +└─Selection 1.00 cop[tikv] ge(executor__partition__partition_boundaries.t.a, 1000002), le(executor__partition__partition_boundaries.t.a, 1000003) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a BETWEEN 1000002 AND 1000003; +a b +1000002 1000002 Filler ... +explain format='brief' SELECT * FROM t WHERE a BETWEEN 1000002 AND 1000004; +id estRows task access object operator info +TableReader 1.00 root partition:p1 data:Selection +└─Selection 1.00 cop[tikv] ge(executor__partition__partition_boundaries.t.a, 1000002), le(executor__partition__partition_boundaries.t.a, 1000004) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a BETWEEN 1000002 AND 1000004; +a b +1000002 1000002 Filler ... +explain format='brief' SELECT * FROM t WHERE a BETWEEN 1000002 AND 1000012; +id estRows task access object operator info +TableReader 1.00 root partition:p1 data:Selection +└─Selection 1.00 cop[tikv] ge(executor__partition__partition_boundaries.t.a, 1000002), le(executor__partition__partition_boundaries.t.a, 1000012) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a BETWEEN 1000002 AND 1000012; +a b +1000002 1000002 Filler ... +explain format='brief' SELECT * FROM t WHERE a BETWEEN 1000002 AND 2000000; +id estRows task access object operator info +TableReader 4.00 root partition:p1,p2 data:Selection +└─Selection 4.00 cop[tikv] ge(executor__partition__partition_boundaries.t.a, 1000002), le(executor__partition__partition_boundaries.t.a, 2000000) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a BETWEEN 1000002 AND 2000000; +a b +1000002 1000002 Filler ... +1999998 1999998 Filler ... +1999999 1999999 Filler ... +2000000 2000000 Filler ... +explain format='brief' SELECT * FROM t WHERE a BETWEEN 1000002 AND 2000001; +id estRows task access object operator info +TableReader 5.00 root partition:p1,p2 data:Selection +└─Selection 5.00 cop[tikv] ge(executor__partition__partition_boundaries.t.a, 1000002), le(executor__partition__partition_boundaries.t.a, 2000001) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a BETWEEN 1000002 AND 2000001; +a b +1000002 1000002 Filler ... +1999998 1999998 Filler ... +1999999 1999999 Filler ... +2000000 2000000 Filler ... +2000001 2000001 Filler ... +explain format='brief' SELECT * FROM t WHERE a BETWEEN 1000002 AND 2000002; +id estRows task access object operator info +TableReader 6.00 root partition:p1,p2 data:Selection +└─Selection 6.00 cop[tikv] ge(executor__partition__partition_boundaries.t.a, 1000002), le(executor__partition__partition_boundaries.t.a, 2000002) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a BETWEEN 1000002 AND 2000002; +a b +1000002 1000002 Filler ... +1999998 1999998 Filler ... +1999999 1999999 Filler ... +2000000 2000000 Filler ... +2000001 2000001 Filler ... +2000002 2000002 Filler ... +explain format='brief' SELECT * FROM t WHERE a BETWEEN 1000002 AND 2000003; +id estRows task access object operator info +TableReader 6.00 root partition:p1,p2 data:Selection +└─Selection 6.00 cop[tikv] ge(executor__partition__partition_boundaries.t.a, 1000002), le(executor__partition__partition_boundaries.t.a, 2000003) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a BETWEEN 1000002 AND 2000003; +a b +1000002 1000002 Filler ... +1999998 1999998 Filler ... +1999999 1999999 Filler ... +2000000 2000000 Filler ... +2000001 2000001 Filler ... +2000002 2000002 Filler ... +explain format='brief' SELECT * FROM t WHERE a BETWEEN 1000002 AND 2000004; +id estRows task access object operator info +TableReader 6.00 root partition:p1,p2 data:Selection +└─Selection 6.00 cop[tikv] ge(executor__partition__partition_boundaries.t.a, 1000002), le(executor__partition__partition_boundaries.t.a, 2000004) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a BETWEEN 1000002 AND 2000004; +a b +1000002 1000002 Filler ... +1999998 1999998 Filler ... +1999999 1999999 Filler ... +2000000 2000000 Filler ... +2000001 2000001 Filler ... +2000002 2000002 Filler ... +explain format='brief' SELECT * FROM t WHERE a BETWEEN 3000000 AND 2999999; +id estRows task access object operator info +TableReader 1.00 root partition:dual data:Selection +└─Selection 1.00 cop[tikv] ge(executor__partition__partition_boundaries.t.a, 3000000), le(executor__partition__partition_boundaries.t.a, 2999999) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a BETWEEN 3000000 AND 2999999; +a b +explain format='brief' SELECT * FROM t WHERE a BETWEEN 3000000 AND 3000000; +id estRows task access object operator info +TableReader 1.00 root partition:dual data:Selection +└─Selection 1.00 cop[tikv] ge(executor__partition__partition_boundaries.t.a, 3000000), le(executor__partition__partition_boundaries.t.a, 3000000) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a BETWEEN 3000000 AND 3000000; +a b +explain format='brief' SELECT * FROM t WHERE a BETWEEN 3000000 AND 3000001; +id estRows task access object operator info +TableReader 1.00 root partition:dual data:Selection +└─Selection 1.00 cop[tikv] ge(executor__partition__partition_boundaries.t.a, 3000000), le(executor__partition__partition_boundaries.t.a, 3000001) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a BETWEEN 3000000 AND 3000001; +a b +explain format='brief' SELECT * FROM t WHERE a BETWEEN 3000000 AND 3000002; +id estRows task access object operator info +TableReader 1.00 root partition:dual data:Selection +└─Selection 1.00 cop[tikv] ge(executor__partition__partition_boundaries.t.a, 3000000), le(executor__partition__partition_boundaries.t.a, 3000002) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a BETWEEN 3000000 AND 3000002; +a b +explain format='brief' SELECT * FROM t WHERE a BETWEEN 3000000 AND 3000010; +id estRows task access object operator info +TableReader 1.00 root partition:dual data:Selection +└─Selection 1.00 cop[tikv] ge(executor__partition__partition_boundaries.t.a, 3000000), le(executor__partition__partition_boundaries.t.a, 3000010) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a BETWEEN 3000000 AND 3000010; +a b +explain format='brief' SELECT * FROM t WHERE a BETWEEN 3000000 AND 3999998; +id estRows task access object operator info +TableReader 1.00 root partition:dual data:Selection +└─Selection 1.00 cop[tikv] ge(executor__partition__partition_boundaries.t.a, 3000000), le(executor__partition__partition_boundaries.t.a, 3999998) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a BETWEEN 3000000 AND 3999998; +a b +explain format='brief' SELECT * FROM t WHERE a BETWEEN 3000000 AND 3999999; +id estRows task access object operator info +TableReader 1.00 root partition:dual data:Selection +└─Selection 1.00 cop[tikv] ge(executor__partition__partition_boundaries.t.a, 3000000), le(executor__partition__partition_boundaries.t.a, 3999999) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a BETWEEN 3000000 AND 3999999; +a b +explain format='brief' SELECT * FROM t WHERE a BETWEEN 3000000 AND 4000000; +id estRows task access object operator info +TableReader 1.00 root partition:dual data:Selection +└─Selection 1.00 cop[tikv] ge(executor__partition__partition_boundaries.t.a, 3000000), le(executor__partition__partition_boundaries.t.a, 4000000) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a BETWEEN 3000000 AND 4000000; +a b +explain format='brief' SELECT * FROM t WHERE a BETWEEN 3000000 AND 4000001; +id estRows task access object operator info +TableReader 1.00 root partition:dual data:Selection +└─Selection 1.00 cop[tikv] ge(executor__partition__partition_boundaries.t.a, 3000000), le(executor__partition__partition_boundaries.t.a, 4000001) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a BETWEEN 3000000 AND 4000001; +a b +explain format='brief' SELECT * FROM t WHERE a BETWEEN 3000000 AND 4000002; +id estRows task access object operator info +TableReader 1.00 root partition:dual data:Selection +└─Selection 1.00 cop[tikv] ge(executor__partition__partition_boundaries.t.a, 3000000), le(executor__partition__partition_boundaries.t.a, 4000002) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a BETWEEN 3000000 AND 4000002; +a b +explain format='brief' SELECT * FROM t WHERE a BETWEEN 3000001 AND 3000000; +id estRows task access object operator info +TableReader 1.00 root partition:dual data:Selection +└─Selection 1.00 cop[tikv] ge(executor__partition__partition_boundaries.t.a, 3000001), le(executor__partition__partition_boundaries.t.a, 3000000) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a BETWEEN 3000001 AND 3000000; +a b +explain format='brief' SELECT * FROM t WHERE a BETWEEN 3000001 AND 3000001; +id estRows task access object operator info +TableReader 1.00 root partition:dual data:Selection +└─Selection 1.00 cop[tikv] ge(executor__partition__partition_boundaries.t.a, 3000001), le(executor__partition__partition_boundaries.t.a, 3000001) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a BETWEEN 3000001 AND 3000001; +a b +explain format='brief' SELECT * FROM t WHERE a BETWEEN 3000001 AND 3000002; +id estRows task access object operator info +TableReader 1.00 root partition:dual data:Selection +└─Selection 1.00 cop[tikv] ge(executor__partition__partition_boundaries.t.a, 3000001), le(executor__partition__partition_boundaries.t.a, 3000002) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a BETWEEN 3000001 AND 3000002; +a b +explain format='brief' SELECT * FROM t WHERE a BETWEEN 3000001 AND 3000003; +id estRows task access object operator info +TableReader 1.00 root partition:dual data:Selection +└─Selection 1.00 cop[tikv] ge(executor__partition__partition_boundaries.t.a, 3000001), le(executor__partition__partition_boundaries.t.a, 3000003) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a BETWEEN 3000001 AND 3000003; +a b +explain format='brief' SELECT * FROM t WHERE a BETWEEN 3000001 AND 3000011; +id estRows task access object operator info +TableReader 1.00 root partition:dual data:Selection +└─Selection 1.00 cop[tikv] ge(executor__partition__partition_boundaries.t.a, 3000001), le(executor__partition__partition_boundaries.t.a, 3000011) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a BETWEEN 3000001 AND 3000011; +a b +explain format='brief' SELECT * FROM t WHERE a BETWEEN 3000001 AND 3999999; +id estRows task access object operator info +TableReader 1.00 root partition:dual data:Selection +└─Selection 1.00 cop[tikv] ge(executor__partition__partition_boundaries.t.a, 3000001), le(executor__partition__partition_boundaries.t.a, 3999999) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a BETWEEN 3000001 AND 3999999; +a b +explain format='brief' SELECT * FROM t WHERE a BETWEEN 3000001 AND 4000000; +id estRows task access object operator info +TableReader 1.00 root partition:dual data:Selection +└─Selection 1.00 cop[tikv] ge(executor__partition__partition_boundaries.t.a, 3000001), le(executor__partition__partition_boundaries.t.a, 4000000) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a BETWEEN 3000001 AND 4000000; +a b +explain format='brief' SELECT * FROM t WHERE a BETWEEN 3000001 AND 4000001; +id estRows task access object operator info +TableReader 1.00 root partition:dual data:Selection +└─Selection 1.00 cop[tikv] ge(executor__partition__partition_boundaries.t.a, 3000001), le(executor__partition__partition_boundaries.t.a, 4000001) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a BETWEEN 3000001 AND 4000001; +a b +explain format='brief' SELECT * FROM t WHERE a BETWEEN 3000001 AND 4000002; +id estRows task access object operator info +TableReader 1.00 root partition:dual data:Selection +└─Selection 1.00 cop[tikv] ge(executor__partition__partition_boundaries.t.a, 3000001), le(executor__partition__partition_boundaries.t.a, 4000002) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a BETWEEN 3000001 AND 4000002; +a b +explain format='brief' SELECT * FROM t WHERE a BETWEEN 3000001 AND 4000003; +id estRows task access object operator info +TableReader 1.00 root partition:dual data:Selection +└─Selection 1.00 cop[tikv] ge(executor__partition__partition_boundaries.t.a, 3000001), le(executor__partition__partition_boundaries.t.a, 4000003) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a BETWEEN 3000001 AND 4000003; +a b +DROP TABLE IF EXISTS t; +CREATE TABLE t +(a INT, b varchar(255)) +PARTITION BY RANGE (a) ( +PARTITION p0 VALUES LESS THAN (1), +PARTITION p1 VALUES LESS THAN (2), +PARTITION p2 VALUES LESS THAN (3), +PARTITION p3 VALUES LESS THAN (4), +PARTITION p4 VALUES LESS THAN (5), +PARTITION p5 VALUES LESS THAN (6), +PARTITION p6 VALUES LESS THAN (7)); +INSERT INTO t VALUES (0, '0 Filler...'); +INSERT INTO t VALUES (1, '1 Filler...'); +INSERT INTO t VALUES (2, '2 Filler...'); +INSERT INTO t VALUES (3, '3 Filler...'); +INSERT INTO t VALUES (4, '4 Filler...'); +INSERT INTO t VALUES (5, '5 Filler...'); +INSERT INTO t VALUES (6, '6 Filler...'); +ANALYZE TABLE t all columns; +explain format='brief' SELECT * FROM t WHERE a BETWEEN 2 AND -1; +id estRows task access object operator info +TableReader 1.00 root partition:dual data:Selection +└─Selection 1.00 cop[tikv] ge(executor__partition__partition_boundaries.t.a, 2), le(executor__partition__partition_boundaries.t.a, -1) + └─TableFullScan 7.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a BETWEEN 2 AND -1; +a b +explain format='brief' SELECT * FROM t WHERE a BETWEEN -1 AND 4; +id estRows task access object operator info +TableReader 5.00 root partition:p0,p1,p2,p3,p4 data:Selection +└─Selection 5.00 cop[tikv] ge(executor__partition__partition_boundaries.t.a, -1), le(executor__partition__partition_boundaries.t.a, 4) + └─TableFullScan 7.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a BETWEEN -1 AND 4; +a b +0 0 Filler... +1 1 Filler... +2 2 Filler... +3 3 Filler... +4 4 Filler... +explain format='brief' SELECT * FROM t WHERE a BETWEEN 2 AND 0; +id estRows task access object operator info +TableReader 1.00 root partition:dual data:Selection +└─Selection 1.00 cop[tikv] ge(executor__partition__partition_boundaries.t.a, 2), le(executor__partition__partition_boundaries.t.a, 0) + └─TableFullScan 7.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a BETWEEN 2 AND 0; +a b +explain format='brief' SELECT * FROM t WHERE a BETWEEN 0 AND 4; +id estRows task access object operator info +TableReader 5.00 root partition:p0,p1,p2,p3,p4 data:Selection +└─Selection 5.00 cop[tikv] ge(executor__partition__partition_boundaries.t.a, 0), le(executor__partition__partition_boundaries.t.a, 4) + └─TableFullScan 7.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a BETWEEN 0 AND 4; +a b +0 0 Filler... +1 1 Filler... +2 2 Filler... +3 3 Filler... +4 4 Filler... +explain format='brief' SELECT * FROM t WHERE a BETWEEN 2 AND 1; +id estRows task access object operator info +TableReader 1.00 root partition:dual data:Selection +└─Selection 1.00 cop[tikv] ge(executor__partition__partition_boundaries.t.a, 2), le(executor__partition__partition_boundaries.t.a, 1) + └─TableFullScan 7.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a BETWEEN 2 AND 1; +a b +explain format='brief' SELECT * FROM t WHERE a BETWEEN 1 AND 4; +id estRows task access object operator info +TableReader 4.00 root partition:p1,p2,p3,p4 data:Selection +└─Selection 4.00 cop[tikv] ge(executor__partition__partition_boundaries.t.a, 1), le(executor__partition__partition_boundaries.t.a, 4) + └─TableFullScan 7.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a BETWEEN 1 AND 4; +a b +1 1 Filler... +2 2 Filler... +3 3 Filler... +4 4 Filler... +explain format='brief' SELECT * FROM t WHERE a BETWEEN 2 AND 2; +id estRows task access object operator info +TableReader 1.00 root partition:p2 data:Selection +└─Selection 1.00 cop[tikv] ge(executor__partition__partition_boundaries.t.a, 2), le(executor__partition__partition_boundaries.t.a, 2) + └─TableFullScan 7.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a BETWEEN 2 AND 2; +a b +2 2 Filler... +explain format='brief' SELECT * FROM t WHERE a BETWEEN 2 AND 4; +id estRows task access object operator info +TableReader 3.00 root partition:p2,p3,p4 data:Selection +└─Selection 3.00 cop[tikv] ge(executor__partition__partition_boundaries.t.a, 2), le(executor__partition__partition_boundaries.t.a, 4) + └─TableFullScan 7.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a BETWEEN 2 AND 4; +a b +2 2 Filler... +3 3 Filler... +4 4 Filler... +explain format='brief' SELECT * FROM t WHERE a BETWEEN 2 AND 3; +id estRows task access object operator info +TableReader 2.00 root partition:p2,p3 data:Selection +└─Selection 2.00 cop[tikv] ge(executor__partition__partition_boundaries.t.a, 2), le(executor__partition__partition_boundaries.t.a, 3) + └─TableFullScan 7.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a BETWEEN 2 AND 3; +a b +2 2 Filler... +3 3 Filler... +explain format='brief' SELECT * FROM t WHERE a BETWEEN 3 AND 4; +id estRows task access object operator info +TableReader 2.00 root partition:p3,p4 data:Selection +└─Selection 2.00 cop[tikv] ge(executor__partition__partition_boundaries.t.a, 3), le(executor__partition__partition_boundaries.t.a, 4) + └─TableFullScan 7.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a BETWEEN 3 AND 4; +a b +3 3 Filler... +4 4 Filler... +explain format='brief' SELECT * FROM t WHERE a BETWEEN 2 AND 4; +id estRows task access object operator info +TableReader 3.00 root partition:p2,p3,p4 data:Selection +└─Selection 3.00 cop[tikv] ge(executor__partition__partition_boundaries.t.a, 2), le(executor__partition__partition_boundaries.t.a, 4) + └─TableFullScan 7.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a BETWEEN 2 AND 4; +a b +2 2 Filler... +3 3 Filler... +4 4 Filler... +explain format='brief' SELECT * FROM t WHERE a BETWEEN 4 AND 4; +id estRows task access object operator info +TableReader 1.00 root partition:p4 data:Selection +└─Selection 1.00 cop[tikv] ge(executor__partition__partition_boundaries.t.a, 4), le(executor__partition__partition_boundaries.t.a, 4) + └─TableFullScan 7.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a BETWEEN 4 AND 4; +a b +4 4 Filler... +explain format='brief' SELECT * FROM t WHERE a BETWEEN 2 AND 5; +id estRows task access object operator info +TableReader 4.00 root partition:p2,p3,p4,p5 data:Selection +└─Selection 4.00 cop[tikv] ge(executor__partition__partition_boundaries.t.a, 2), le(executor__partition__partition_boundaries.t.a, 5) + └─TableFullScan 7.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a BETWEEN 2 AND 5; +a b +2 2 Filler... +3 3 Filler... +4 4 Filler... +5 5 Filler... +explain format='brief' SELECT * FROM t WHERE a BETWEEN 5 AND 4; +id estRows task access object operator info +TableReader 1.00 root partition:dual data:Selection +└─Selection 1.00 cop[tikv] ge(executor__partition__partition_boundaries.t.a, 5), le(executor__partition__partition_boundaries.t.a, 4) + └─TableFullScan 7.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a BETWEEN 5 AND 4; +a b +explain format='brief' SELECT * FROM t WHERE a BETWEEN 2 AND 6; +id estRows task access object operator info +TableReader 5.00 root partition:p2,p3,p4,p5,p6 data:Selection +└─Selection 5.00 cop[tikv] ge(executor__partition__partition_boundaries.t.a, 2), le(executor__partition__partition_boundaries.t.a, 6) + └─TableFullScan 7.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a BETWEEN 2 AND 6; +a b +2 2 Filler... +3 3 Filler... +4 4 Filler... +5 5 Filler... +6 6 Filler... +explain format='brief' SELECT * FROM t WHERE a BETWEEN 6 AND 4; +id estRows task access object operator info +TableReader 1.00 root partition:dual data:Selection +└─Selection 1.00 cop[tikv] ge(executor__partition__partition_boundaries.t.a, 6), le(executor__partition__partition_boundaries.t.a, 4) + └─TableFullScan 7.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a BETWEEN 6 AND 4; +a b +explain format='brief' SELECT * FROM t WHERE a BETWEEN 2 AND 7; +id estRows task access object operator info +TableReader 5.00 root partition:p2,p3,p4,p5,p6 data:Selection +└─Selection 5.00 cop[tikv] ge(executor__partition__partition_boundaries.t.a, 2), le(executor__partition__partition_boundaries.t.a, 7) + └─TableFullScan 7.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a BETWEEN 2 AND 7; +a b +2 2 Filler... +3 3 Filler... +4 4 Filler... +5 5 Filler... +6 6 Filler... +explain format='brief' SELECT * FROM t WHERE a BETWEEN 7 AND 4; +id estRows task access object operator info +TableReader 1.00 root partition:dual data:Selection +└─Selection 1.00 cop[tikv] ge(executor__partition__partition_boundaries.t.a, 7), le(executor__partition__partition_boundaries.t.a, 4) + └─TableFullScan 7.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a BETWEEN 7 AND 4; +a b +set @@tidb_partition_prune_mode = 'dynamic'; +drop table if exists t; +CREATE TABLE t +(a INT, b varchar(255)) +PARTITION BY RANGE (a) ( +PARTITION p0 VALUES LESS THAN (1000000), +PARTITION p1 VALUES LESS THAN (2000000), +PARTITION p2 VALUES LESS THAN (3000000)); +INSERT INTO t VALUES (999998, '999998 Filler ...'), (999999, '999999 Filler ...'), (1000000, '1000000 Filler ...'), (1000001, '1000001 Filler ...'), (1000002, '1000002 Filler ...'); +INSERT INTO t VALUES (1999998, '1999998 Filler ...'), (1999999, '1999999 Filler ...'), (2000000, '2000000 Filler ...'), (2000001, '2000001 Filler ...'), (2000002, '2000002 Filler ...'); +INSERT INTO t VALUES (2999998, '2999998 Filler ...'), (2999999, '2999999 Filler ...'); +INSERT INTO t VALUES (-2147483648, 'MIN_INT filler...'), (0, '0 Filler...'); +ANALYZE TABLE t all columns; +explain format='brief' SELECT * FROM t WHERE a < -2147483648; +id estRows task access object operator info +TableReader 1.00 root partition:p0 data:Selection +└─Selection 1.00 cop[tikv] lt(executor__partition__partition_boundaries.t.a, -2147483648) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a < -2147483648; +a b +explain format='brief' SELECT * FROM t WHERE a > -2147483648; +id estRows task access object operator info +TableReader 13.00 root partition:all data:Selection +└─Selection 13.00 cop[tikv] gt(executor__partition__partition_boundaries.t.a, -2147483648) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a > -2147483648; +a b +0 0 Filler... +1000000 1000000 Filler ... +1000001 1000001 Filler ... +1000002 1000002 Filler ... +1999998 1999998 Filler ... +1999999 1999999 Filler ... +2000000 2000000 Filler ... +2000001 2000001 Filler ... +2000002 2000002 Filler ... +2999998 2999998 Filler ... +2999999 2999999 Filler ... +999998 999998 Filler ... +999999 999999 Filler ... +explain format='brief' SELECT * FROM t WHERE a <= -2147483648; +id estRows task access object operator info +TableReader 1.00 root partition:p0 data:Selection +└─Selection 1.00 cop[tikv] le(executor__partition__partition_boundaries.t.a, -2147483648) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a <= -2147483648; +a b +-2147483648 MIN_INT filler... +explain format='brief' SELECT * FROM t WHERE a >= -2147483648; +id estRows task access object operator info +TableReader 14.00 root partition:all data:Selection +└─Selection 14.00 cop[tikv] ge(executor__partition__partition_boundaries.t.a, -2147483648) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a >= -2147483648; +a b +-2147483648 MIN_INT filler... +0 0 Filler... +1000000 1000000 Filler ... +1000001 1000001 Filler ... +1000002 1000002 Filler ... +1999998 1999998 Filler ... +1999999 1999999 Filler ... +2000000 2000000 Filler ... +2000001 2000001 Filler ... +2000002 2000002 Filler ... +2999998 2999998 Filler ... +2999999 2999999 Filler ... +999998 999998 Filler ... +999999 999999 Filler ... +explain format='brief' SELECT * FROM t WHERE a < 0; +id estRows task access object operator info +TableReader 1.00 root partition:p0 data:Selection +└─Selection 1.00 cop[tikv] lt(executor__partition__partition_boundaries.t.a, 0) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a < 0; +a b +-2147483648 MIN_INT filler... +explain format='brief' SELECT * FROM t WHERE a > 0; +id estRows task access object operator info +TableReader 12.00 root partition:all data:Selection +└─Selection 12.00 cop[tikv] gt(executor__partition__partition_boundaries.t.a, 0) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a > 0; +a b +1000000 1000000 Filler ... +1000001 1000001 Filler ... +1000002 1000002 Filler ... +1999998 1999998 Filler ... +1999999 1999999 Filler ... +2000000 2000000 Filler ... +2000001 2000001 Filler ... +2000002 2000002 Filler ... +2999998 2999998 Filler ... +2999999 2999999 Filler ... +999998 999998 Filler ... +999999 999999 Filler ... +explain format='brief' SELECT * FROM t WHERE a <= 0; +id estRows task access object operator info +TableReader 2.00 root partition:p0 data:Selection +└─Selection 2.00 cop[tikv] le(executor__partition__partition_boundaries.t.a, 0) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a <= 0; +a b +-2147483648 MIN_INT filler... +0 0 Filler... +explain format='brief' SELECT * FROM t WHERE a >= 0; +id estRows task access object operator info +TableReader 13.00 root partition:all data:Selection +└─Selection 13.00 cop[tikv] ge(executor__partition__partition_boundaries.t.a, 0) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a >= 0; +a b +0 0 Filler... +1000000 1000000 Filler ... +1000001 1000001 Filler ... +1000002 1000002 Filler ... +1999998 1999998 Filler ... +1999999 1999999 Filler ... +2000000 2000000 Filler ... +2000001 2000001 Filler ... +2000002 2000002 Filler ... +2999998 2999998 Filler ... +2999999 2999999 Filler ... +999998 999998 Filler ... +999999 999999 Filler ... +explain format='brief' SELECT * FROM t WHERE a < 999998; +id estRows task access object operator info +TableReader 2.00 root partition:p0 data:Selection +└─Selection 2.00 cop[tikv] lt(executor__partition__partition_boundaries.t.a, 999998) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a < 999998; +a b +-2147483648 MIN_INT filler... +0 0 Filler... +explain format='brief' SELECT * FROM t WHERE a > 999998; +id estRows task access object operator info +TableReader 11.00 root partition:all data:Selection +└─Selection 11.00 cop[tikv] gt(executor__partition__partition_boundaries.t.a, 999998) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a > 999998; +a b +1000000 1000000 Filler ... +1000001 1000001 Filler ... +1000002 1000002 Filler ... +1999998 1999998 Filler ... +1999999 1999999 Filler ... +2000000 2000000 Filler ... +2000001 2000001 Filler ... +2000002 2000002 Filler ... +2999998 2999998 Filler ... +2999999 2999999 Filler ... +999999 999999 Filler ... +explain format='brief' SELECT * FROM t WHERE a <= 999998; +id estRows task access object operator info +TableReader 3.00 root partition:p0 data:Selection +└─Selection 3.00 cop[tikv] le(executor__partition__partition_boundaries.t.a, 999998) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a <= 999998; +a b +-2147483648 MIN_INT filler... +0 0 Filler... +999998 999998 Filler ... +explain format='brief' SELECT * FROM t WHERE a >= 999998; +id estRows task access object operator info +TableReader 12.00 root partition:all data:Selection +└─Selection 12.00 cop[tikv] ge(executor__partition__partition_boundaries.t.a, 999998) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a >= 999998; +a b +1000000 1000000 Filler ... +1000001 1000001 Filler ... +1000002 1000002 Filler ... +1999998 1999998 Filler ... +1999999 1999999 Filler ... +2000000 2000000 Filler ... +2000001 2000001 Filler ... +2000002 2000002 Filler ... +2999998 2999998 Filler ... +2999999 2999999 Filler ... +999998 999998 Filler ... +999999 999999 Filler ... +explain format='brief' SELECT * FROM t WHERE a < 999999; +id estRows task access object operator info +TableReader 3.00 root partition:p0 data:Selection +└─Selection 3.00 cop[tikv] lt(executor__partition__partition_boundaries.t.a, 999999) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a < 999999; +a b +-2147483648 MIN_INT filler... +0 0 Filler... +999998 999998 Filler ... +explain format='brief' SELECT * FROM t WHERE a > 999999; +id estRows task access object operator info +TableReader 10.00 root partition:p1,p2 data:Selection +└─Selection 10.00 cop[tikv] gt(executor__partition__partition_boundaries.t.a, 999999) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a > 999999; +a b +1000000 1000000 Filler ... +1000001 1000001 Filler ... +1000002 1000002 Filler ... +1999998 1999998 Filler ... +1999999 1999999 Filler ... +2000000 2000000 Filler ... +2000001 2000001 Filler ... +2000002 2000002 Filler ... +2999998 2999998 Filler ... +2999999 2999999 Filler ... +explain format='brief' SELECT * FROM t WHERE a <= 999999; +id estRows task access object operator info +TableReader 4.00 root partition:p0 data:Selection +└─Selection 4.00 cop[tikv] le(executor__partition__partition_boundaries.t.a, 999999) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a <= 999999; +a b +-2147483648 MIN_INT filler... +0 0 Filler... +999998 999998 Filler ... +999999 999999 Filler ... +explain format='brief' SELECT * FROM t WHERE a >= 999999; +id estRows task access object operator info +TableReader 11.00 root partition:all data:Selection +└─Selection 11.00 cop[tikv] ge(executor__partition__partition_boundaries.t.a, 999999) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a >= 999999; +a b +1000000 1000000 Filler ... +1000001 1000001 Filler ... +1000002 1000002 Filler ... +1999998 1999998 Filler ... +1999999 1999999 Filler ... +2000000 2000000 Filler ... +2000001 2000001 Filler ... +2000002 2000002 Filler ... +2999998 2999998 Filler ... +2999999 2999999 Filler ... +999999 999999 Filler ... +explain format='brief' SELECT * FROM t WHERE a < 1000000; +id estRows task access object operator info +TableReader 4.00 root partition:p0 data:Selection +└─Selection 4.00 cop[tikv] lt(executor__partition__partition_boundaries.t.a, 1000000) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a < 1000000; +a b +-2147483648 MIN_INT filler... +0 0 Filler... +999998 999998 Filler ... +999999 999999 Filler ... +explain format='brief' SELECT * FROM t WHERE a > 1000000; +id estRows task access object operator info +TableReader 9.00 root partition:p1,p2 data:Selection +└─Selection 9.00 cop[tikv] gt(executor__partition__partition_boundaries.t.a, 1000000) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a > 1000000; +a b +1000001 1000001 Filler ... +1000002 1000002 Filler ... +1999998 1999998 Filler ... +1999999 1999999 Filler ... +2000000 2000000 Filler ... +2000001 2000001 Filler ... +2000002 2000002 Filler ... +2999998 2999998 Filler ... +2999999 2999999 Filler ... +explain format='brief' SELECT * FROM t WHERE a <= 1000000; +id estRows task access object operator info +TableReader 5.00 root partition:p0,p1 data:Selection +└─Selection 5.00 cop[tikv] le(executor__partition__partition_boundaries.t.a, 1000000) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a <= 1000000; +a b +-2147483648 MIN_INT filler... +0 0 Filler... +1000000 1000000 Filler ... +999998 999998 Filler ... +999999 999999 Filler ... +explain format='brief' SELECT * FROM t WHERE a >= 1000000; +id estRows task access object operator info +TableReader 10.00 root partition:p1,p2 data:Selection +└─Selection 10.00 cop[tikv] ge(executor__partition__partition_boundaries.t.a, 1000000) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a >= 1000000; +a b +1000000 1000000 Filler ... +1000001 1000001 Filler ... +1000002 1000002 Filler ... +1999998 1999998 Filler ... +1999999 1999999 Filler ... +2000000 2000000 Filler ... +2000001 2000001 Filler ... +2000002 2000002 Filler ... +2999998 2999998 Filler ... +2999999 2999999 Filler ... +explain format='brief' SELECT * FROM t WHERE a < 1000001; +id estRows task access object operator info +TableReader 5.00 root partition:p0,p1 data:Selection +└─Selection 5.00 cop[tikv] lt(executor__partition__partition_boundaries.t.a, 1000001) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a < 1000001; +a b +-2147483648 MIN_INT filler... +0 0 Filler... +1000000 1000000 Filler ... +999998 999998 Filler ... +999999 999999 Filler ... +explain format='brief' SELECT * FROM t WHERE a > 1000001; +id estRows task access object operator info +TableReader 8.00 root partition:p1,p2 data:Selection +└─Selection 8.00 cop[tikv] gt(executor__partition__partition_boundaries.t.a, 1000001) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a > 1000001; +a b +1000002 1000002 Filler ... +1999998 1999998 Filler ... +1999999 1999999 Filler ... +2000000 2000000 Filler ... +2000001 2000001 Filler ... +2000002 2000002 Filler ... +2999998 2999998 Filler ... +2999999 2999999 Filler ... +explain format='brief' SELECT * FROM t WHERE a <= 1000001; +id estRows task access object operator info +TableReader 6.00 root partition:p0,p1 data:Selection +└─Selection 6.00 cop[tikv] le(executor__partition__partition_boundaries.t.a, 1000001) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a <= 1000001; +a b +-2147483648 MIN_INT filler... +0 0 Filler... +1000000 1000000 Filler ... +1000001 1000001 Filler ... +999998 999998 Filler ... +999999 999999 Filler ... +explain format='brief' SELECT * FROM t WHERE a >= 1000001; +id estRows task access object operator info +TableReader 9.00 root partition:p1,p2 data:Selection +└─Selection 9.00 cop[tikv] ge(executor__partition__partition_boundaries.t.a, 1000001) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a >= 1000001; +a b +1000001 1000001 Filler ... +1000002 1000002 Filler ... +1999998 1999998 Filler ... +1999999 1999999 Filler ... +2000000 2000000 Filler ... +2000001 2000001 Filler ... +2000002 2000002 Filler ... +2999998 2999998 Filler ... +2999999 2999999 Filler ... +explain format='brief' SELECT * FROM t WHERE a < 1000002; +id estRows task access object operator info +TableReader 6.00 root partition:p0,p1 data:Selection +└─Selection 6.00 cop[tikv] lt(executor__partition__partition_boundaries.t.a, 1000002) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a < 1000002; +a b +-2147483648 MIN_INT filler... +0 0 Filler... +1000000 1000000 Filler ... +1000001 1000001 Filler ... +999998 999998 Filler ... +999999 999999 Filler ... +explain format='brief' SELECT * FROM t WHERE a > 1000002; +id estRows task access object operator info +TableReader 7.00 root partition:p1,p2 data:Selection +└─Selection 7.00 cop[tikv] gt(executor__partition__partition_boundaries.t.a, 1000002) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a > 1000002; +a b +1999998 1999998 Filler ... +1999999 1999999 Filler ... +2000000 2000000 Filler ... +2000001 2000001 Filler ... +2000002 2000002 Filler ... +2999998 2999998 Filler ... +2999999 2999999 Filler ... +explain format='brief' SELECT * FROM t WHERE a <= 1000002; +id estRows task access object operator info +TableReader 7.00 root partition:p0,p1 data:Selection +└─Selection 7.00 cop[tikv] le(executor__partition__partition_boundaries.t.a, 1000002) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a <= 1000002; +a b +-2147483648 MIN_INT filler... +0 0 Filler... +1000000 1000000 Filler ... +1000001 1000001 Filler ... +1000002 1000002 Filler ... +999998 999998 Filler ... +999999 999999 Filler ... +explain format='brief' SELECT * FROM t WHERE a >= 1000002; +id estRows task access object operator info +TableReader 8.00 root partition:p1,p2 data:Selection +└─Selection 8.00 cop[tikv] ge(executor__partition__partition_boundaries.t.a, 1000002) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a >= 1000002; +a b +1000002 1000002 Filler ... +1999998 1999998 Filler ... +1999999 1999999 Filler ... +2000000 2000000 Filler ... +2000001 2000001 Filler ... +2000002 2000002 Filler ... +2999998 2999998 Filler ... +2999999 2999999 Filler ... +explain format='brief' SELECT * FROM t WHERE a < 3000000; +id estRows task access object operator info +TableReader 14.00 root partition:all data:Selection +└─Selection 14.00 cop[tikv] lt(executor__partition__partition_boundaries.t.a, 3000000) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a < 3000000; +a b +-2147483648 MIN_INT filler... +0 0 Filler... +1000000 1000000 Filler ... +1000001 1000001 Filler ... +1000002 1000002 Filler ... +1999998 1999998 Filler ... +1999999 1999999 Filler ... +2000000 2000000 Filler ... +2000001 2000001 Filler ... +2000002 2000002 Filler ... +2999998 2999998 Filler ... +2999999 2999999 Filler ... +999998 999998 Filler ... +999999 999999 Filler ... +explain format='brief' SELECT * FROM t WHERE a > 3000000; +id estRows task access object operator info +TableReader 1.00 root partition:dual data:Selection +└─Selection 1.00 cop[tikv] gt(executor__partition__partition_boundaries.t.a, 3000000) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a > 3000000; +a b +explain format='brief' SELECT * FROM t WHERE a <= 3000000; +id estRows task access object operator info +TableReader 14.00 root partition:all data:Selection +└─Selection 14.00 cop[tikv] le(executor__partition__partition_boundaries.t.a, 3000000) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a <= 3000000; +a b +-2147483648 MIN_INT filler... +0 0 Filler... +1000000 1000000 Filler ... +1000001 1000001 Filler ... +1000002 1000002 Filler ... +1999998 1999998 Filler ... +1999999 1999999 Filler ... +2000000 2000000 Filler ... +2000001 2000001 Filler ... +2000002 2000002 Filler ... +2999998 2999998 Filler ... +2999999 2999999 Filler ... +999998 999998 Filler ... +999999 999999 Filler ... +explain format='brief' SELECT * FROM t WHERE a >= 3000000; +id estRows task access object operator info +TableReader 1.00 root partition:dual data:Selection +└─Selection 1.00 cop[tikv] ge(executor__partition__partition_boundaries.t.a, 3000000) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a >= 3000000; +a b +explain format='brief' SELECT * FROM t WHERE a < 3000001; +id estRows task access object operator info +TableReader 14.00 root partition:all data:Selection +└─Selection 14.00 cop[tikv] lt(executor__partition__partition_boundaries.t.a, 3000001) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a < 3000001; +a b +-2147483648 MIN_INT filler... +0 0 Filler... +1000000 1000000 Filler ... +1000001 1000001 Filler ... +1000002 1000002 Filler ... +1999998 1999998 Filler ... +1999999 1999999 Filler ... +2000000 2000000 Filler ... +2000001 2000001 Filler ... +2000002 2000002 Filler ... +2999998 2999998 Filler ... +2999999 2999999 Filler ... +999998 999998 Filler ... +999999 999999 Filler ... +explain format='brief' SELECT * FROM t WHERE a > 3000001; +id estRows task access object operator info +TableReader 1.00 root partition:dual data:Selection +└─Selection 1.00 cop[tikv] gt(executor__partition__partition_boundaries.t.a, 3000001) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a > 3000001; +a b +explain format='brief' SELECT * FROM t WHERE a <= 3000001; +id estRows task access object operator info +TableReader 14.00 root partition:all data:Selection +└─Selection 14.00 cop[tikv] le(executor__partition__partition_boundaries.t.a, 3000001) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a <= 3000001; +a b +-2147483648 MIN_INT filler... +0 0 Filler... +1000000 1000000 Filler ... +1000001 1000001 Filler ... +1000002 1000002 Filler ... +1999998 1999998 Filler ... +1999999 1999999 Filler ... +2000000 2000000 Filler ... +2000001 2000001 Filler ... +2000002 2000002 Filler ... +2999998 2999998 Filler ... +2999999 2999999 Filler ... +999998 999998 Filler ... +999999 999999 Filler ... +explain format='brief' SELECT * FROM t WHERE a >= 3000001; +id estRows task access object operator info +TableReader 1.00 root partition:dual data:Selection +└─Selection 1.00 cop[tikv] ge(executor__partition__partition_boundaries.t.a, 3000001) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a >= 3000001; +a b +explain format='brief' SELECT * FROM t WHERE a < 999997; +id estRows task access object operator info +TableReader 2.00 root partition:p0 data:Selection +└─Selection 2.00 cop[tikv] lt(executor__partition__partition_boundaries.t.a, 999997) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a < 999997; +a b +-2147483648 MIN_INT filler... +0 0 Filler... +explain format='brief' SELECT * FROM t WHERE a > 999997; +id estRows task access object operator info +TableReader 12.00 root partition:all data:Selection +└─Selection 12.00 cop[tikv] gt(executor__partition__partition_boundaries.t.a, 999997) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a > 999997; +a b +1000000 1000000 Filler ... +1000001 1000001 Filler ... +1000002 1000002 Filler ... +1999998 1999998 Filler ... +1999999 1999999 Filler ... +2000000 2000000 Filler ... +2000001 2000001 Filler ... +2000002 2000002 Filler ... +2999998 2999998 Filler ... +2999999 2999999 Filler ... +999998 999998 Filler ... +999999 999999 Filler ... +explain format='brief' SELECT * FROM t WHERE a <= 999997; +id estRows task access object operator info +TableReader 2.00 root partition:p0 data:Selection +└─Selection 2.00 cop[tikv] le(executor__partition__partition_boundaries.t.a, 999997) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a <= 999997; +a b +-2147483648 MIN_INT filler... +0 0 Filler... +explain format='brief' SELECT * FROM t WHERE a >= 999997; +id estRows task access object operator info +TableReader 12.00 root partition:all data:Selection +└─Selection 12.00 cop[tikv] ge(executor__partition__partition_boundaries.t.a, 999997) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a >= 999997; +a b +1000000 1000000 Filler ... +1000001 1000001 Filler ... +1000002 1000002 Filler ... +1999998 1999998 Filler ... +1999999 1999999 Filler ... +2000000 2000000 Filler ... +2000001 2000001 Filler ... +2000002 2000002 Filler ... +2999998 2999998 Filler ... +2999999 2999999 Filler ... +999998 999998 Filler ... +999999 999999 Filler ... +explain format='brief' SELECT * FROM t WHERE a >= 999997 AND a <= 999999; +id estRows task access object operator info +TableReader 2.00 root partition:p0 data:Selection +└─Selection 2.00 cop[tikv] ge(executor__partition__partition_boundaries.t.a, 999997), le(executor__partition__partition_boundaries.t.a, 999999) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a >= 999997 AND a <= 999999; +a b +999998 999998 Filler ... +999999 999999 Filler ... +explain format='brief' SELECT * FROM t WHERE a > 999997 AND a <= 999999; +id estRows task access object operator info +TableReader 2.00 root partition:p0 data:Selection +└─Selection 2.00 cop[tikv] gt(executor__partition__partition_boundaries.t.a, 999997), le(executor__partition__partition_boundaries.t.a, 999999) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a > 999997 AND a <= 999999; +a b +999998 999998 Filler ... +999999 999999 Filler ... +explain format='brief' SELECT * FROM t WHERE a > 999997 AND a < 999999; +id estRows task access object operator info +TableReader 1.00 root partition:p0 data:Selection +└─Selection 1.00 cop[tikv] gt(executor__partition__partition_boundaries.t.a, 999997), lt(executor__partition__partition_boundaries.t.a, 999999) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a > 999997 AND a < 999999; +a b +999998 999998 Filler ... +explain format='brief' SELECT * FROM t WHERE a > 999997 AND a <= 999999; +id estRows task access object operator info +TableReader 2.00 root partition:p0 data:Selection +└─Selection 2.00 cop[tikv] gt(executor__partition__partition_boundaries.t.a, 999997), le(executor__partition__partition_boundaries.t.a, 999999) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a > 999997 AND a <= 999999; +a b +999998 999998 Filler ... +999999 999999 Filler ... +explain format='brief' SELECT * FROM t WHERE a < 999998; +id estRows task access object operator info +TableReader 2.00 root partition:p0 data:Selection +└─Selection 2.00 cop[tikv] lt(executor__partition__partition_boundaries.t.a, 999998) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a < 999998; +a b +-2147483648 MIN_INT filler... +0 0 Filler... +explain format='brief' SELECT * FROM t WHERE a > 999998; +id estRows task access object operator info +TableReader 11.00 root partition:all data:Selection +└─Selection 11.00 cop[tikv] gt(executor__partition__partition_boundaries.t.a, 999998) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a > 999998; +a b +1000000 1000000 Filler ... +1000001 1000001 Filler ... +1000002 1000002 Filler ... +1999998 1999998 Filler ... +1999999 1999999 Filler ... +2000000 2000000 Filler ... +2000001 2000001 Filler ... +2000002 2000002 Filler ... +2999998 2999998 Filler ... +2999999 2999999 Filler ... +999999 999999 Filler ... +explain format='brief' SELECT * FROM t WHERE a <= 999998; +id estRows task access object operator info +TableReader 3.00 root partition:p0 data:Selection +└─Selection 3.00 cop[tikv] le(executor__partition__partition_boundaries.t.a, 999998) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a <= 999998; +a b +-2147483648 MIN_INT filler... +0 0 Filler... +999998 999998 Filler ... +explain format='brief' SELECT * FROM t WHERE a >= 999998; +id estRows task access object operator info +TableReader 12.00 root partition:all data:Selection +└─Selection 12.00 cop[tikv] ge(executor__partition__partition_boundaries.t.a, 999998) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a >= 999998; +a b +1000000 1000000 Filler ... +1000001 1000001 Filler ... +1000002 1000002 Filler ... +1999998 1999998 Filler ... +1999999 1999999 Filler ... +2000000 2000000 Filler ... +2000001 2000001 Filler ... +2000002 2000002 Filler ... +2999998 2999998 Filler ... +2999999 2999999 Filler ... +999998 999998 Filler ... +999999 999999 Filler ... +explain format='brief' SELECT * FROM t WHERE a >= 999998 AND a <= 1000000; +id estRows task access object operator info +TableReader 3.00 root partition:p0,p1 data:Selection +└─Selection 3.00 cop[tikv] ge(executor__partition__partition_boundaries.t.a, 999998), le(executor__partition__partition_boundaries.t.a, 1000000) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a >= 999998 AND a <= 1000000; +a b +1000000 1000000 Filler ... +999998 999998 Filler ... +999999 999999 Filler ... +explain format='brief' SELECT * FROM t WHERE a > 999998 AND a <= 1000000; +id estRows task access object operator info +TableReader 2.00 root partition:p0,p1 data:Selection +└─Selection 2.00 cop[tikv] gt(executor__partition__partition_boundaries.t.a, 999998), le(executor__partition__partition_boundaries.t.a, 1000000) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a > 999998 AND a <= 1000000; +a b +1000000 1000000 Filler ... +999999 999999 Filler ... +explain format='brief' SELECT * FROM t WHERE a > 999998 AND a < 1000000; +id estRows task access object operator info +TableReader 1.00 root partition:p0 data:Selection +└─Selection 1.00 cop[tikv] gt(executor__partition__partition_boundaries.t.a, 999998), lt(executor__partition__partition_boundaries.t.a, 1000000) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a > 999998 AND a < 1000000; +a b +999999 999999 Filler ... +explain format='brief' SELECT * FROM t WHERE a > 999998 AND a <= 1000000; +id estRows task access object operator info +TableReader 2.00 root partition:p0,p1 data:Selection +└─Selection 2.00 cop[tikv] gt(executor__partition__partition_boundaries.t.a, 999998), le(executor__partition__partition_boundaries.t.a, 1000000) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a > 999998 AND a <= 1000000; +a b +1000000 1000000 Filler ... +999999 999999 Filler ... +explain format='brief' SELECT * FROM t WHERE a < 999999; +id estRows task access object operator info +TableReader 3.00 root partition:p0 data:Selection +└─Selection 3.00 cop[tikv] lt(executor__partition__partition_boundaries.t.a, 999999) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a < 999999; +a b +-2147483648 MIN_INT filler... +0 0 Filler... +999998 999998 Filler ... +explain format='brief' SELECT * FROM t WHERE a > 999999; +id estRows task access object operator info +TableReader 10.00 root partition:p1,p2 data:Selection +└─Selection 10.00 cop[tikv] gt(executor__partition__partition_boundaries.t.a, 999999) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a > 999999; +a b +1000000 1000000 Filler ... +1000001 1000001 Filler ... +1000002 1000002 Filler ... +1999998 1999998 Filler ... +1999999 1999999 Filler ... +2000000 2000000 Filler ... +2000001 2000001 Filler ... +2000002 2000002 Filler ... +2999998 2999998 Filler ... +2999999 2999999 Filler ... +explain format='brief' SELECT * FROM t WHERE a <= 999999; +id estRows task access object operator info +TableReader 4.00 root partition:p0 data:Selection +└─Selection 4.00 cop[tikv] le(executor__partition__partition_boundaries.t.a, 999999) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a <= 999999; +a b +-2147483648 MIN_INT filler... +0 0 Filler... +999998 999998 Filler ... +999999 999999 Filler ... +explain format='brief' SELECT * FROM t WHERE a >= 999999; +id estRows task access object operator info +TableReader 11.00 root partition:all data:Selection +└─Selection 11.00 cop[tikv] ge(executor__partition__partition_boundaries.t.a, 999999) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a >= 999999; +a b +1000000 1000000 Filler ... +1000001 1000001 Filler ... +1000002 1000002 Filler ... +1999998 1999998 Filler ... +1999999 1999999 Filler ... +2000000 2000000 Filler ... +2000001 2000001 Filler ... +2000002 2000002 Filler ... +2999998 2999998 Filler ... +2999999 2999999 Filler ... +999999 999999 Filler ... +explain format='brief' SELECT * FROM t WHERE a >= 999999 AND a <= 1000001; +id estRows task access object operator info +TableReader 3.00 root partition:p0,p1 data:Selection +└─Selection 3.00 cop[tikv] ge(executor__partition__partition_boundaries.t.a, 999999), le(executor__partition__partition_boundaries.t.a, 1000001) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a >= 999999 AND a <= 1000001; +a b +1000000 1000000 Filler ... +1000001 1000001 Filler ... +999999 999999 Filler ... +explain format='brief' SELECT * FROM t WHERE a > 999999 AND a <= 1000001; +id estRows task access object operator info +TableReader 2.00 root partition:p1 data:Selection +└─Selection 2.00 cop[tikv] gt(executor__partition__partition_boundaries.t.a, 999999), le(executor__partition__partition_boundaries.t.a, 1000001) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a > 999999 AND a <= 1000001; +a b +1000000 1000000 Filler ... +1000001 1000001 Filler ... +explain format='brief' SELECT * FROM t WHERE a > 999999 AND a < 1000001; +id estRows task access object operator info +TableReader 1.00 root partition:p1 data:Selection +└─Selection 1.00 cop[tikv] gt(executor__partition__partition_boundaries.t.a, 999999), lt(executor__partition__partition_boundaries.t.a, 1000001) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a > 999999 AND a < 1000001; +a b +1000000 1000000 Filler ... +explain format='brief' SELECT * FROM t WHERE a > 999999 AND a <= 1000001; +id estRows task access object operator info +TableReader 2.00 root partition:p1 data:Selection +└─Selection 2.00 cop[tikv] gt(executor__partition__partition_boundaries.t.a, 999999), le(executor__partition__partition_boundaries.t.a, 1000001) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a > 999999 AND a <= 1000001; +a b +1000000 1000000 Filler ... +1000001 1000001 Filler ... +explain format='brief' SELECT * FROM t WHERE a < 1000000; +id estRows task access object operator info +TableReader 4.00 root partition:p0 data:Selection +└─Selection 4.00 cop[tikv] lt(executor__partition__partition_boundaries.t.a, 1000000) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a < 1000000; +a b +-2147483648 MIN_INT filler... +0 0 Filler... +999998 999998 Filler ... +999999 999999 Filler ... +explain format='brief' SELECT * FROM t WHERE a > 1000000; +id estRows task access object operator info +TableReader 9.00 root partition:p1,p2 data:Selection +└─Selection 9.00 cop[tikv] gt(executor__partition__partition_boundaries.t.a, 1000000) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a > 1000000; +a b +1000001 1000001 Filler ... +1000002 1000002 Filler ... +1999998 1999998 Filler ... +1999999 1999999 Filler ... +2000000 2000000 Filler ... +2000001 2000001 Filler ... +2000002 2000002 Filler ... +2999998 2999998 Filler ... +2999999 2999999 Filler ... +explain format='brief' SELECT * FROM t WHERE a <= 1000000; +id estRows task access object operator info +TableReader 5.00 root partition:p0,p1 data:Selection +└─Selection 5.00 cop[tikv] le(executor__partition__partition_boundaries.t.a, 1000000) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a <= 1000000; +a b +-2147483648 MIN_INT filler... +0 0 Filler... +1000000 1000000 Filler ... +999998 999998 Filler ... +999999 999999 Filler ... +explain format='brief' SELECT * FROM t WHERE a >= 1000000; +id estRows task access object operator info +TableReader 10.00 root partition:p1,p2 data:Selection +└─Selection 10.00 cop[tikv] ge(executor__partition__partition_boundaries.t.a, 1000000) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a >= 1000000; +a b +1000000 1000000 Filler ... +1000001 1000001 Filler ... +1000002 1000002 Filler ... +1999998 1999998 Filler ... +1999999 1999999 Filler ... +2000000 2000000 Filler ... +2000001 2000001 Filler ... +2000002 2000002 Filler ... +2999998 2999998 Filler ... +2999999 2999999 Filler ... +explain format='brief' SELECT * FROM t WHERE a >= 1000000 AND a <= 1000002; +id estRows task access object operator info +TableReader 3.00 root partition:p1 data:Selection +└─Selection 3.00 cop[tikv] ge(executor__partition__partition_boundaries.t.a, 1000000), le(executor__partition__partition_boundaries.t.a, 1000002) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a >= 1000000 AND a <= 1000002; +a b +1000000 1000000 Filler ... +1000001 1000001 Filler ... +1000002 1000002 Filler ... +explain format='brief' SELECT * FROM t WHERE a > 1000000 AND a <= 1000002; +id estRows task access object operator info +TableReader 2.00 root partition:p1 data:Selection +└─Selection 2.00 cop[tikv] gt(executor__partition__partition_boundaries.t.a, 1000000), le(executor__partition__partition_boundaries.t.a, 1000002) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a > 1000000 AND a <= 1000002; +a b +1000001 1000001 Filler ... +1000002 1000002 Filler ... +explain format='brief' SELECT * FROM t WHERE a > 1000000 AND a < 1000002; +id estRows task access object operator info +TableReader 1.00 root partition:p1 data:Selection +└─Selection 1.00 cop[tikv] gt(executor__partition__partition_boundaries.t.a, 1000000), lt(executor__partition__partition_boundaries.t.a, 1000002) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a > 1000000 AND a < 1000002; +a b +1000001 1000001 Filler ... +explain format='brief' SELECT * FROM t WHERE a > 1000000 AND a <= 1000002; +id estRows task access object operator info +TableReader 2.00 root partition:p1 data:Selection +└─Selection 2.00 cop[tikv] gt(executor__partition__partition_boundaries.t.a, 1000000), le(executor__partition__partition_boundaries.t.a, 1000002) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a > 1000000 AND a <= 1000002; +a b +1000001 1000001 Filler ... +1000002 1000002 Filler ... +explain format='brief' SELECT * FROM t WHERE a < 1999997; +id estRows task access object operator info +TableReader 7.00 root partition:p0,p1 data:Selection +└─Selection 7.00 cop[tikv] lt(executor__partition__partition_boundaries.t.a, 1999997) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a < 1999997; +a b +-2147483648 MIN_INT filler... +0 0 Filler... +1000000 1000000 Filler ... +1000001 1000001 Filler ... +1000002 1000002 Filler ... +999998 999998 Filler ... +999999 999999 Filler ... +explain format='brief' SELECT * FROM t WHERE a > 1999997; +id estRows task access object operator info +TableReader 7.00 root partition:p1,p2 data:Selection +└─Selection 7.00 cop[tikv] gt(executor__partition__partition_boundaries.t.a, 1999997) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a > 1999997; +a b +1999998 1999998 Filler ... +1999999 1999999 Filler ... +2000000 2000000 Filler ... +2000001 2000001 Filler ... +2000002 2000002 Filler ... +2999998 2999998 Filler ... +2999999 2999999 Filler ... +explain format='brief' SELECT * FROM t WHERE a <= 1999997; +id estRows task access object operator info +TableReader 7.00 root partition:p0,p1 data:Selection +└─Selection 7.00 cop[tikv] le(executor__partition__partition_boundaries.t.a, 1999997) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a <= 1999997; +a b +-2147483648 MIN_INT filler... +0 0 Filler... +1000000 1000000 Filler ... +1000001 1000001 Filler ... +1000002 1000002 Filler ... +999998 999998 Filler ... +999999 999999 Filler ... +explain format='brief' SELECT * FROM t WHERE a >= 1999997; +id estRows task access object operator info +TableReader 7.00 root partition:p1,p2 data:Selection +└─Selection 7.00 cop[tikv] ge(executor__partition__partition_boundaries.t.a, 1999997) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a >= 1999997; +a b +1999998 1999998 Filler ... +1999999 1999999 Filler ... +2000000 2000000 Filler ... +2000001 2000001 Filler ... +2000002 2000002 Filler ... +2999998 2999998 Filler ... +2999999 2999999 Filler ... +explain format='brief' SELECT * FROM t WHERE a >= 1999997 AND a <= 1999999; +id estRows task access object operator info +TableReader 2.00 root partition:p1 data:Selection +└─Selection 2.00 cop[tikv] ge(executor__partition__partition_boundaries.t.a, 1999997), le(executor__partition__partition_boundaries.t.a, 1999999) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a >= 1999997 AND a <= 1999999; +a b +1999998 1999998 Filler ... +1999999 1999999 Filler ... +explain format='brief' SELECT * FROM t WHERE a > 1999997 AND a <= 1999999; +id estRows task access object operator info +TableReader 2.00 root partition:p1 data:Selection +└─Selection 2.00 cop[tikv] gt(executor__partition__partition_boundaries.t.a, 1999997), le(executor__partition__partition_boundaries.t.a, 1999999) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a > 1999997 AND a <= 1999999; +a b +1999998 1999998 Filler ... +1999999 1999999 Filler ... +explain format='brief' SELECT * FROM t WHERE a > 1999997 AND a < 1999999; +id estRows task access object operator info +TableReader 1.00 root partition:p1 data:Selection +└─Selection 1.00 cop[tikv] gt(executor__partition__partition_boundaries.t.a, 1999997), lt(executor__partition__partition_boundaries.t.a, 1999999) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a > 1999997 AND a < 1999999; +a b +1999998 1999998 Filler ... +explain format='brief' SELECT * FROM t WHERE a > 1999997 AND a <= 1999999; +id estRows task access object operator info +TableReader 2.00 root partition:p1 data:Selection +└─Selection 2.00 cop[tikv] gt(executor__partition__partition_boundaries.t.a, 1999997), le(executor__partition__partition_boundaries.t.a, 1999999) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a > 1999997 AND a <= 1999999; +a b +1999998 1999998 Filler ... +1999999 1999999 Filler ... +explain format='brief' SELECT * FROM t WHERE a < 1999998; +id estRows task access object operator info +TableReader 7.00 root partition:p0,p1 data:Selection +└─Selection 7.00 cop[tikv] lt(executor__partition__partition_boundaries.t.a, 1999998) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a < 1999998; +a b +-2147483648 MIN_INT filler... +0 0 Filler... +1000000 1000000 Filler ... +1000001 1000001 Filler ... +1000002 1000002 Filler ... +999998 999998 Filler ... +999999 999999 Filler ... +explain format='brief' SELECT * FROM t WHERE a > 1999998; +id estRows task access object operator info +TableReader 6.00 root partition:p1,p2 data:Selection +└─Selection 6.00 cop[tikv] gt(executor__partition__partition_boundaries.t.a, 1999998) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a > 1999998; +a b +1999999 1999999 Filler ... +2000000 2000000 Filler ... +2000001 2000001 Filler ... +2000002 2000002 Filler ... +2999998 2999998 Filler ... +2999999 2999999 Filler ... +explain format='brief' SELECT * FROM t WHERE a <= 1999998; +id estRows task access object operator info +TableReader 8.00 root partition:p0,p1 data:Selection +└─Selection 8.00 cop[tikv] le(executor__partition__partition_boundaries.t.a, 1999998) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a <= 1999998; +a b +-2147483648 MIN_INT filler... +0 0 Filler... +1000000 1000000 Filler ... +1000001 1000001 Filler ... +1000002 1000002 Filler ... +1999998 1999998 Filler ... +999998 999998 Filler ... +999999 999999 Filler ... +explain format='brief' SELECT * FROM t WHERE a >= 1999998; +id estRows task access object operator info +TableReader 7.00 root partition:p1,p2 data:Selection +└─Selection 7.00 cop[tikv] ge(executor__partition__partition_boundaries.t.a, 1999998) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a >= 1999998; +a b +1999998 1999998 Filler ... +1999999 1999999 Filler ... +2000000 2000000 Filler ... +2000001 2000001 Filler ... +2000002 2000002 Filler ... +2999998 2999998 Filler ... +2999999 2999999 Filler ... +explain format='brief' SELECT * FROM t WHERE a >= 1999998 AND a <= 2000000; +id estRows task access object operator info +TableReader 3.00 root partition:p1,p2 data:Selection +└─Selection 3.00 cop[tikv] ge(executor__partition__partition_boundaries.t.a, 1999998), le(executor__partition__partition_boundaries.t.a, 2000000) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a >= 1999998 AND a <= 2000000; +a b +1999998 1999998 Filler ... +1999999 1999999 Filler ... +2000000 2000000 Filler ... +explain format='brief' SELECT * FROM t WHERE a > 1999998 AND a <= 2000000; +id estRows task access object operator info +TableReader 2.00 root partition:p1,p2 data:Selection +└─Selection 2.00 cop[tikv] gt(executor__partition__partition_boundaries.t.a, 1999998), le(executor__partition__partition_boundaries.t.a, 2000000) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a > 1999998 AND a <= 2000000; +a b +1999999 1999999 Filler ... +2000000 2000000 Filler ... +explain format='brief' SELECT * FROM t WHERE a > 1999998 AND a < 2000000; +id estRows task access object operator info +TableReader 1.00 root partition:p1 data:Selection +└─Selection 1.00 cop[tikv] gt(executor__partition__partition_boundaries.t.a, 1999998), lt(executor__partition__partition_boundaries.t.a, 2000000) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a > 1999998 AND a < 2000000; +a b +1999999 1999999 Filler ... +explain format='brief' SELECT * FROM t WHERE a > 1999998 AND a <= 2000000; +id estRows task access object operator info +TableReader 2.00 root partition:p1,p2 data:Selection +└─Selection 2.00 cop[tikv] gt(executor__partition__partition_boundaries.t.a, 1999998), le(executor__partition__partition_boundaries.t.a, 2000000) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a > 1999998 AND a <= 2000000; +a b +1999999 1999999 Filler ... +2000000 2000000 Filler ... +explain format='brief' SELECT * FROM t WHERE a < 1999999; +id estRows task access object operator info +TableReader 8.00 root partition:p0,p1 data:Selection +└─Selection 8.00 cop[tikv] lt(executor__partition__partition_boundaries.t.a, 1999999) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a < 1999999; +a b +-2147483648 MIN_INT filler... +0 0 Filler... +1000000 1000000 Filler ... +1000001 1000001 Filler ... +1000002 1000002 Filler ... +1999998 1999998 Filler ... +999998 999998 Filler ... +999999 999999 Filler ... +explain format='brief' SELECT * FROM t WHERE a > 1999999; +id estRows task access object operator info +TableReader 5.00 root partition:p2 data:Selection +└─Selection 5.00 cop[tikv] gt(executor__partition__partition_boundaries.t.a, 1999999) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a > 1999999; +a b +2000000 2000000 Filler ... +2000001 2000001 Filler ... +2000002 2000002 Filler ... +2999998 2999998 Filler ... +2999999 2999999 Filler ... +explain format='brief' SELECT * FROM t WHERE a <= 1999999; +id estRows task access object operator info +TableReader 9.00 root partition:p0,p1 data:Selection +└─Selection 9.00 cop[tikv] le(executor__partition__partition_boundaries.t.a, 1999999) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a <= 1999999; +a b +-2147483648 MIN_INT filler... +0 0 Filler... +1000000 1000000 Filler ... +1000001 1000001 Filler ... +1000002 1000002 Filler ... +1999998 1999998 Filler ... +1999999 1999999 Filler ... +999998 999998 Filler ... +999999 999999 Filler ... +explain format='brief' SELECT * FROM t WHERE a >= 1999999; +id estRows task access object operator info +TableReader 6.00 root partition:p1,p2 data:Selection +└─Selection 6.00 cop[tikv] ge(executor__partition__partition_boundaries.t.a, 1999999) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a >= 1999999; +a b +1999999 1999999 Filler ... +2000000 2000000 Filler ... +2000001 2000001 Filler ... +2000002 2000002 Filler ... +2999998 2999998 Filler ... +2999999 2999999 Filler ... +explain format='brief' SELECT * FROM t WHERE a >= 1999999 AND a <= 2000001; +id estRows task access object operator info +TableReader 3.00 root partition:p1,p2 data:Selection +└─Selection 3.00 cop[tikv] ge(executor__partition__partition_boundaries.t.a, 1999999), le(executor__partition__partition_boundaries.t.a, 2000001) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a >= 1999999 AND a <= 2000001; +a b +1999999 1999999 Filler ... +2000000 2000000 Filler ... +2000001 2000001 Filler ... +explain format='brief' SELECT * FROM t WHERE a > 1999999 AND a <= 2000001; +id estRows task access object operator info +TableReader 2.00 root partition:p2 data:Selection +└─Selection 2.00 cop[tikv] gt(executor__partition__partition_boundaries.t.a, 1999999), le(executor__partition__partition_boundaries.t.a, 2000001) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a > 1999999 AND a <= 2000001; +a b +2000000 2000000 Filler ... +2000001 2000001 Filler ... +explain format='brief' SELECT * FROM t WHERE a > 1999999 AND a < 2000001; +id estRows task access object operator info +TableReader 1.00 root partition:p2 data:Selection +└─Selection 1.00 cop[tikv] gt(executor__partition__partition_boundaries.t.a, 1999999), lt(executor__partition__partition_boundaries.t.a, 2000001) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a > 1999999 AND a < 2000001; +a b +2000000 2000000 Filler ... +explain format='brief' SELECT * FROM t WHERE a > 1999999 AND a <= 2000001; +id estRows task access object operator info +TableReader 2.00 root partition:p2 data:Selection +└─Selection 2.00 cop[tikv] gt(executor__partition__partition_boundaries.t.a, 1999999), le(executor__partition__partition_boundaries.t.a, 2000001) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a > 1999999 AND a <= 2000001; +a b +2000000 2000000 Filler ... +2000001 2000001 Filler ... +explain format='brief' SELECT * FROM t WHERE a < 2000000; +id estRows task access object operator info +TableReader 9.00 root partition:p0,p1 data:Selection +└─Selection 9.00 cop[tikv] lt(executor__partition__partition_boundaries.t.a, 2000000) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a < 2000000; +a b +-2147483648 MIN_INT filler... +0 0 Filler... +1000000 1000000 Filler ... +1000001 1000001 Filler ... +1000002 1000002 Filler ... +1999998 1999998 Filler ... +1999999 1999999 Filler ... +999998 999998 Filler ... +999999 999999 Filler ... +explain format='brief' SELECT * FROM t WHERE a > 2000000; +id estRows task access object operator info +TableReader 4.00 root partition:p2 data:Selection +└─Selection 4.00 cop[tikv] gt(executor__partition__partition_boundaries.t.a, 2000000) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a > 2000000; +a b +2000001 2000001 Filler ... +2000002 2000002 Filler ... +2999998 2999998 Filler ... +2999999 2999999 Filler ... +explain format='brief' SELECT * FROM t WHERE a <= 2000000; +id estRows task access object operator info +TableReader 10.00 root partition:all data:Selection +└─Selection 10.00 cop[tikv] le(executor__partition__partition_boundaries.t.a, 2000000) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a <= 2000000; +a b +-2147483648 MIN_INT filler... +0 0 Filler... +1000000 1000000 Filler ... +1000001 1000001 Filler ... +1000002 1000002 Filler ... +1999998 1999998 Filler ... +1999999 1999999 Filler ... +2000000 2000000 Filler ... +999998 999998 Filler ... +999999 999999 Filler ... +explain format='brief' SELECT * FROM t WHERE a >= 2000000; +id estRows task access object operator info +TableReader 5.00 root partition:p2 data:Selection +└─Selection 5.00 cop[tikv] ge(executor__partition__partition_boundaries.t.a, 2000000) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a >= 2000000; +a b +2000000 2000000 Filler ... +2000001 2000001 Filler ... +2000002 2000002 Filler ... +2999998 2999998 Filler ... +2999999 2999999 Filler ... +explain format='brief' SELECT * FROM t WHERE a >= 2000000 AND a <= 2000002; +id estRows task access object operator info +TableReader 3.00 root partition:p2 data:Selection +└─Selection 3.00 cop[tikv] ge(executor__partition__partition_boundaries.t.a, 2000000), le(executor__partition__partition_boundaries.t.a, 2000002) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a >= 2000000 AND a <= 2000002; +a b +2000000 2000000 Filler ... +2000001 2000001 Filler ... +2000002 2000002 Filler ... +explain format='brief' SELECT * FROM t WHERE a > 2000000 AND a <= 2000002; +id estRows task access object operator info +TableReader 2.00 root partition:p2 data:Selection +└─Selection 2.00 cop[tikv] gt(executor__partition__partition_boundaries.t.a, 2000000), le(executor__partition__partition_boundaries.t.a, 2000002) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a > 2000000 AND a <= 2000002; +a b +2000001 2000001 Filler ... +2000002 2000002 Filler ... +explain format='brief' SELECT * FROM t WHERE a > 2000000 AND a < 2000002; +id estRows task access object operator info +TableReader 1.00 root partition:p2 data:Selection +└─Selection 1.00 cop[tikv] gt(executor__partition__partition_boundaries.t.a, 2000000), lt(executor__partition__partition_boundaries.t.a, 2000002) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a > 2000000 AND a < 2000002; +a b +2000001 2000001 Filler ... +explain format='brief' SELECT * FROM t WHERE a > 2000000 AND a <= 2000002; +id estRows task access object operator info +TableReader 2.00 root partition:p2 data:Selection +└─Selection 2.00 cop[tikv] gt(executor__partition__partition_boundaries.t.a, 2000000), le(executor__partition__partition_boundaries.t.a, 2000002) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a > 2000000 AND a <= 2000002; +a b +2000001 2000001 Filler ... +2000002 2000002 Filler ... +explain format='brief' SELECT * FROM t WHERE a < 2999997; +id estRows task access object operator info +TableReader 12.00 root partition:all data:Selection +└─Selection 12.00 cop[tikv] lt(executor__partition__partition_boundaries.t.a, 2999997) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a < 2999997; +a b +-2147483648 MIN_INT filler... +0 0 Filler... +1000000 1000000 Filler ... +1000001 1000001 Filler ... +1000002 1000002 Filler ... +1999998 1999998 Filler ... +1999999 1999999 Filler ... +2000000 2000000 Filler ... +2000001 2000001 Filler ... +2000002 2000002 Filler ... +999998 999998 Filler ... +999999 999999 Filler ... +explain format='brief' SELECT * FROM t WHERE a > 2999997; +id estRows task access object operator info +TableReader 2.00 root partition:p2 data:Selection +└─Selection 2.00 cop[tikv] gt(executor__partition__partition_boundaries.t.a, 2999997) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a > 2999997; +a b +2999998 2999998 Filler ... +2999999 2999999 Filler ... +explain format='brief' SELECT * FROM t WHERE a <= 2999997; +id estRows task access object operator info +TableReader 12.00 root partition:all data:Selection +└─Selection 12.00 cop[tikv] le(executor__partition__partition_boundaries.t.a, 2999997) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a <= 2999997; +a b +-2147483648 MIN_INT filler... +0 0 Filler... +1000000 1000000 Filler ... +1000001 1000001 Filler ... +1000002 1000002 Filler ... +1999998 1999998 Filler ... +1999999 1999999 Filler ... +2000000 2000000 Filler ... +2000001 2000001 Filler ... +2000002 2000002 Filler ... +999998 999998 Filler ... +999999 999999 Filler ... +explain format='brief' SELECT * FROM t WHERE a >= 2999997; +id estRows task access object operator info +TableReader 2.00 root partition:p2 data:Selection +└─Selection 2.00 cop[tikv] ge(executor__partition__partition_boundaries.t.a, 2999997) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a >= 2999997; +a b +2999998 2999998 Filler ... +2999999 2999999 Filler ... +explain format='brief' SELECT * FROM t WHERE a >= 2999997 AND a <= 2999999; +id estRows task access object operator info +TableReader 2.00 root partition:p2 data:Selection +└─Selection 2.00 cop[tikv] ge(executor__partition__partition_boundaries.t.a, 2999997), le(executor__partition__partition_boundaries.t.a, 2999999) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a >= 2999997 AND a <= 2999999; +a b +2999998 2999998 Filler ... +2999999 2999999 Filler ... +explain format='brief' SELECT * FROM t WHERE a > 2999997 AND a <= 2999999; +id estRows task access object operator info +TableReader 2.00 root partition:p2 data:Selection +└─Selection 2.00 cop[tikv] gt(executor__partition__partition_boundaries.t.a, 2999997), le(executor__partition__partition_boundaries.t.a, 2999999) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a > 2999997 AND a <= 2999999; +a b +2999998 2999998 Filler ... +2999999 2999999 Filler ... +explain format='brief' SELECT * FROM t WHERE a > 2999997 AND a < 2999999; +id estRows task access object operator info +TableReader 1.00 root partition:p2 data:Selection +└─Selection 1.00 cop[tikv] gt(executor__partition__partition_boundaries.t.a, 2999997), lt(executor__partition__partition_boundaries.t.a, 2999999) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a > 2999997 AND a < 2999999; +a b +2999998 2999998 Filler ... +explain format='brief' SELECT * FROM t WHERE a > 2999997 AND a <= 2999999; +id estRows task access object operator info +TableReader 2.00 root partition:p2 data:Selection +└─Selection 2.00 cop[tikv] gt(executor__partition__partition_boundaries.t.a, 2999997), le(executor__partition__partition_boundaries.t.a, 2999999) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a > 2999997 AND a <= 2999999; +a b +2999998 2999998 Filler ... +2999999 2999999 Filler ... +explain format='brief' SELECT * FROM t WHERE a < 2999998; +id estRows task access object operator info +TableReader 12.00 root partition:all data:Selection +└─Selection 12.00 cop[tikv] lt(executor__partition__partition_boundaries.t.a, 2999998) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a < 2999998; +a b +-2147483648 MIN_INT filler... +0 0 Filler... +1000000 1000000 Filler ... +1000001 1000001 Filler ... +1000002 1000002 Filler ... +1999998 1999998 Filler ... +1999999 1999999 Filler ... +2000000 2000000 Filler ... +2000001 2000001 Filler ... +2000002 2000002 Filler ... +999998 999998 Filler ... +999999 999999 Filler ... +explain format='brief' SELECT * FROM t WHERE a > 2999998; +id estRows task access object operator info +TableReader 1.00 root partition:p2 data:Selection +└─Selection 1.00 cop[tikv] gt(executor__partition__partition_boundaries.t.a, 2999998) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a > 2999998; +a b +2999999 2999999 Filler ... +explain format='brief' SELECT * FROM t WHERE a <= 2999998; +id estRows task access object operator info +TableReader 13.00 root partition:all data:Selection +└─Selection 13.00 cop[tikv] le(executor__partition__partition_boundaries.t.a, 2999998) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a <= 2999998; +a b +-2147483648 MIN_INT filler... +0 0 Filler... +1000000 1000000 Filler ... +1000001 1000001 Filler ... +1000002 1000002 Filler ... +1999998 1999998 Filler ... +1999999 1999999 Filler ... +2000000 2000000 Filler ... +2000001 2000001 Filler ... +2000002 2000002 Filler ... +2999998 2999998 Filler ... +999998 999998 Filler ... +999999 999999 Filler ... +explain format='brief' SELECT * FROM t WHERE a >= 2999998; +id estRows task access object operator info +TableReader 2.00 root partition:p2 data:Selection +└─Selection 2.00 cop[tikv] ge(executor__partition__partition_boundaries.t.a, 2999998) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a >= 2999998; +a b +2999998 2999998 Filler ... +2999999 2999999 Filler ... +explain format='brief' SELECT * FROM t WHERE a >= 2999998 AND a <= 3000000; +id estRows task access object operator info +TableReader 2.00 root partition:p2 data:Selection +└─Selection 2.00 cop[tikv] ge(executor__partition__partition_boundaries.t.a, 2999998), le(executor__partition__partition_boundaries.t.a, 3000000) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a >= 2999998 AND a <= 3000000; +a b +2999998 2999998 Filler ... +2999999 2999999 Filler ... +explain format='brief' SELECT * FROM t WHERE a > 2999998 AND a <= 3000000; +id estRows task access object operator info +TableReader 1.00 root partition:p2 data:Selection +└─Selection 1.00 cop[tikv] gt(executor__partition__partition_boundaries.t.a, 2999998), le(executor__partition__partition_boundaries.t.a, 3000000) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a > 2999998 AND a <= 3000000; +a b +2999999 2999999 Filler ... +explain format='brief' SELECT * FROM t WHERE a > 2999998 AND a < 3000000; +id estRows task access object operator info +TableReader 1.00 root partition:p2 data:Selection +└─Selection 1.00 cop[tikv] gt(executor__partition__partition_boundaries.t.a, 2999998), lt(executor__partition__partition_boundaries.t.a, 3000000) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a > 2999998 AND a < 3000000; +a b +2999999 2999999 Filler ... +explain format='brief' SELECT * FROM t WHERE a > 2999998 AND a <= 3000000; +id estRows task access object operator info +TableReader 1.00 root partition:p2 data:Selection +└─Selection 1.00 cop[tikv] gt(executor__partition__partition_boundaries.t.a, 2999998), le(executor__partition__partition_boundaries.t.a, 3000000) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a > 2999998 AND a <= 3000000; +a b +2999999 2999999 Filler ... +explain format='brief' SELECT * FROM t WHERE a < 2999999; +id estRows task access object operator info +TableReader 13.00 root partition:all data:Selection +└─Selection 13.00 cop[tikv] lt(executor__partition__partition_boundaries.t.a, 2999999) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a < 2999999; +a b +-2147483648 MIN_INT filler... +0 0 Filler... +1000000 1000000 Filler ... +1000001 1000001 Filler ... +1000002 1000002 Filler ... +1999998 1999998 Filler ... +1999999 1999999 Filler ... +2000000 2000000 Filler ... +2000001 2000001 Filler ... +2000002 2000002 Filler ... +2999998 2999998 Filler ... +999998 999998 Filler ... +999999 999999 Filler ... +explain format='brief' SELECT * FROM t WHERE a > 2999999; +id estRows task access object operator info +TableReader 1.00 root partition:dual data:Selection +└─Selection 1.00 cop[tikv] gt(executor__partition__partition_boundaries.t.a, 2999999) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a > 2999999; +a b +explain format='brief' SELECT * FROM t WHERE a <= 2999999; +id estRows task access object operator info +TableReader 14.00 root partition:all data:Selection +└─Selection 14.00 cop[tikv] le(executor__partition__partition_boundaries.t.a, 2999999) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a <= 2999999; +a b +-2147483648 MIN_INT filler... +0 0 Filler... +1000000 1000000 Filler ... +1000001 1000001 Filler ... +1000002 1000002 Filler ... +1999998 1999998 Filler ... +1999999 1999999 Filler ... +2000000 2000000 Filler ... +2000001 2000001 Filler ... +2000002 2000002 Filler ... +2999998 2999998 Filler ... +2999999 2999999 Filler ... +999998 999998 Filler ... +999999 999999 Filler ... +explain format='brief' SELECT * FROM t WHERE a >= 2999999; +id estRows task access object operator info +TableReader 1.00 root partition:p2 data:Selection +└─Selection 1.00 cop[tikv] ge(executor__partition__partition_boundaries.t.a, 2999999) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a >= 2999999; +a b +2999999 2999999 Filler ... +explain format='brief' SELECT * FROM t WHERE a >= 2999999 AND a <= 3000001; +id estRows task access object operator info +TableReader 1.00 root partition:p2 data:Selection +└─Selection 1.00 cop[tikv] ge(executor__partition__partition_boundaries.t.a, 2999999), le(executor__partition__partition_boundaries.t.a, 3000001) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a >= 2999999 AND a <= 3000001; +a b +2999999 2999999 Filler ... +explain format='brief' SELECT * FROM t WHERE a > 2999999 AND a <= 3000001; +id estRows task access object operator info +TableReader 1.00 root partition:dual data:Selection +└─Selection 1.00 cop[tikv] gt(executor__partition__partition_boundaries.t.a, 2999999), le(executor__partition__partition_boundaries.t.a, 3000001) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a > 2999999 AND a <= 3000001; +a b +explain format='brief' SELECT * FROM t WHERE a > 2999999 AND a < 3000001; +id estRows task access object operator info +TableReader 1.00 root partition:dual data:Selection +└─Selection 1.00 cop[tikv] gt(executor__partition__partition_boundaries.t.a, 2999999), lt(executor__partition__partition_boundaries.t.a, 3000001) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a > 2999999 AND a < 3000001; +a b +explain format='brief' SELECT * FROM t WHERE a > 2999999 AND a <= 3000001; +id estRows task access object operator info +TableReader 1.00 root partition:dual data:Selection +└─Selection 1.00 cop[tikv] gt(executor__partition__partition_boundaries.t.a, 2999999), le(executor__partition__partition_boundaries.t.a, 3000001) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a > 2999999 AND a <= 3000001; +a b +explain format='brief' SELECT * FROM t WHERE a < 3000000; +id estRows task access object operator info +TableReader 14.00 root partition:all data:Selection +└─Selection 14.00 cop[tikv] lt(executor__partition__partition_boundaries.t.a, 3000000) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a < 3000000; +a b +-2147483648 MIN_INT filler... +0 0 Filler... +1000000 1000000 Filler ... +1000001 1000001 Filler ... +1000002 1000002 Filler ... +1999998 1999998 Filler ... +1999999 1999999 Filler ... +2000000 2000000 Filler ... +2000001 2000001 Filler ... +2000002 2000002 Filler ... +2999998 2999998 Filler ... +2999999 2999999 Filler ... +999998 999998 Filler ... +999999 999999 Filler ... +explain format='brief' SELECT * FROM t WHERE a > 3000000; +id estRows task access object operator info +TableReader 1.00 root partition:dual data:Selection +└─Selection 1.00 cop[tikv] gt(executor__partition__partition_boundaries.t.a, 3000000) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a > 3000000; +a b +explain format='brief' SELECT * FROM t WHERE a <= 3000000; +id estRows task access object operator info +TableReader 14.00 root partition:all data:Selection +└─Selection 14.00 cop[tikv] le(executor__partition__partition_boundaries.t.a, 3000000) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a <= 3000000; +a b +-2147483648 MIN_INT filler... +0 0 Filler... +1000000 1000000 Filler ... +1000001 1000001 Filler ... +1000002 1000002 Filler ... +1999998 1999998 Filler ... +1999999 1999999 Filler ... +2000000 2000000 Filler ... +2000001 2000001 Filler ... +2000002 2000002 Filler ... +2999998 2999998 Filler ... +2999999 2999999 Filler ... +999998 999998 Filler ... +999999 999999 Filler ... +explain format='brief' SELECT * FROM t WHERE a >= 3000000; +id estRows task access object operator info +TableReader 1.00 root partition:dual data:Selection +└─Selection 1.00 cop[tikv] ge(executor__partition__partition_boundaries.t.a, 3000000) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a >= 3000000; +a b +explain format='brief' SELECT * FROM t WHERE a >= 3000000 AND a <= 3000002; +id estRows task access object operator info +TableReader 1.00 root partition:dual data:Selection +└─Selection 1.00 cop[tikv] ge(executor__partition__partition_boundaries.t.a, 3000000), le(executor__partition__partition_boundaries.t.a, 3000002) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a >= 3000000 AND a <= 3000002; +a b +explain format='brief' SELECT * FROM t WHERE a > 3000000 AND a <= 3000002; +id estRows task access object operator info +TableReader 1.00 root partition:dual data:Selection +└─Selection 1.00 cop[tikv] gt(executor__partition__partition_boundaries.t.a, 3000000), le(executor__partition__partition_boundaries.t.a, 3000002) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a > 3000000 AND a <= 3000002; +a b +explain format='brief' SELECT * FROM t WHERE a > 3000000 AND a < 3000002; +id estRows task access object operator info +TableReader 1.00 root partition:dual data:Selection +└─Selection 1.00 cop[tikv] gt(executor__partition__partition_boundaries.t.a, 3000000), lt(executor__partition__partition_boundaries.t.a, 3000002) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a > 3000000 AND a < 3000002; +a b +explain format='brief' SELECT * FROM t WHERE a > 3000000 AND a <= 3000002; +id estRows task access object operator info +TableReader 1.00 root partition:dual data:Selection +└─Selection 1.00 cop[tikv] gt(executor__partition__partition_boundaries.t.a, 3000000), le(executor__partition__partition_boundaries.t.a, 3000002) + └─TableFullScan 14.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a > 3000000 AND a <= 3000002; +a b +set @@tidb_partition_prune_mode = default; +set @@tidb_partition_prune_mode = 'dynamic'; +drop table if exists t; +CREATE TABLE t +(a INT, b varchar(255)) +PARTITION BY RANGE (a) ( +PARTITION p0 VALUES LESS THAN (1), +PARTITION p1 VALUES LESS THAN (2), +PARTITION p2 VALUES LESS THAN (3), +PARTITION p3 VALUES LESS THAN (4), +PARTITION p4 VALUES LESS THAN (5), +PARTITION p5 VALUES LESS THAN (6), +PARTITION p6 VALUES LESS THAN (7)); +INSERT INTO t VALUES (0, '0 Filler...'); +INSERT INTO t VALUES (1, '1 Filler...'); +INSERT INTO t VALUES (2, '2 Filler...'); +INSERT INTO t VALUES (3, '3 Filler...'); +INSERT INTO t VALUES (4, '4 Filler...'); +INSERT INTO t VALUES (5, '5 Filler...'); +INSERT INTO t VALUES (6, '6 Filler...'); +ANALYZE TABLE t all columns; +explain format='brief' SELECT * FROM t WHERE a < -1; +id estRows task access object operator info +TableReader 1.00 root partition:p0 data:Selection +└─Selection 1.00 cop[tikv] lt(executor__partition__partition_boundaries.t.a, -1) + └─TableFullScan 7.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a < -1; +a b +explain format='brief' SELECT * FROM t WHERE a > -1; +id estRows task access object operator info +TableReader 7.00 root partition:all data:Selection +└─Selection 7.00 cop[tikv] gt(executor__partition__partition_boundaries.t.a, -1) + └─TableFullScan 7.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a > -1; +a b +0 0 Filler... +1 1 Filler... +2 2 Filler... +3 3 Filler... +4 4 Filler... +5 5 Filler... +6 6 Filler... +explain format='brief' SELECT * FROM t WHERE a <= -1; +id estRows task access object operator info +TableReader 1.00 root partition:p0 data:Selection +└─Selection 1.00 cop[tikv] le(executor__partition__partition_boundaries.t.a, -1) + └─TableFullScan 7.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a <= -1; +a b +explain format='brief' SELECT * FROM t WHERE a >= -1; +id estRows task access object operator info +TableReader 7.00 root partition:all data:Selection +└─Selection 7.00 cop[tikv] ge(executor__partition__partition_boundaries.t.a, -1) + └─TableFullScan 7.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a >= -1; +a b +0 0 Filler... +1 1 Filler... +2 2 Filler... +3 3 Filler... +4 4 Filler... +5 5 Filler... +6 6 Filler... +explain format='brief' SELECT * FROM t WHERE a < 2 OR a > -1; +id estRows task access object operator info +TableReader 7.00 root partition:all data:Selection +└─Selection 7.00 cop[tikv] or(lt(executor__partition__partition_boundaries.t.a, 2), gt(executor__partition__partition_boundaries.t.a, -1)) + └─TableFullScan 7.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a < 2 OR a > -1; +a b +0 0 Filler... +1 1 Filler... +2 2 Filler... +3 3 Filler... +4 4 Filler... +5 5 Filler... +6 6 Filler... +explain format='brief' SELECT * FROM t WHERE a > 2 AND a < -1; +id estRows task access object operator info +TableReader 1.00 root partition:dual data:Selection +└─Selection 1.00 cop[tikv] gt(executor__partition__partition_boundaries.t.a, 2), lt(executor__partition__partition_boundaries.t.a, -1) + └─TableFullScan 7.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a > 2 AND a < -1; +a b +explain format='brief' SELECT * FROM t WHERE NOT (a < 2 OR a > -1); +id estRows task access object operator info +TableReader 1.00 root partition:dual data:Selection +└─Selection 1.00 cop[tikv] and(ge(executor__partition__partition_boundaries.t.a, 2), le(executor__partition__partition_boundaries.t.a, -1)) + └─TableFullScan 7.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE NOT (a < 2 OR a > -1); +a b +explain format='brief' SELECT * FROM t WHERE NOT (a > 2 AND a < -1); +id estRows task access object operator info +TableReader 7.00 root partition:all data:Selection +└─Selection 7.00 cop[tikv] or(le(executor__partition__partition_boundaries.t.a, 2), ge(executor__partition__partition_boundaries.t.a, -1)) + └─TableFullScan 7.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE NOT (a > 2 AND a < -1); +a b +0 0 Filler... +1 1 Filler... +2 2 Filler... +3 3 Filler... +4 4 Filler... +5 5 Filler... +6 6 Filler... +explain format='brief' SELECT * FROM t WHERE a < 2 OR a >= -1; +id estRows task access object operator info +TableReader 7.00 root partition:all data:Selection +└─Selection 7.00 cop[tikv] or(lt(executor__partition__partition_boundaries.t.a, 2), ge(executor__partition__partition_boundaries.t.a, -1)) + └─TableFullScan 7.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a < 2 OR a >= -1; +a b +0 0 Filler... +1 1 Filler... +2 2 Filler... +3 3 Filler... +4 4 Filler... +5 5 Filler... +6 6 Filler... +explain format='brief' SELECT * FROM t WHERE a >= 2 AND a < -1; +id estRows task access object operator info +TableReader 1.00 root partition:dual data:Selection +└─Selection 1.00 cop[tikv] ge(executor__partition__partition_boundaries.t.a, 2), lt(executor__partition__partition_boundaries.t.a, -1) + └─TableFullScan 7.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a >= 2 AND a < -1; +a b +explain format='brief' SELECT * FROM t WHERE NOT (a < 2 OR a >= -1); +id estRows task access object operator info +TableReader 1.00 root partition:dual data:Selection +└─Selection 1.00 cop[tikv] and(ge(executor__partition__partition_boundaries.t.a, 2), lt(executor__partition__partition_boundaries.t.a, -1)) + └─TableFullScan 7.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE NOT (a < 2 OR a >= -1); +a b +explain format='brief' SELECT * FROM t WHERE NOT (a >= 2 AND a < -1); +id estRows task access object operator info +TableReader 7.00 root partition:all data:Selection +└─Selection 7.00 cop[tikv] or(lt(executor__partition__partition_boundaries.t.a, 2), ge(executor__partition__partition_boundaries.t.a, -1)) + └─TableFullScan 7.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE NOT (a >= 2 AND a < -1); +a b +0 0 Filler... +1 1 Filler... +2 2 Filler... +3 3 Filler... +4 4 Filler... +5 5 Filler... +6 6 Filler... +explain format='brief' SELECT * FROM t WHERE a <= 2 OR a > -1; +id estRows task access object operator info +TableReader 7.00 root partition:all data:Selection +└─Selection 7.00 cop[tikv] or(le(executor__partition__partition_boundaries.t.a, 2), gt(executor__partition__partition_boundaries.t.a, -1)) + └─TableFullScan 7.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a <= 2 OR a > -1; +a b +0 0 Filler... +1 1 Filler... +2 2 Filler... +3 3 Filler... +4 4 Filler... +5 5 Filler... +6 6 Filler... +explain format='brief' SELECT * FROM t WHERE a > 2 AND a <= -1; +id estRows task access object operator info +TableReader 1.00 root partition:dual data:Selection +└─Selection 1.00 cop[tikv] gt(executor__partition__partition_boundaries.t.a, 2), le(executor__partition__partition_boundaries.t.a, -1) + └─TableFullScan 7.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a > 2 AND a <= -1; +a b +explain format='brief' SELECT * FROM t WHERE NOT (a <= 2 OR a > -1); +id estRows task access object operator info +TableReader 1.00 root partition:dual data:Selection +└─Selection 1.00 cop[tikv] and(gt(executor__partition__partition_boundaries.t.a, 2), le(executor__partition__partition_boundaries.t.a, -1)) + └─TableFullScan 7.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE NOT (a <= 2 OR a > -1); +a b +explain format='brief' SELECT * FROM t WHERE NOT (a > 2 AND a <= -1); +id estRows task access object operator info +TableReader 7.00 root partition:all data:Selection +└─Selection 7.00 cop[tikv] or(le(executor__partition__partition_boundaries.t.a, 2), gt(executor__partition__partition_boundaries.t.a, -1)) + └─TableFullScan 7.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE NOT (a > 2 AND a <= -1); +a b +0 0 Filler... +1 1 Filler... +2 2 Filler... +3 3 Filler... +4 4 Filler... +5 5 Filler... +6 6 Filler... +explain format='brief' SELECT * FROM t WHERE a <= 2 OR a >= -1; +id estRows task access object operator info +TableReader 7.00 root partition:all data:Selection +└─Selection 7.00 cop[tikv] or(le(executor__partition__partition_boundaries.t.a, 2), ge(executor__partition__partition_boundaries.t.a, -1)) + └─TableFullScan 7.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a <= 2 OR a >= -1; +a b +0 0 Filler... +1 1 Filler... +2 2 Filler... +3 3 Filler... +4 4 Filler... +5 5 Filler... +6 6 Filler... +explain format='brief' SELECT * FROM t WHERE a >= 2 AND a <= -1; +id estRows task access object operator info +TableReader 1.00 root partition:dual data:Selection +└─Selection 1.00 cop[tikv] ge(executor__partition__partition_boundaries.t.a, 2), le(executor__partition__partition_boundaries.t.a, -1) + └─TableFullScan 7.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a >= 2 AND a <= -1; +a b +explain format='brief' SELECT * FROM t WHERE NOT (a <= 2 OR a >= -1); +id estRows task access object operator info +TableReader 1.00 root partition:dual data:Selection +└─Selection 1.00 cop[tikv] and(gt(executor__partition__partition_boundaries.t.a, 2), lt(executor__partition__partition_boundaries.t.a, -1)) + └─TableFullScan 7.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE NOT (a <= 2 OR a >= -1); +a b +explain format='brief' SELECT * FROM t WHERE NOT (a >= 2 AND a <= -1); +id estRows task access object operator info +TableReader 7.00 root partition:all data:Selection +└─Selection 7.00 cop[tikv] or(lt(executor__partition__partition_boundaries.t.a, 2), gt(executor__partition__partition_boundaries.t.a, -1)) + └─TableFullScan 7.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE NOT (a >= 2 AND a <= -1); +a b +0 0 Filler... +1 1 Filler... +2 2 Filler... +3 3 Filler... +4 4 Filler... +5 5 Filler... +6 6 Filler... +explain format='brief' SELECT * FROM t WHERE a < 0; +id estRows task access object operator info +TableReader 1.00 root partition:p0 data:Selection +└─Selection 1.00 cop[tikv] lt(executor__partition__partition_boundaries.t.a, 0) + └─TableFullScan 7.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a < 0; +a b +explain format='brief' SELECT * FROM t WHERE a > 0; +id estRows task access object operator info +TableReader 6.00 root partition:p1,p2,p3,p4,p5,p6 data:Selection +└─Selection 6.00 cop[tikv] gt(executor__partition__partition_boundaries.t.a, 0) + └─TableFullScan 7.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a > 0; +a b +1 1 Filler... +2 2 Filler... +3 3 Filler... +4 4 Filler... +5 5 Filler... +6 6 Filler... +explain format='brief' SELECT * FROM t WHERE a <= 0; +id estRows task access object operator info +TableReader 1.00 root partition:p0 data:Selection +└─Selection 1.00 cop[tikv] le(executor__partition__partition_boundaries.t.a, 0) + └─TableFullScan 7.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a <= 0; +a b +0 0 Filler... +explain format='brief' SELECT * FROM t WHERE a >= 0; +id estRows task access object operator info +TableReader 7.00 root partition:all data:Selection +└─Selection 7.00 cop[tikv] ge(executor__partition__partition_boundaries.t.a, 0) + └─TableFullScan 7.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a >= 0; +a b +0 0 Filler... +1 1 Filler... +2 2 Filler... +3 3 Filler... +4 4 Filler... +5 5 Filler... +6 6 Filler... +explain format='brief' SELECT * FROM t WHERE a < 2 OR a > 0; +id estRows task access object operator info +TableReader 7.00 root partition:all data:Selection +└─Selection 7.00 cop[tikv] or(lt(executor__partition__partition_boundaries.t.a, 2), gt(executor__partition__partition_boundaries.t.a, 0)) + └─TableFullScan 7.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a < 2 OR a > 0; +a b +0 0 Filler... +1 1 Filler... +2 2 Filler... +3 3 Filler... +4 4 Filler... +5 5 Filler... +6 6 Filler... +explain format='brief' SELECT * FROM t WHERE a > 2 AND a < 0; +id estRows task access object operator info +TableReader 1.00 root partition:dual data:Selection +└─Selection 1.00 cop[tikv] gt(executor__partition__partition_boundaries.t.a, 2), lt(executor__partition__partition_boundaries.t.a, 0) + └─TableFullScan 7.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a > 2 AND a < 0; +a b +explain format='brief' SELECT * FROM t WHERE NOT (a < 2 OR a > 0); +id estRows task access object operator info +TableReader 1.00 root partition:dual data:Selection +└─Selection 1.00 cop[tikv] and(ge(executor__partition__partition_boundaries.t.a, 2), le(executor__partition__partition_boundaries.t.a, 0)) + └─TableFullScan 7.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE NOT (a < 2 OR a > 0); +a b +explain format='brief' SELECT * FROM t WHERE NOT (a > 2 AND a < 0); +id estRows task access object operator info +TableReader 7.00 root partition:all data:Selection +└─Selection 7.00 cop[tikv] or(le(executor__partition__partition_boundaries.t.a, 2), ge(executor__partition__partition_boundaries.t.a, 0)) + └─TableFullScan 7.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE NOT (a > 2 AND a < 0); +a b +0 0 Filler... +1 1 Filler... +2 2 Filler... +3 3 Filler... +4 4 Filler... +5 5 Filler... +6 6 Filler... +explain format='brief' SELECT * FROM t WHERE a < 2 OR a >= 0; +id estRows task access object operator info +TableReader 7.00 root partition:all data:Selection +└─Selection 7.00 cop[tikv] or(lt(executor__partition__partition_boundaries.t.a, 2), ge(executor__partition__partition_boundaries.t.a, 0)) + └─TableFullScan 7.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a < 2 OR a >= 0; +a b +0 0 Filler... +1 1 Filler... +2 2 Filler... +3 3 Filler... +4 4 Filler... +5 5 Filler... +6 6 Filler... +explain format='brief' SELECT * FROM t WHERE a >= 2 AND a < 0; +id estRows task access object operator info +TableReader 1.00 root partition:dual data:Selection +└─Selection 1.00 cop[tikv] ge(executor__partition__partition_boundaries.t.a, 2), lt(executor__partition__partition_boundaries.t.a, 0) + └─TableFullScan 7.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a >= 2 AND a < 0; +a b +explain format='brief' SELECT * FROM t WHERE NOT (a < 2 OR a >= 0); +id estRows task access object operator info +TableReader 1.00 root partition:dual data:Selection +└─Selection 1.00 cop[tikv] and(ge(executor__partition__partition_boundaries.t.a, 2), lt(executor__partition__partition_boundaries.t.a, 0)) + └─TableFullScan 7.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE NOT (a < 2 OR a >= 0); +a b +explain format='brief' SELECT * FROM t WHERE NOT (a >= 2 AND a < 0); +id estRows task access object operator info +TableReader 7.00 root partition:all data:Selection +└─Selection 7.00 cop[tikv] or(lt(executor__partition__partition_boundaries.t.a, 2), ge(executor__partition__partition_boundaries.t.a, 0)) + └─TableFullScan 7.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE NOT (a >= 2 AND a < 0); +a b +0 0 Filler... +1 1 Filler... +2 2 Filler... +3 3 Filler... +4 4 Filler... +5 5 Filler... +6 6 Filler... +explain format='brief' SELECT * FROM t WHERE a <= 2 OR a > 0; +id estRows task access object operator info +TableReader 7.00 root partition:all data:Selection +└─Selection 7.00 cop[tikv] or(le(executor__partition__partition_boundaries.t.a, 2), gt(executor__partition__partition_boundaries.t.a, 0)) + └─TableFullScan 7.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a <= 2 OR a > 0; +a b +0 0 Filler... +1 1 Filler... +2 2 Filler... +3 3 Filler... +4 4 Filler... +5 5 Filler... +6 6 Filler... +explain format='brief' SELECT * FROM t WHERE a > 2 AND a <= 0; +id estRows task access object operator info +TableReader 1.00 root partition:dual data:Selection +└─Selection 1.00 cop[tikv] gt(executor__partition__partition_boundaries.t.a, 2), le(executor__partition__partition_boundaries.t.a, 0) + └─TableFullScan 7.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a > 2 AND a <= 0; +a b +explain format='brief' SELECT * FROM t WHERE NOT (a <= 2 OR a > 0); +id estRows task access object operator info +TableReader 1.00 root partition:dual data:Selection +└─Selection 1.00 cop[tikv] and(gt(executor__partition__partition_boundaries.t.a, 2), le(executor__partition__partition_boundaries.t.a, 0)) + └─TableFullScan 7.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE NOT (a <= 2 OR a > 0); +a b +explain format='brief' SELECT * FROM t WHERE NOT (a > 2 AND a <= 0); +id estRows task access object operator info +TableReader 7.00 root partition:all data:Selection +└─Selection 7.00 cop[tikv] or(le(executor__partition__partition_boundaries.t.a, 2), gt(executor__partition__partition_boundaries.t.a, 0)) + └─TableFullScan 7.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE NOT (a > 2 AND a <= 0); +a b +0 0 Filler... +1 1 Filler... +2 2 Filler... +3 3 Filler... +4 4 Filler... +5 5 Filler... +6 6 Filler... +explain format='brief' SELECT * FROM t WHERE a <= 2 OR a >= 0; +id estRows task access object operator info +TableReader 7.00 root partition:all data:Selection +└─Selection 7.00 cop[tikv] or(le(executor__partition__partition_boundaries.t.a, 2), ge(executor__partition__partition_boundaries.t.a, 0)) + └─TableFullScan 7.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a <= 2 OR a >= 0; +a b +0 0 Filler... +1 1 Filler... +2 2 Filler... +3 3 Filler... +4 4 Filler... +5 5 Filler... +6 6 Filler... +explain format='brief' SELECT * FROM t WHERE a >= 2 AND a <= 0; +id estRows task access object operator info +TableReader 1.00 root partition:dual data:Selection +└─Selection 1.00 cop[tikv] ge(executor__partition__partition_boundaries.t.a, 2), le(executor__partition__partition_boundaries.t.a, 0) + └─TableFullScan 7.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a >= 2 AND a <= 0; +a b +explain format='brief' SELECT * FROM t WHERE NOT (a <= 2 OR a >= 0); +id estRows task access object operator info +TableReader 1.00 root partition:dual data:Selection +└─Selection 1.00 cop[tikv] and(gt(executor__partition__partition_boundaries.t.a, 2), lt(executor__partition__partition_boundaries.t.a, 0)) + └─TableFullScan 7.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE NOT (a <= 2 OR a >= 0); +a b +explain format='brief' SELECT * FROM t WHERE NOT (a >= 2 AND a <= 0); +id estRows task access object operator info +TableReader 7.00 root partition:all data:Selection +└─Selection 7.00 cop[tikv] or(lt(executor__partition__partition_boundaries.t.a, 2), gt(executor__partition__partition_boundaries.t.a, 0)) + └─TableFullScan 7.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE NOT (a >= 2 AND a <= 0); +a b +0 0 Filler... +1 1 Filler... +2 2 Filler... +3 3 Filler... +4 4 Filler... +5 5 Filler... +6 6 Filler... +explain format='brief' SELECT * FROM t WHERE a < 1; +id estRows task access object operator info +TableReader 1.00 root partition:p0 data:Selection +└─Selection 1.00 cop[tikv] lt(executor__partition__partition_boundaries.t.a, 1) + └─TableFullScan 7.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a < 1; +a b +0 0 Filler... +explain format='brief' SELECT * FROM t WHERE a > 1; +id estRows task access object operator info +TableReader 5.00 root partition:p2,p3,p4,p5,p6 data:Selection +└─Selection 5.00 cop[tikv] gt(executor__partition__partition_boundaries.t.a, 1) + └─TableFullScan 7.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a > 1; +a b +2 2 Filler... +3 3 Filler... +4 4 Filler... +5 5 Filler... +6 6 Filler... +explain format='brief' SELECT * FROM t WHERE a <= 1; +id estRows task access object operator info +TableReader 2.00 root partition:p0,p1 data:Selection +└─Selection 2.00 cop[tikv] le(executor__partition__partition_boundaries.t.a, 1) + └─TableFullScan 7.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a <= 1; +a b +0 0 Filler... +1 1 Filler... +explain format='brief' SELECT * FROM t WHERE a >= 1; +id estRows task access object operator info +TableReader 6.00 root partition:p1,p2,p3,p4,p5,p6 data:Selection +└─Selection 6.00 cop[tikv] ge(executor__partition__partition_boundaries.t.a, 1) + └─TableFullScan 7.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a >= 1; +a b +1 1 Filler... +2 2 Filler... +3 3 Filler... +4 4 Filler... +5 5 Filler... +6 6 Filler... +explain format='brief' SELECT * FROM t WHERE a < 2 OR a > 1; +id estRows task access object operator info +TableReader 7.00 root partition:all data:Selection +└─Selection 7.00 cop[tikv] or(lt(executor__partition__partition_boundaries.t.a, 2), gt(executor__partition__partition_boundaries.t.a, 1)) + └─TableFullScan 7.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a < 2 OR a > 1; +a b +0 0 Filler... +1 1 Filler... +2 2 Filler... +3 3 Filler... +4 4 Filler... +5 5 Filler... +6 6 Filler... +explain format='brief' SELECT * FROM t WHERE a > 2 AND a < 1; +id estRows task access object operator info +TableReader 1.00 root partition:dual data:Selection +└─Selection 1.00 cop[tikv] gt(executor__partition__partition_boundaries.t.a, 2), lt(executor__partition__partition_boundaries.t.a, 1) + └─TableFullScan 7.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a > 2 AND a < 1; +a b +explain format='brief' SELECT * FROM t WHERE NOT (a < 2 OR a > 1); +id estRows task access object operator info +TableReader 1.00 root partition:dual data:Selection +└─Selection 1.00 cop[tikv] and(ge(executor__partition__partition_boundaries.t.a, 2), le(executor__partition__partition_boundaries.t.a, 1)) + └─TableFullScan 7.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE NOT (a < 2 OR a > 1); +a b +explain format='brief' SELECT * FROM t WHERE NOT (a > 2 AND a < 1); +id estRows task access object operator info +TableReader 7.00 root partition:all data:Selection +└─Selection 7.00 cop[tikv] or(le(executor__partition__partition_boundaries.t.a, 2), ge(executor__partition__partition_boundaries.t.a, 1)) + └─TableFullScan 7.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE NOT (a > 2 AND a < 1); +a b +0 0 Filler... +1 1 Filler... +2 2 Filler... +3 3 Filler... +4 4 Filler... +5 5 Filler... +6 6 Filler... +explain format='brief' SELECT * FROM t WHERE a < 2 OR a >= 1; +id estRows task access object operator info +TableReader 7.00 root partition:all data:Selection +└─Selection 7.00 cop[tikv] or(lt(executor__partition__partition_boundaries.t.a, 2), ge(executor__partition__partition_boundaries.t.a, 1)) + └─TableFullScan 7.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a < 2 OR a >= 1; +a b +0 0 Filler... +1 1 Filler... +2 2 Filler... +3 3 Filler... +4 4 Filler... +5 5 Filler... +6 6 Filler... +explain format='brief' SELECT * FROM t WHERE a >= 2 AND a < 1; +id estRows task access object operator info +TableReader 1.00 root partition:dual data:Selection +└─Selection 1.00 cop[tikv] ge(executor__partition__partition_boundaries.t.a, 2), lt(executor__partition__partition_boundaries.t.a, 1) + └─TableFullScan 7.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a >= 2 AND a < 1; +a b +explain format='brief' SELECT * FROM t WHERE NOT (a < 2 OR a >= 1); +id estRows task access object operator info +TableReader 1.00 root partition:dual data:Selection +└─Selection 1.00 cop[tikv] and(ge(executor__partition__partition_boundaries.t.a, 2), lt(executor__partition__partition_boundaries.t.a, 1)) + └─TableFullScan 7.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE NOT (a < 2 OR a >= 1); +a b +explain format='brief' SELECT * FROM t WHERE NOT (a >= 2 AND a < 1); +id estRows task access object operator info +TableReader 7.00 root partition:all data:Selection +└─Selection 7.00 cop[tikv] or(lt(executor__partition__partition_boundaries.t.a, 2), ge(executor__partition__partition_boundaries.t.a, 1)) + └─TableFullScan 7.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE NOT (a >= 2 AND a < 1); +a b +0 0 Filler... +1 1 Filler... +2 2 Filler... +3 3 Filler... +4 4 Filler... +5 5 Filler... +6 6 Filler... +explain format='brief' SELECT * FROM t WHERE a <= 2 OR a > 1; +id estRows task access object operator info +TableReader 7.00 root partition:all data:Selection +└─Selection 7.00 cop[tikv] or(le(executor__partition__partition_boundaries.t.a, 2), gt(executor__partition__partition_boundaries.t.a, 1)) + └─TableFullScan 7.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a <= 2 OR a > 1; +a b +0 0 Filler... +1 1 Filler... +2 2 Filler... +3 3 Filler... +4 4 Filler... +5 5 Filler... +6 6 Filler... +explain format='brief' SELECT * FROM t WHERE a > 2 AND a <= 1; +id estRows task access object operator info +TableReader 1.00 root partition:dual data:Selection +└─Selection 1.00 cop[tikv] gt(executor__partition__partition_boundaries.t.a, 2), le(executor__partition__partition_boundaries.t.a, 1) + └─TableFullScan 7.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a > 2 AND a <= 1; +a b +explain format='brief' SELECT * FROM t WHERE NOT (a <= 2 OR a > 1); +id estRows task access object operator info +TableReader 1.00 root partition:dual data:Selection +└─Selection 1.00 cop[tikv] and(gt(executor__partition__partition_boundaries.t.a, 2), le(executor__partition__partition_boundaries.t.a, 1)) + └─TableFullScan 7.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE NOT (a <= 2 OR a > 1); +a b +explain format='brief' SELECT * FROM t WHERE NOT (a > 2 AND a <= 1); +id estRows task access object operator info +TableReader 7.00 root partition:all data:Selection +└─Selection 7.00 cop[tikv] or(le(executor__partition__partition_boundaries.t.a, 2), gt(executor__partition__partition_boundaries.t.a, 1)) + └─TableFullScan 7.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE NOT (a > 2 AND a <= 1); +a b +0 0 Filler... +1 1 Filler... +2 2 Filler... +3 3 Filler... +4 4 Filler... +5 5 Filler... +6 6 Filler... +explain format='brief' SELECT * FROM t WHERE a <= 2 OR a >= 1; +id estRows task access object operator info +TableReader 7.00 root partition:all data:Selection +└─Selection 7.00 cop[tikv] or(le(executor__partition__partition_boundaries.t.a, 2), ge(executor__partition__partition_boundaries.t.a, 1)) + └─TableFullScan 7.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a <= 2 OR a >= 1; +a b +0 0 Filler... +1 1 Filler... +2 2 Filler... +3 3 Filler... +4 4 Filler... +5 5 Filler... +6 6 Filler... +explain format='brief' SELECT * FROM t WHERE a >= 2 AND a <= 1; +id estRows task access object operator info +TableReader 1.00 root partition:dual data:Selection +└─Selection 1.00 cop[tikv] ge(executor__partition__partition_boundaries.t.a, 2), le(executor__partition__partition_boundaries.t.a, 1) + └─TableFullScan 7.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a >= 2 AND a <= 1; +a b +explain format='brief' SELECT * FROM t WHERE NOT (a <= 2 OR a >= 1); +id estRows task access object operator info +TableReader 1.00 root partition:dual data:Selection +└─Selection 1.00 cop[tikv] and(gt(executor__partition__partition_boundaries.t.a, 2), lt(executor__partition__partition_boundaries.t.a, 1)) + └─TableFullScan 7.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE NOT (a <= 2 OR a >= 1); +a b +explain format='brief' SELECT * FROM t WHERE NOT (a >= 2 AND a <= 1); +id estRows task access object operator info +TableReader 7.00 root partition:all data:Selection +└─Selection 7.00 cop[tikv] or(lt(executor__partition__partition_boundaries.t.a, 2), gt(executor__partition__partition_boundaries.t.a, 1)) + └─TableFullScan 7.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE NOT (a >= 2 AND a <= 1); +a b +0 0 Filler... +1 1 Filler... +2 2 Filler... +3 3 Filler... +4 4 Filler... +5 5 Filler... +6 6 Filler... +explain format='brief' SELECT * FROM t WHERE a < 2; +id estRows task access object operator info +TableReader 2.00 root partition:p0,p1 data:Selection +└─Selection 2.00 cop[tikv] lt(executor__partition__partition_boundaries.t.a, 2) + └─TableFullScan 7.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a < 2; +a b +0 0 Filler... +1 1 Filler... +explain format='brief' SELECT * FROM t WHERE a > 2; +id estRows task access object operator info +TableReader 4.00 root partition:p3,p4,p5,p6 data:Selection +└─Selection 4.00 cop[tikv] gt(executor__partition__partition_boundaries.t.a, 2) + └─TableFullScan 7.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a > 2; +a b +3 3 Filler... +4 4 Filler... +5 5 Filler... +6 6 Filler... +explain format='brief' SELECT * FROM t WHERE a <= 2; +id estRows task access object operator info +TableReader 3.00 root partition:p0,p1,p2 data:Selection +└─Selection 3.00 cop[tikv] le(executor__partition__partition_boundaries.t.a, 2) + └─TableFullScan 7.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a <= 2; +a b +0 0 Filler... +1 1 Filler... +2 2 Filler... +explain format='brief' SELECT * FROM t WHERE a >= 2; +id estRows task access object operator info +TableReader 5.00 root partition:p2,p3,p4,p5,p6 data:Selection +└─Selection 5.00 cop[tikv] ge(executor__partition__partition_boundaries.t.a, 2) + └─TableFullScan 7.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a >= 2; +a b +2 2 Filler... +3 3 Filler... +4 4 Filler... +5 5 Filler... +6 6 Filler... +explain format='brief' SELECT * FROM t WHERE a < 2 OR a > 2; +id estRows task access object operator info +TableReader 6.00 root partition:p0,p1,p3,p4,p5,p6 data:Selection +└─Selection 6.00 cop[tikv] or(lt(executor__partition__partition_boundaries.t.a, 2), gt(executor__partition__partition_boundaries.t.a, 2)) + └─TableFullScan 7.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a < 2 OR a > 2; +a b +0 0 Filler... +1 1 Filler... +3 3 Filler... +4 4 Filler... +5 5 Filler... +6 6 Filler... +explain format='brief' SELECT * FROM t WHERE a > 2 AND a < 2; +id estRows task access object operator info +TableReader 1.00 root partition:dual data:Selection +└─Selection 1.00 cop[tikv] gt(executor__partition__partition_boundaries.t.a, 2), lt(executor__partition__partition_boundaries.t.a, 2) + └─TableFullScan 7.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a > 2 AND a < 2; +a b +explain format='brief' SELECT * FROM t WHERE NOT (a < 2 OR a > 2); +id estRows task access object operator info +TableReader 1.00 root partition:p2 data:Selection +└─Selection 1.00 cop[tikv] and(ge(executor__partition__partition_boundaries.t.a, 2), le(executor__partition__partition_boundaries.t.a, 2)) + └─TableFullScan 7.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE NOT (a < 2 OR a > 2); +a b +2 2 Filler... +explain format='brief' SELECT * FROM t WHERE NOT (a > 2 AND a < 2); +id estRows task access object operator info +TableReader 7.00 root partition:all data:Selection +└─Selection 7.00 cop[tikv] or(le(executor__partition__partition_boundaries.t.a, 2), ge(executor__partition__partition_boundaries.t.a, 2)) + └─TableFullScan 7.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE NOT (a > 2 AND a < 2); +a b +0 0 Filler... +1 1 Filler... +2 2 Filler... +3 3 Filler... +4 4 Filler... +5 5 Filler... +6 6 Filler... +explain format='brief' SELECT * FROM t WHERE a < 2 OR a >= 2; +id estRows task access object operator info +TableReader 7.00 root partition:all data:Selection +└─Selection 7.00 cop[tikv] or(lt(executor__partition__partition_boundaries.t.a, 2), ge(executor__partition__partition_boundaries.t.a, 2)) + └─TableFullScan 7.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a < 2 OR a >= 2; +a b +0 0 Filler... +1 1 Filler... +2 2 Filler... +3 3 Filler... +4 4 Filler... +5 5 Filler... +6 6 Filler... +explain format='brief' SELECT * FROM t WHERE a >= 2 AND a < 2; +id estRows task access object operator info +TableReader 1.00 root partition:dual data:Selection +└─Selection 1.00 cop[tikv] ge(executor__partition__partition_boundaries.t.a, 2), lt(executor__partition__partition_boundaries.t.a, 2) + └─TableFullScan 7.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a >= 2 AND a < 2; +a b +explain format='brief' SELECT * FROM t WHERE NOT (a < 2 OR a >= 2); +id estRows task access object operator info +TableReader 1.00 root partition:dual data:Selection +└─Selection 1.00 cop[tikv] and(ge(executor__partition__partition_boundaries.t.a, 2), lt(executor__partition__partition_boundaries.t.a, 2)) + └─TableFullScan 7.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE NOT (a < 2 OR a >= 2); +a b +explain format='brief' SELECT * FROM t WHERE NOT (a >= 2 AND a < 2); +id estRows task access object operator info +TableReader 7.00 root partition:all data:Selection +└─Selection 7.00 cop[tikv] or(lt(executor__partition__partition_boundaries.t.a, 2), ge(executor__partition__partition_boundaries.t.a, 2)) + └─TableFullScan 7.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE NOT (a >= 2 AND a < 2); +a b +0 0 Filler... +1 1 Filler... +2 2 Filler... +3 3 Filler... +4 4 Filler... +5 5 Filler... +6 6 Filler... +explain format='brief' SELECT * FROM t WHERE a <= 2 OR a > 2; +id estRows task access object operator info +TableReader 7.00 root partition:all data:Selection +└─Selection 7.00 cop[tikv] or(le(executor__partition__partition_boundaries.t.a, 2), gt(executor__partition__partition_boundaries.t.a, 2)) + └─TableFullScan 7.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a <= 2 OR a > 2; +a b +0 0 Filler... +1 1 Filler... +2 2 Filler... +3 3 Filler... +4 4 Filler... +5 5 Filler... +6 6 Filler... +explain format='brief' SELECT * FROM t WHERE a > 2 AND a <= 2; +id estRows task access object operator info +TableReader 1.00 root partition:dual data:Selection +└─Selection 1.00 cop[tikv] gt(executor__partition__partition_boundaries.t.a, 2), le(executor__partition__partition_boundaries.t.a, 2) + └─TableFullScan 7.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a > 2 AND a <= 2; +a b +explain format='brief' SELECT * FROM t WHERE NOT (a <= 2 OR a > 2); +id estRows task access object operator info +TableReader 1.00 root partition:dual data:Selection +└─Selection 1.00 cop[tikv] and(gt(executor__partition__partition_boundaries.t.a, 2), le(executor__partition__partition_boundaries.t.a, 2)) + └─TableFullScan 7.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE NOT (a <= 2 OR a > 2); +a b +explain format='brief' SELECT * FROM t WHERE NOT (a > 2 AND a <= 2); +id estRows task access object operator info +TableReader 7.00 root partition:all data:Selection +└─Selection 7.00 cop[tikv] or(le(executor__partition__partition_boundaries.t.a, 2), gt(executor__partition__partition_boundaries.t.a, 2)) + └─TableFullScan 7.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE NOT (a > 2 AND a <= 2); +a b +0 0 Filler... +1 1 Filler... +2 2 Filler... +3 3 Filler... +4 4 Filler... +5 5 Filler... +6 6 Filler... +explain format='brief' SELECT * FROM t WHERE a <= 2 OR a >= 2; +id estRows task access object operator info +TableReader 7.00 root partition:all data:Selection +└─Selection 7.00 cop[tikv] or(le(executor__partition__partition_boundaries.t.a, 2), ge(executor__partition__partition_boundaries.t.a, 2)) + └─TableFullScan 7.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a <= 2 OR a >= 2; +a b +0 0 Filler... +1 1 Filler... +2 2 Filler... +3 3 Filler... +4 4 Filler... +5 5 Filler... +6 6 Filler... +explain format='brief' SELECT * FROM t WHERE a >= 2 AND a <= 2; +id estRows task access object operator info +TableReader 1.00 root partition:p2 data:Selection +└─Selection 1.00 cop[tikv] ge(executor__partition__partition_boundaries.t.a, 2), le(executor__partition__partition_boundaries.t.a, 2) + └─TableFullScan 7.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a >= 2 AND a <= 2; +a b +2 2 Filler... +explain format='brief' SELECT * FROM t WHERE NOT (a <= 2 OR a >= 2); +id estRows task access object operator info +TableReader 1.00 root partition:dual data:Selection +└─Selection 1.00 cop[tikv] and(gt(executor__partition__partition_boundaries.t.a, 2), lt(executor__partition__partition_boundaries.t.a, 2)) + └─TableFullScan 7.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE NOT (a <= 2 OR a >= 2); +a b +explain format='brief' SELECT * FROM t WHERE NOT (a >= 2 AND a <= 2); +id estRows task access object operator info +TableReader 6.00 root partition:p0,p1,p3,p4,p5,p6 data:Selection +└─Selection 6.00 cop[tikv] or(lt(executor__partition__partition_boundaries.t.a, 2), gt(executor__partition__partition_boundaries.t.a, 2)) + └─TableFullScan 7.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE NOT (a >= 2 AND a <= 2); +a b +0 0 Filler... +1 1 Filler... +3 3 Filler... +4 4 Filler... +5 5 Filler... +6 6 Filler... +explain format='brief' SELECT * FROM t WHERE a < 3; +id estRows task access object operator info +TableReader 3.00 root partition:p0,p1,p2 data:Selection +└─Selection 3.00 cop[tikv] lt(executor__partition__partition_boundaries.t.a, 3) + └─TableFullScan 7.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a < 3; +a b +0 0 Filler... +1 1 Filler... +2 2 Filler... +explain format='brief' SELECT * FROM t WHERE a > 3; +id estRows task access object operator info +TableReader 3.00 root partition:p4,p5,p6 data:Selection +└─Selection 3.00 cop[tikv] gt(executor__partition__partition_boundaries.t.a, 3) + └─TableFullScan 7.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a > 3; +a b +4 4 Filler... +5 5 Filler... +6 6 Filler... +explain format='brief' SELECT * FROM t WHERE a <= 3; +id estRows task access object operator info +TableReader 4.00 root partition:p0,p1,p2,p3 data:Selection +└─Selection 4.00 cop[tikv] le(executor__partition__partition_boundaries.t.a, 3) + └─TableFullScan 7.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a <= 3; +a b +0 0 Filler... +1 1 Filler... +2 2 Filler... +3 3 Filler... +explain format='brief' SELECT * FROM t WHERE a >= 3; +id estRows task access object operator info +TableReader 4.00 root partition:p3,p4,p5,p6 data:Selection +└─Selection 4.00 cop[tikv] ge(executor__partition__partition_boundaries.t.a, 3) + └─TableFullScan 7.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a >= 3; +a b +3 3 Filler... +4 4 Filler... +5 5 Filler... +6 6 Filler... +explain format='brief' SELECT * FROM t WHERE a < 2 OR a > 3; +id estRows task access object operator info +TableReader 5.00 root partition:p0,p1,p4,p5,p6 data:Selection +└─Selection 5.00 cop[tikv] or(lt(executor__partition__partition_boundaries.t.a, 2), gt(executor__partition__partition_boundaries.t.a, 3)) + └─TableFullScan 7.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a < 2 OR a > 3; +a b +0 0 Filler... +1 1 Filler... +4 4 Filler... +5 5 Filler... +6 6 Filler... +explain format='brief' SELECT * FROM t WHERE a > 2 AND a < 3; +id estRows task access object operator info +TableReader 1.00 root partition:dual data:Selection +└─Selection 1.00 cop[tikv] gt(executor__partition__partition_boundaries.t.a, 2), lt(executor__partition__partition_boundaries.t.a, 3) + └─TableFullScan 7.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a > 2 AND a < 3; +a b +explain format='brief' SELECT * FROM t WHERE NOT (a < 2 OR a > 3); +id estRows task access object operator info +TableReader 2.00 root partition:p2,p3 data:Selection +└─Selection 2.00 cop[tikv] and(ge(executor__partition__partition_boundaries.t.a, 2), le(executor__partition__partition_boundaries.t.a, 3)) + └─TableFullScan 7.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE NOT (a < 2 OR a > 3); +a b +2 2 Filler... +3 3 Filler... +explain format='brief' SELECT * FROM t WHERE NOT (a > 2 AND a < 3); +id estRows task access object operator info +TableReader 7.00 root partition:all data:Selection +└─Selection 7.00 cop[tikv] or(le(executor__partition__partition_boundaries.t.a, 2), ge(executor__partition__partition_boundaries.t.a, 3)) + └─TableFullScan 7.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE NOT (a > 2 AND a < 3); +a b +0 0 Filler... +1 1 Filler... +2 2 Filler... +3 3 Filler... +4 4 Filler... +5 5 Filler... +6 6 Filler... +explain format='brief' SELECT * FROM t WHERE a < 2 OR a >= 3; +id estRows task access object operator info +TableReader 6.00 root partition:p0,p1,p3,p4,p5,p6 data:Selection +└─Selection 6.00 cop[tikv] or(lt(executor__partition__partition_boundaries.t.a, 2), ge(executor__partition__partition_boundaries.t.a, 3)) + └─TableFullScan 7.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a < 2 OR a >= 3; +a b +0 0 Filler... +1 1 Filler... +3 3 Filler... +4 4 Filler... +5 5 Filler... +6 6 Filler... +explain format='brief' SELECT * FROM t WHERE a >= 2 AND a < 3; +id estRows task access object operator info +TableReader 1.00 root partition:p2 data:Selection +└─Selection 1.00 cop[tikv] ge(executor__partition__partition_boundaries.t.a, 2), lt(executor__partition__partition_boundaries.t.a, 3) + └─TableFullScan 7.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a >= 2 AND a < 3; +a b +2 2 Filler... +explain format='brief' SELECT * FROM t WHERE NOT (a < 2 OR a >= 3); +id estRows task access object operator info +TableReader 1.00 root partition:p2 data:Selection +└─Selection 1.00 cop[tikv] and(ge(executor__partition__partition_boundaries.t.a, 2), lt(executor__partition__partition_boundaries.t.a, 3)) + └─TableFullScan 7.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE NOT (a < 2 OR a >= 3); +a b +2 2 Filler... +explain format='brief' SELECT * FROM t WHERE NOT (a >= 2 AND a < 3); +id estRows task access object operator info +TableReader 6.00 root partition:p0,p1,p3,p4,p5,p6 data:Selection +└─Selection 6.00 cop[tikv] or(lt(executor__partition__partition_boundaries.t.a, 2), ge(executor__partition__partition_boundaries.t.a, 3)) + └─TableFullScan 7.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE NOT (a >= 2 AND a < 3); +a b +0 0 Filler... +1 1 Filler... +3 3 Filler... +4 4 Filler... +5 5 Filler... +6 6 Filler... +explain format='brief' SELECT * FROM t WHERE a <= 2 OR a > 3; +id estRows task access object operator info +TableReader 6.00 root partition:p0,p1,p2,p4,p5,p6 data:Selection +└─Selection 6.00 cop[tikv] or(le(executor__partition__partition_boundaries.t.a, 2), gt(executor__partition__partition_boundaries.t.a, 3)) + └─TableFullScan 7.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a <= 2 OR a > 3; +a b +0 0 Filler... +1 1 Filler... +2 2 Filler... +4 4 Filler... +5 5 Filler... +6 6 Filler... +explain format='brief' SELECT * FROM t WHERE a > 2 AND a <= 3; +id estRows task access object operator info +TableReader 1.00 root partition:p3 data:Selection +└─Selection 1.00 cop[tikv] gt(executor__partition__partition_boundaries.t.a, 2), le(executor__partition__partition_boundaries.t.a, 3) + └─TableFullScan 7.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a > 2 AND a <= 3; +a b +3 3 Filler... +explain format='brief' SELECT * FROM t WHERE NOT (a <= 2 OR a > 3); +id estRows task access object operator info +TableReader 1.00 root partition:p3 data:Selection +└─Selection 1.00 cop[tikv] and(gt(executor__partition__partition_boundaries.t.a, 2), le(executor__partition__partition_boundaries.t.a, 3)) + └─TableFullScan 7.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE NOT (a <= 2 OR a > 3); +a b +3 3 Filler... +explain format='brief' SELECT * FROM t WHERE NOT (a > 2 AND a <= 3); +id estRows task access object operator info +TableReader 6.00 root partition:p0,p1,p2,p4,p5,p6 data:Selection +└─Selection 6.00 cop[tikv] or(le(executor__partition__partition_boundaries.t.a, 2), gt(executor__partition__partition_boundaries.t.a, 3)) + └─TableFullScan 7.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE NOT (a > 2 AND a <= 3); +a b +0 0 Filler... +1 1 Filler... +2 2 Filler... +4 4 Filler... +5 5 Filler... +6 6 Filler... +explain format='brief' SELECT * FROM t WHERE a <= 2 OR a >= 3; +id estRows task access object operator info +TableReader 7.00 root partition:all data:Selection +└─Selection 7.00 cop[tikv] or(le(executor__partition__partition_boundaries.t.a, 2), ge(executor__partition__partition_boundaries.t.a, 3)) + └─TableFullScan 7.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a <= 2 OR a >= 3; +a b +0 0 Filler... +1 1 Filler... +2 2 Filler... +3 3 Filler... +4 4 Filler... +5 5 Filler... +6 6 Filler... +explain format='brief' SELECT * FROM t WHERE a >= 2 AND a <= 3; +id estRows task access object operator info +TableReader 2.00 root partition:p2,p3 data:Selection +└─Selection 2.00 cop[tikv] ge(executor__partition__partition_boundaries.t.a, 2), le(executor__partition__partition_boundaries.t.a, 3) + └─TableFullScan 7.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a >= 2 AND a <= 3; +a b +2 2 Filler... +3 3 Filler... +explain format='brief' SELECT * FROM t WHERE NOT (a <= 2 OR a >= 3); +id estRows task access object operator info +TableReader 1.00 root partition:dual data:Selection +└─Selection 1.00 cop[tikv] and(gt(executor__partition__partition_boundaries.t.a, 2), lt(executor__partition__partition_boundaries.t.a, 3)) + └─TableFullScan 7.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE NOT (a <= 2 OR a >= 3); +a b +explain format='brief' SELECT * FROM t WHERE NOT (a >= 2 AND a <= 3); +id estRows task access object operator info +TableReader 5.00 root partition:p0,p1,p4,p5,p6 data:Selection +└─Selection 5.00 cop[tikv] or(lt(executor__partition__partition_boundaries.t.a, 2), gt(executor__partition__partition_boundaries.t.a, 3)) + └─TableFullScan 7.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE NOT (a >= 2 AND a <= 3); +a b +0 0 Filler... +1 1 Filler... +4 4 Filler... +5 5 Filler... +6 6 Filler... +explain format='brief' SELECT * FROM t WHERE a < 4; +id estRows task access object operator info +TableReader 4.00 root partition:p0,p1,p2,p3 data:Selection +└─Selection 4.00 cop[tikv] lt(executor__partition__partition_boundaries.t.a, 4) + └─TableFullScan 7.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a < 4; +a b +0 0 Filler... +1 1 Filler... +2 2 Filler... +3 3 Filler... +explain format='brief' SELECT * FROM t WHERE a > 4; +id estRows task access object operator info +TableReader 2.00 root partition:p5,p6 data:Selection +└─Selection 2.00 cop[tikv] gt(executor__partition__partition_boundaries.t.a, 4) + └─TableFullScan 7.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a > 4; +a b +5 5 Filler... +6 6 Filler... +explain format='brief' SELECT * FROM t WHERE a <= 4; +id estRows task access object operator info +TableReader 5.00 root partition:p0,p1,p2,p3,p4 data:Selection +└─Selection 5.00 cop[tikv] le(executor__partition__partition_boundaries.t.a, 4) + └─TableFullScan 7.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a <= 4; +a b +0 0 Filler... +1 1 Filler... +2 2 Filler... +3 3 Filler... +4 4 Filler... +explain format='brief' SELECT * FROM t WHERE a >= 4; +id estRows task access object operator info +TableReader 3.00 root partition:p4,p5,p6 data:Selection +└─Selection 3.00 cop[tikv] ge(executor__partition__partition_boundaries.t.a, 4) + └─TableFullScan 7.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a >= 4; +a b +4 4 Filler... +5 5 Filler... +6 6 Filler... +explain format='brief' SELECT * FROM t WHERE a < 2 OR a > 4; +id estRows task access object operator info +TableReader 4.00 root partition:p0,p1,p5,p6 data:Selection +└─Selection 4.00 cop[tikv] or(lt(executor__partition__partition_boundaries.t.a, 2), gt(executor__partition__partition_boundaries.t.a, 4)) + └─TableFullScan 7.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a < 2 OR a > 4; +a b +0 0 Filler... +1 1 Filler... +5 5 Filler... +6 6 Filler... +explain format='brief' SELECT * FROM t WHERE a > 2 AND a < 4; +id estRows task access object operator info +TableReader 1.00 root partition:p3 data:Selection +└─Selection 1.00 cop[tikv] gt(executor__partition__partition_boundaries.t.a, 2), lt(executor__partition__partition_boundaries.t.a, 4) + └─TableFullScan 7.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a > 2 AND a < 4; +a b +3 3 Filler... +explain format='brief' SELECT * FROM t WHERE NOT (a < 2 OR a > 4); +id estRows task access object operator info +TableReader 3.00 root partition:p2,p3,p4 data:Selection +└─Selection 3.00 cop[tikv] and(ge(executor__partition__partition_boundaries.t.a, 2), le(executor__partition__partition_boundaries.t.a, 4)) + └─TableFullScan 7.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE NOT (a < 2 OR a > 4); +a b +2 2 Filler... +3 3 Filler... +4 4 Filler... +explain format='brief' SELECT * FROM t WHERE NOT (a > 2 AND a < 4); +id estRows task access object operator info +TableReader 6.00 root partition:p0,p1,p2,p4,p5,p6 data:Selection +└─Selection 6.00 cop[tikv] or(le(executor__partition__partition_boundaries.t.a, 2), ge(executor__partition__partition_boundaries.t.a, 4)) + └─TableFullScan 7.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE NOT (a > 2 AND a < 4); +a b +0 0 Filler... +1 1 Filler... +2 2 Filler... +4 4 Filler... +5 5 Filler... +6 6 Filler... +explain format='brief' SELECT * FROM t WHERE a < 2 OR a >= 4; +id estRows task access object operator info +TableReader 5.00 root partition:p0,p1,p4,p5,p6 data:Selection +└─Selection 5.00 cop[tikv] or(lt(executor__partition__partition_boundaries.t.a, 2), ge(executor__partition__partition_boundaries.t.a, 4)) + └─TableFullScan 7.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a < 2 OR a >= 4; +a b +0 0 Filler... +1 1 Filler... +4 4 Filler... +5 5 Filler... +6 6 Filler... +explain format='brief' SELECT * FROM t WHERE a >= 2 AND a < 4; +id estRows task access object operator info +TableReader 2.00 root partition:p2,p3 data:Selection +└─Selection 2.00 cop[tikv] ge(executor__partition__partition_boundaries.t.a, 2), lt(executor__partition__partition_boundaries.t.a, 4) + └─TableFullScan 7.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a >= 2 AND a < 4; +a b +2 2 Filler... +3 3 Filler... +explain format='brief' SELECT * FROM t WHERE NOT (a < 2 OR a >= 4); +id estRows task access object operator info +TableReader 2.00 root partition:p2,p3 data:Selection +└─Selection 2.00 cop[tikv] and(ge(executor__partition__partition_boundaries.t.a, 2), lt(executor__partition__partition_boundaries.t.a, 4)) + └─TableFullScan 7.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE NOT (a < 2 OR a >= 4); +a b +2 2 Filler... +3 3 Filler... +explain format='brief' SELECT * FROM t WHERE NOT (a >= 2 AND a < 4); +id estRows task access object operator info +TableReader 5.00 root partition:p0,p1,p4,p5,p6 data:Selection +└─Selection 5.00 cop[tikv] or(lt(executor__partition__partition_boundaries.t.a, 2), ge(executor__partition__partition_boundaries.t.a, 4)) + └─TableFullScan 7.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE NOT (a >= 2 AND a < 4); +a b +0 0 Filler... +1 1 Filler... +4 4 Filler... +5 5 Filler... +6 6 Filler... +explain format='brief' SELECT * FROM t WHERE a <= 2 OR a > 4; +id estRows task access object operator info +TableReader 5.00 root partition:p0,p1,p2,p5,p6 data:Selection +└─Selection 5.00 cop[tikv] or(le(executor__partition__partition_boundaries.t.a, 2), gt(executor__partition__partition_boundaries.t.a, 4)) + └─TableFullScan 7.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a <= 2 OR a > 4; +a b +0 0 Filler... +1 1 Filler... +2 2 Filler... +5 5 Filler... +6 6 Filler... +explain format='brief' SELECT * FROM t WHERE a > 2 AND a <= 4; +id estRows task access object operator info +TableReader 2.00 root partition:p3,p4 data:Selection +└─Selection 2.00 cop[tikv] gt(executor__partition__partition_boundaries.t.a, 2), le(executor__partition__partition_boundaries.t.a, 4) + └─TableFullScan 7.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a > 2 AND a <= 4; +a b +3 3 Filler... +4 4 Filler... +explain format='brief' SELECT * FROM t WHERE NOT (a <= 2 OR a > 4); +id estRows task access object operator info +TableReader 2.00 root partition:p3,p4 data:Selection +└─Selection 2.00 cop[tikv] and(gt(executor__partition__partition_boundaries.t.a, 2), le(executor__partition__partition_boundaries.t.a, 4)) + └─TableFullScan 7.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE NOT (a <= 2 OR a > 4); +a b +3 3 Filler... +4 4 Filler... +explain format='brief' SELECT * FROM t WHERE NOT (a > 2 AND a <= 4); +id estRows task access object operator info +TableReader 5.00 root partition:p0,p1,p2,p5,p6 data:Selection +└─Selection 5.00 cop[tikv] or(le(executor__partition__partition_boundaries.t.a, 2), gt(executor__partition__partition_boundaries.t.a, 4)) + └─TableFullScan 7.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE NOT (a > 2 AND a <= 4); +a b +0 0 Filler... +1 1 Filler... +2 2 Filler... +5 5 Filler... +6 6 Filler... +explain format='brief' SELECT * FROM t WHERE a <= 2 OR a >= 4; +id estRows task access object operator info +TableReader 6.00 root partition:p0,p1,p2,p4,p5,p6 data:Selection +└─Selection 6.00 cop[tikv] or(le(executor__partition__partition_boundaries.t.a, 2), ge(executor__partition__partition_boundaries.t.a, 4)) + └─TableFullScan 7.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a <= 2 OR a >= 4; +a b +0 0 Filler... +1 1 Filler... +2 2 Filler... +4 4 Filler... +5 5 Filler... +6 6 Filler... +explain format='brief' SELECT * FROM t WHERE a >= 2 AND a <= 4; +id estRows task access object operator info +TableReader 3.00 root partition:p2,p3,p4 data:Selection +└─Selection 3.00 cop[tikv] ge(executor__partition__partition_boundaries.t.a, 2), le(executor__partition__partition_boundaries.t.a, 4) + └─TableFullScan 7.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a >= 2 AND a <= 4; +a b +2 2 Filler... +3 3 Filler... +4 4 Filler... +explain format='brief' SELECT * FROM t WHERE NOT (a <= 2 OR a >= 4); +id estRows task access object operator info +TableReader 1.00 root partition:p3 data:Selection +└─Selection 1.00 cop[tikv] and(gt(executor__partition__partition_boundaries.t.a, 2), lt(executor__partition__partition_boundaries.t.a, 4)) + └─TableFullScan 7.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE NOT (a <= 2 OR a >= 4); +a b +3 3 Filler... +explain format='brief' SELECT * FROM t WHERE NOT (a >= 2 AND a <= 4); +id estRows task access object operator info +TableReader 4.00 root partition:p0,p1,p5,p6 data:Selection +└─Selection 4.00 cop[tikv] or(lt(executor__partition__partition_boundaries.t.a, 2), gt(executor__partition__partition_boundaries.t.a, 4)) + └─TableFullScan 7.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE NOT (a >= 2 AND a <= 4); +a b +0 0 Filler... +1 1 Filler... +5 5 Filler... +6 6 Filler... +explain format='brief' SELECT * FROM t WHERE a < 5; +id estRows task access object operator info +TableReader 5.00 root partition:p0,p1,p2,p3,p4 data:Selection +└─Selection 5.00 cop[tikv] lt(executor__partition__partition_boundaries.t.a, 5) + └─TableFullScan 7.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a < 5; +a b +0 0 Filler... +1 1 Filler... +2 2 Filler... +3 3 Filler... +4 4 Filler... +explain format='brief' SELECT * FROM t WHERE a > 5; +id estRows task access object operator info +TableReader 1.00 root partition:p6 data:Selection +└─Selection 1.00 cop[tikv] gt(executor__partition__partition_boundaries.t.a, 5) + └─TableFullScan 7.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a > 5; +a b +6 6 Filler... +explain format='brief' SELECT * FROM t WHERE a <= 5; +id estRows task access object operator info +TableReader 6.00 root partition:p0,p1,p2,p3,p4,p5 data:Selection +└─Selection 6.00 cop[tikv] le(executor__partition__partition_boundaries.t.a, 5) + └─TableFullScan 7.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a <= 5; +a b +0 0 Filler... +1 1 Filler... +2 2 Filler... +3 3 Filler... +4 4 Filler... +5 5 Filler... +explain format='brief' SELECT * FROM t WHERE a >= 5; +id estRows task access object operator info +TableReader 2.00 root partition:p5,p6 data:Selection +└─Selection 2.00 cop[tikv] ge(executor__partition__partition_boundaries.t.a, 5) + └─TableFullScan 7.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a >= 5; +a b +5 5 Filler... +6 6 Filler... +explain format='brief' SELECT * FROM t WHERE a < 2 OR a > 5; +id estRows task access object operator info +TableReader 3.00 root partition:p0,p1,p6 data:Selection +└─Selection 3.00 cop[tikv] or(lt(executor__partition__partition_boundaries.t.a, 2), gt(executor__partition__partition_boundaries.t.a, 5)) + └─TableFullScan 7.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a < 2 OR a > 5; +a b +0 0 Filler... +1 1 Filler... +6 6 Filler... +explain format='brief' SELECT * FROM t WHERE a > 2 AND a < 5; +id estRows task access object operator info +TableReader 2.00 root partition:p3,p4 data:Selection +└─Selection 2.00 cop[tikv] gt(executor__partition__partition_boundaries.t.a, 2), lt(executor__partition__partition_boundaries.t.a, 5) + └─TableFullScan 7.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a > 2 AND a < 5; +a b +3 3 Filler... +4 4 Filler... +explain format='brief' SELECT * FROM t WHERE NOT (a < 2 OR a > 5); +id estRows task access object operator info +TableReader 4.00 root partition:p2,p3,p4,p5 data:Selection +└─Selection 4.00 cop[tikv] and(ge(executor__partition__partition_boundaries.t.a, 2), le(executor__partition__partition_boundaries.t.a, 5)) + └─TableFullScan 7.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE NOT (a < 2 OR a > 5); +a b +2 2 Filler... +3 3 Filler... +4 4 Filler... +5 5 Filler... +explain format='brief' SELECT * FROM t WHERE NOT (a > 2 AND a < 5); +id estRows task access object operator info +TableReader 5.00 root partition:p0,p1,p2,p5,p6 data:Selection +└─Selection 5.00 cop[tikv] or(le(executor__partition__partition_boundaries.t.a, 2), ge(executor__partition__partition_boundaries.t.a, 5)) + └─TableFullScan 7.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE NOT (a > 2 AND a < 5); +a b +0 0 Filler... +1 1 Filler... +2 2 Filler... +5 5 Filler... +6 6 Filler... +explain format='brief' SELECT * FROM t WHERE a < 2 OR a >= 5; +id estRows task access object operator info +TableReader 4.00 root partition:p0,p1,p5,p6 data:Selection +└─Selection 4.00 cop[tikv] or(lt(executor__partition__partition_boundaries.t.a, 2), ge(executor__partition__partition_boundaries.t.a, 5)) + └─TableFullScan 7.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a < 2 OR a >= 5; +a b +0 0 Filler... +1 1 Filler... +5 5 Filler... +6 6 Filler... +explain format='brief' SELECT * FROM t WHERE a >= 2 AND a < 5; +id estRows task access object operator info +TableReader 3.00 root partition:p2,p3,p4 data:Selection +└─Selection 3.00 cop[tikv] ge(executor__partition__partition_boundaries.t.a, 2), lt(executor__partition__partition_boundaries.t.a, 5) + └─TableFullScan 7.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a >= 2 AND a < 5; +a b +2 2 Filler... +3 3 Filler... +4 4 Filler... +explain format='brief' SELECT * FROM t WHERE NOT (a < 2 OR a >= 5); +id estRows task access object operator info +TableReader 3.00 root partition:p2,p3,p4 data:Selection +└─Selection 3.00 cop[tikv] and(ge(executor__partition__partition_boundaries.t.a, 2), lt(executor__partition__partition_boundaries.t.a, 5)) + └─TableFullScan 7.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE NOT (a < 2 OR a >= 5); +a b +2 2 Filler... +3 3 Filler... +4 4 Filler... +explain format='brief' SELECT * FROM t WHERE NOT (a >= 2 AND a < 5); +id estRows task access object operator info +TableReader 4.00 root partition:p0,p1,p5,p6 data:Selection +└─Selection 4.00 cop[tikv] or(lt(executor__partition__partition_boundaries.t.a, 2), ge(executor__partition__partition_boundaries.t.a, 5)) + └─TableFullScan 7.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE NOT (a >= 2 AND a < 5); +a b +0 0 Filler... +1 1 Filler... +5 5 Filler... +6 6 Filler... +explain format='brief' SELECT * FROM t WHERE a <= 2 OR a > 5; +id estRows task access object operator info +TableReader 4.00 root partition:p0,p1,p2,p6 data:Selection +└─Selection 4.00 cop[tikv] or(le(executor__partition__partition_boundaries.t.a, 2), gt(executor__partition__partition_boundaries.t.a, 5)) + └─TableFullScan 7.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a <= 2 OR a > 5; +a b +0 0 Filler... +1 1 Filler... +2 2 Filler... +6 6 Filler... +explain format='brief' SELECT * FROM t WHERE a > 2 AND a <= 5; +id estRows task access object operator info +TableReader 3.00 root partition:p3,p4,p5 data:Selection +└─Selection 3.00 cop[tikv] gt(executor__partition__partition_boundaries.t.a, 2), le(executor__partition__partition_boundaries.t.a, 5) + └─TableFullScan 7.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a > 2 AND a <= 5; +a b +3 3 Filler... +4 4 Filler... +5 5 Filler... +explain format='brief' SELECT * FROM t WHERE NOT (a <= 2 OR a > 5); +id estRows task access object operator info +TableReader 3.00 root partition:p3,p4,p5 data:Selection +└─Selection 3.00 cop[tikv] and(gt(executor__partition__partition_boundaries.t.a, 2), le(executor__partition__partition_boundaries.t.a, 5)) + └─TableFullScan 7.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE NOT (a <= 2 OR a > 5); +a b +3 3 Filler... +4 4 Filler... +5 5 Filler... +explain format='brief' SELECT * FROM t WHERE NOT (a > 2 AND a <= 5); +id estRows task access object operator info +TableReader 4.00 root partition:p0,p1,p2,p6 data:Selection +└─Selection 4.00 cop[tikv] or(le(executor__partition__partition_boundaries.t.a, 2), gt(executor__partition__partition_boundaries.t.a, 5)) + └─TableFullScan 7.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE NOT (a > 2 AND a <= 5); +a b +0 0 Filler... +1 1 Filler... +2 2 Filler... +6 6 Filler... +explain format='brief' SELECT * FROM t WHERE a <= 2 OR a >= 5; +id estRows task access object operator info +TableReader 5.00 root partition:p0,p1,p2,p5,p6 data:Selection +└─Selection 5.00 cop[tikv] or(le(executor__partition__partition_boundaries.t.a, 2), ge(executor__partition__partition_boundaries.t.a, 5)) + └─TableFullScan 7.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a <= 2 OR a >= 5; +a b +0 0 Filler... +1 1 Filler... +2 2 Filler... +5 5 Filler... +6 6 Filler... +explain format='brief' SELECT * FROM t WHERE a >= 2 AND a <= 5; +id estRows task access object operator info +TableReader 4.00 root partition:p2,p3,p4,p5 data:Selection +└─Selection 4.00 cop[tikv] ge(executor__partition__partition_boundaries.t.a, 2), le(executor__partition__partition_boundaries.t.a, 5) + └─TableFullScan 7.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a >= 2 AND a <= 5; +a b +2 2 Filler... +3 3 Filler... +4 4 Filler... +5 5 Filler... +explain format='brief' SELECT * FROM t WHERE NOT (a <= 2 OR a >= 5); +id estRows task access object operator info +TableReader 2.00 root partition:p3,p4 data:Selection +└─Selection 2.00 cop[tikv] and(gt(executor__partition__partition_boundaries.t.a, 2), lt(executor__partition__partition_boundaries.t.a, 5)) + └─TableFullScan 7.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE NOT (a <= 2 OR a >= 5); +a b +3 3 Filler... +4 4 Filler... +explain format='brief' SELECT * FROM t WHERE NOT (a >= 2 AND a <= 5); +id estRows task access object operator info +TableReader 3.00 root partition:p0,p1,p6 data:Selection +└─Selection 3.00 cop[tikv] or(lt(executor__partition__partition_boundaries.t.a, 2), gt(executor__partition__partition_boundaries.t.a, 5)) + └─TableFullScan 7.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE NOT (a >= 2 AND a <= 5); +a b +0 0 Filler... +1 1 Filler... +6 6 Filler... +explain format='brief' SELECT * FROM t WHERE a < 6; +id estRows task access object operator info +TableReader 6.00 root partition:p0,p1,p2,p3,p4,p5 data:Selection +└─Selection 6.00 cop[tikv] lt(executor__partition__partition_boundaries.t.a, 6) + └─TableFullScan 7.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a < 6; +a b +0 0 Filler... +1 1 Filler... +2 2 Filler... +3 3 Filler... +4 4 Filler... +5 5 Filler... +explain format='brief' SELECT * FROM t WHERE a > 6; +id estRows task access object operator info +TableReader 1.00 root partition:dual data:Selection +└─Selection 1.00 cop[tikv] gt(executor__partition__partition_boundaries.t.a, 6) + └─TableFullScan 7.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a > 6; +a b +explain format='brief' SELECT * FROM t WHERE a <= 6; +id estRows task access object operator info +TableReader 7.00 root partition:all data:Selection +└─Selection 7.00 cop[tikv] le(executor__partition__partition_boundaries.t.a, 6) + └─TableFullScan 7.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a <= 6; +a b +0 0 Filler... +1 1 Filler... +2 2 Filler... +3 3 Filler... +4 4 Filler... +5 5 Filler... +6 6 Filler... +explain format='brief' SELECT * FROM t WHERE a >= 6; +id estRows task access object operator info +TableReader 1.00 root partition:p6 data:Selection +└─Selection 1.00 cop[tikv] ge(executor__partition__partition_boundaries.t.a, 6) + └─TableFullScan 7.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a >= 6; +a b +6 6 Filler... +explain format='brief' SELECT * FROM t WHERE a < 2 OR a > 6; +id estRows task access object operator info +TableReader 2.00 root partition:p0,p1 data:Selection +└─Selection 2.00 cop[tikv] or(lt(executor__partition__partition_boundaries.t.a, 2), gt(executor__partition__partition_boundaries.t.a, 6)) + └─TableFullScan 7.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a < 2 OR a > 6; +a b +0 0 Filler... +1 1 Filler... +explain format='brief' SELECT * FROM t WHERE a > 2 AND a < 6; +id estRows task access object operator info +TableReader 3.00 root partition:p3,p4,p5 data:Selection +└─Selection 3.00 cop[tikv] gt(executor__partition__partition_boundaries.t.a, 2), lt(executor__partition__partition_boundaries.t.a, 6) + └─TableFullScan 7.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a > 2 AND a < 6; +a b +3 3 Filler... +4 4 Filler... +5 5 Filler... +explain format='brief' SELECT * FROM t WHERE NOT (a < 2 OR a > 6); +id estRows task access object operator info +TableReader 5.00 root partition:p2,p3,p4,p5,p6 data:Selection +└─Selection 5.00 cop[tikv] and(ge(executor__partition__partition_boundaries.t.a, 2), le(executor__partition__partition_boundaries.t.a, 6)) + └─TableFullScan 7.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE NOT (a < 2 OR a > 6); +a b +2 2 Filler... +3 3 Filler... +4 4 Filler... +5 5 Filler... +6 6 Filler... +explain format='brief' SELECT * FROM t WHERE NOT (a > 2 AND a < 6); +id estRows task access object operator info +TableReader 4.00 root partition:p0,p1,p2,p6 data:Selection +└─Selection 4.00 cop[tikv] or(le(executor__partition__partition_boundaries.t.a, 2), ge(executor__partition__partition_boundaries.t.a, 6)) + └─TableFullScan 7.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE NOT (a > 2 AND a < 6); +a b +0 0 Filler... +1 1 Filler... +2 2 Filler... +6 6 Filler... +explain format='brief' SELECT * FROM t WHERE a < 2 OR a >= 6; +id estRows task access object operator info +TableReader 3.00 root partition:p0,p1,p6 data:Selection +└─Selection 3.00 cop[tikv] or(lt(executor__partition__partition_boundaries.t.a, 2), ge(executor__partition__partition_boundaries.t.a, 6)) + └─TableFullScan 7.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a < 2 OR a >= 6; +a b +0 0 Filler... +1 1 Filler... +6 6 Filler... +explain format='brief' SELECT * FROM t WHERE a >= 2 AND a < 6; +id estRows task access object operator info +TableReader 4.00 root partition:p2,p3,p4,p5 data:Selection +└─Selection 4.00 cop[tikv] ge(executor__partition__partition_boundaries.t.a, 2), lt(executor__partition__partition_boundaries.t.a, 6) + └─TableFullScan 7.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a >= 2 AND a < 6; +a b +2 2 Filler... +3 3 Filler... +4 4 Filler... +5 5 Filler... +explain format='brief' SELECT * FROM t WHERE NOT (a < 2 OR a >= 6); +id estRows task access object operator info +TableReader 4.00 root partition:p2,p3,p4,p5 data:Selection +└─Selection 4.00 cop[tikv] and(ge(executor__partition__partition_boundaries.t.a, 2), lt(executor__partition__partition_boundaries.t.a, 6)) + └─TableFullScan 7.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE NOT (a < 2 OR a >= 6); +a b +2 2 Filler... +3 3 Filler... +4 4 Filler... +5 5 Filler... +explain format='brief' SELECT * FROM t WHERE NOT (a >= 2 AND a < 6); +id estRows task access object operator info +TableReader 3.00 root partition:p0,p1,p6 data:Selection +└─Selection 3.00 cop[tikv] or(lt(executor__partition__partition_boundaries.t.a, 2), ge(executor__partition__partition_boundaries.t.a, 6)) + └─TableFullScan 7.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE NOT (a >= 2 AND a < 6); +a b +0 0 Filler... +1 1 Filler... +6 6 Filler... +explain format='brief' SELECT * FROM t WHERE a <= 2 OR a > 6; +id estRows task access object operator info +TableReader 3.00 root partition:p0,p1,p2 data:Selection +└─Selection 3.00 cop[tikv] or(le(executor__partition__partition_boundaries.t.a, 2), gt(executor__partition__partition_boundaries.t.a, 6)) + └─TableFullScan 7.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a <= 2 OR a > 6; +a b +0 0 Filler... +1 1 Filler... +2 2 Filler... +explain format='brief' SELECT * FROM t WHERE a > 2 AND a <= 6; +id estRows task access object operator info +TableReader 4.00 root partition:p3,p4,p5,p6 data:Selection +└─Selection 4.00 cop[tikv] gt(executor__partition__partition_boundaries.t.a, 2), le(executor__partition__partition_boundaries.t.a, 6) + └─TableFullScan 7.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a > 2 AND a <= 6; +a b +3 3 Filler... +4 4 Filler... +5 5 Filler... +6 6 Filler... +explain format='brief' SELECT * FROM t WHERE NOT (a <= 2 OR a > 6); +id estRows task access object operator info +TableReader 4.00 root partition:p3,p4,p5,p6 data:Selection +└─Selection 4.00 cop[tikv] and(gt(executor__partition__partition_boundaries.t.a, 2), le(executor__partition__partition_boundaries.t.a, 6)) + └─TableFullScan 7.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE NOT (a <= 2 OR a > 6); +a b +3 3 Filler... +4 4 Filler... +5 5 Filler... +6 6 Filler... +explain format='brief' SELECT * FROM t WHERE NOT (a > 2 AND a <= 6); +id estRows task access object operator info +TableReader 3.00 root partition:p0,p1,p2 data:Selection +└─Selection 3.00 cop[tikv] or(le(executor__partition__partition_boundaries.t.a, 2), gt(executor__partition__partition_boundaries.t.a, 6)) + └─TableFullScan 7.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE NOT (a > 2 AND a <= 6); +a b +0 0 Filler... +1 1 Filler... +2 2 Filler... +explain format='brief' SELECT * FROM t WHERE a <= 2 OR a >= 6; +id estRows task access object operator info +TableReader 4.00 root partition:p0,p1,p2,p6 data:Selection +└─Selection 4.00 cop[tikv] or(le(executor__partition__partition_boundaries.t.a, 2), ge(executor__partition__partition_boundaries.t.a, 6)) + └─TableFullScan 7.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a <= 2 OR a >= 6; +a b +0 0 Filler... +1 1 Filler... +2 2 Filler... +6 6 Filler... +explain format='brief' SELECT * FROM t WHERE a >= 2 AND a <= 6; +id estRows task access object operator info +TableReader 5.00 root partition:p2,p3,p4,p5,p6 data:Selection +└─Selection 5.00 cop[tikv] ge(executor__partition__partition_boundaries.t.a, 2), le(executor__partition__partition_boundaries.t.a, 6) + └─TableFullScan 7.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a >= 2 AND a <= 6; +a b +2 2 Filler... +3 3 Filler... +4 4 Filler... +5 5 Filler... +6 6 Filler... +explain format='brief' SELECT * FROM t WHERE NOT (a <= 2 OR a >= 6); +id estRows task access object operator info +TableReader 3.00 root partition:p3,p4,p5 data:Selection +└─Selection 3.00 cop[tikv] and(gt(executor__partition__partition_boundaries.t.a, 2), lt(executor__partition__partition_boundaries.t.a, 6)) + └─TableFullScan 7.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE NOT (a <= 2 OR a >= 6); +a b +3 3 Filler... +4 4 Filler... +5 5 Filler... +explain format='brief' SELECT * FROM t WHERE NOT (a >= 2 AND a <= 6); +id estRows task access object operator info +TableReader 2.00 root partition:p0,p1 data:Selection +└─Selection 2.00 cop[tikv] or(lt(executor__partition__partition_boundaries.t.a, 2), gt(executor__partition__partition_boundaries.t.a, 6)) + └─TableFullScan 7.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE NOT (a >= 2 AND a <= 6); +a b +0 0 Filler... +1 1 Filler... +explain format='brief' SELECT * FROM t WHERE a < 7; +id estRows task access object operator info +TableReader 7.00 root partition:all data:Selection +└─Selection 7.00 cop[tikv] lt(executor__partition__partition_boundaries.t.a, 7) + └─TableFullScan 7.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a < 7; +a b +0 0 Filler... +1 1 Filler... +2 2 Filler... +3 3 Filler... +4 4 Filler... +5 5 Filler... +6 6 Filler... +explain format='brief' SELECT * FROM t WHERE a > 7; +id estRows task access object operator info +TableReader 1.00 root partition:dual data:Selection +└─Selection 1.00 cop[tikv] gt(executor__partition__partition_boundaries.t.a, 7) + └─TableFullScan 7.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a > 7; +a b +explain format='brief' SELECT * FROM t WHERE a <= 7; +id estRows task access object operator info +TableReader 7.00 root partition:all data:Selection +└─Selection 7.00 cop[tikv] le(executor__partition__partition_boundaries.t.a, 7) + └─TableFullScan 7.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a <= 7; +a b +0 0 Filler... +1 1 Filler... +2 2 Filler... +3 3 Filler... +4 4 Filler... +5 5 Filler... +6 6 Filler... +explain format='brief' SELECT * FROM t WHERE a >= 7; +id estRows task access object operator info +TableReader 1.00 root partition:dual data:Selection +└─Selection 1.00 cop[tikv] ge(executor__partition__partition_boundaries.t.a, 7) + └─TableFullScan 7.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a >= 7; +a b +explain format='brief' SELECT * FROM t WHERE a < 2 OR a > 7; +id estRows task access object operator info +TableReader 2.00 root partition:p0,p1 data:Selection +└─Selection 2.00 cop[tikv] or(lt(executor__partition__partition_boundaries.t.a, 2), gt(executor__partition__partition_boundaries.t.a, 7)) + └─TableFullScan 7.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a < 2 OR a > 7; +a b +0 0 Filler... +1 1 Filler... +explain format='brief' SELECT * FROM t WHERE a > 2 AND a < 7; +id estRows task access object operator info +TableReader 4.00 root partition:p3,p4,p5,p6 data:Selection +└─Selection 4.00 cop[tikv] gt(executor__partition__partition_boundaries.t.a, 2), lt(executor__partition__partition_boundaries.t.a, 7) + └─TableFullScan 7.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a > 2 AND a < 7; +a b +3 3 Filler... +4 4 Filler... +5 5 Filler... +6 6 Filler... +explain format='brief' SELECT * FROM t WHERE NOT (a < 2 OR a > 7); +id estRows task access object operator info +TableReader 5.00 root partition:p2,p3,p4,p5,p6 data:Selection +└─Selection 5.00 cop[tikv] and(ge(executor__partition__partition_boundaries.t.a, 2), le(executor__partition__partition_boundaries.t.a, 7)) + └─TableFullScan 7.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE NOT (a < 2 OR a > 7); +a b +2 2 Filler... +3 3 Filler... +4 4 Filler... +5 5 Filler... +6 6 Filler... +explain format='brief' SELECT * FROM t WHERE NOT (a > 2 AND a < 7); +id estRows task access object operator info +TableReader 3.00 root partition:p0,p1,p2 data:Selection +└─Selection 3.00 cop[tikv] or(le(executor__partition__partition_boundaries.t.a, 2), ge(executor__partition__partition_boundaries.t.a, 7)) + └─TableFullScan 7.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE NOT (a > 2 AND a < 7); +a b +0 0 Filler... +1 1 Filler... +2 2 Filler... +explain format='brief' SELECT * FROM t WHERE a < 2 OR a >= 7; +id estRows task access object operator info +TableReader 2.00 root partition:p0,p1 data:Selection +└─Selection 2.00 cop[tikv] or(lt(executor__partition__partition_boundaries.t.a, 2), ge(executor__partition__partition_boundaries.t.a, 7)) + └─TableFullScan 7.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a < 2 OR a >= 7; +a b +0 0 Filler... +1 1 Filler... +explain format='brief' SELECT * FROM t WHERE a >= 2 AND a < 7; +id estRows task access object operator info +TableReader 5.00 root partition:p2,p3,p4,p5,p6 data:Selection +└─Selection 5.00 cop[tikv] ge(executor__partition__partition_boundaries.t.a, 2), lt(executor__partition__partition_boundaries.t.a, 7) + └─TableFullScan 7.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a >= 2 AND a < 7; +a b +2 2 Filler... +3 3 Filler... +4 4 Filler... +5 5 Filler... +6 6 Filler... +explain format='brief' SELECT * FROM t WHERE NOT (a < 2 OR a >= 7); +id estRows task access object operator info +TableReader 5.00 root partition:p2,p3,p4,p5,p6 data:Selection +└─Selection 5.00 cop[tikv] and(ge(executor__partition__partition_boundaries.t.a, 2), lt(executor__partition__partition_boundaries.t.a, 7)) + └─TableFullScan 7.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE NOT (a < 2 OR a >= 7); +a b +2 2 Filler... +3 3 Filler... +4 4 Filler... +5 5 Filler... +6 6 Filler... +explain format='brief' SELECT * FROM t WHERE NOT (a >= 2 AND a < 7); +id estRows task access object operator info +TableReader 2.00 root partition:p0,p1 data:Selection +└─Selection 2.00 cop[tikv] or(lt(executor__partition__partition_boundaries.t.a, 2), ge(executor__partition__partition_boundaries.t.a, 7)) + └─TableFullScan 7.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE NOT (a >= 2 AND a < 7); +a b +0 0 Filler... +1 1 Filler... +explain format='brief' SELECT * FROM t WHERE a <= 2 OR a > 7; +id estRows task access object operator info +TableReader 3.00 root partition:p0,p1,p2 data:Selection +└─Selection 3.00 cop[tikv] or(le(executor__partition__partition_boundaries.t.a, 2), gt(executor__partition__partition_boundaries.t.a, 7)) + └─TableFullScan 7.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a <= 2 OR a > 7; +a b +0 0 Filler... +1 1 Filler... +2 2 Filler... +explain format='brief' SELECT * FROM t WHERE a > 2 AND a <= 7; +id estRows task access object operator info +TableReader 4.00 root partition:p3,p4,p5,p6 data:Selection +└─Selection 4.00 cop[tikv] gt(executor__partition__partition_boundaries.t.a, 2), le(executor__partition__partition_boundaries.t.a, 7) + └─TableFullScan 7.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a > 2 AND a <= 7; +a b +3 3 Filler... +4 4 Filler... +5 5 Filler... +6 6 Filler... +explain format='brief' SELECT * FROM t WHERE NOT (a <= 2 OR a > 7); +id estRows task access object operator info +TableReader 4.00 root partition:p3,p4,p5,p6 data:Selection +└─Selection 4.00 cop[tikv] and(gt(executor__partition__partition_boundaries.t.a, 2), le(executor__partition__partition_boundaries.t.a, 7)) + └─TableFullScan 7.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE NOT (a <= 2 OR a > 7); +a b +3 3 Filler... +4 4 Filler... +5 5 Filler... +6 6 Filler... +explain format='brief' SELECT * FROM t WHERE NOT (a > 2 AND a <= 7); +id estRows task access object operator info +TableReader 3.00 root partition:p0,p1,p2 data:Selection +└─Selection 3.00 cop[tikv] or(le(executor__partition__partition_boundaries.t.a, 2), gt(executor__partition__partition_boundaries.t.a, 7)) + └─TableFullScan 7.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE NOT (a > 2 AND a <= 7); +a b +0 0 Filler... +1 1 Filler... +2 2 Filler... +explain format='brief' SELECT * FROM t WHERE a <= 2 OR a >= 7; +id estRows task access object operator info +TableReader 3.00 root partition:p0,p1,p2 data:Selection +└─Selection 3.00 cop[tikv] or(le(executor__partition__partition_boundaries.t.a, 2), ge(executor__partition__partition_boundaries.t.a, 7)) + └─TableFullScan 7.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a <= 2 OR a >= 7; +a b +0 0 Filler... +1 1 Filler... +2 2 Filler... +explain format='brief' SELECT * FROM t WHERE a >= 2 AND a <= 7; +id estRows task access object operator info +TableReader 5.00 root partition:p2,p3,p4,p5,p6 data:Selection +└─Selection 5.00 cop[tikv] ge(executor__partition__partition_boundaries.t.a, 2), le(executor__partition__partition_boundaries.t.a, 7) + └─TableFullScan 7.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE a >= 2 AND a <= 7; +a b +2 2 Filler... +3 3 Filler... +4 4 Filler... +5 5 Filler... +6 6 Filler... +explain format='brief' SELECT * FROM t WHERE NOT (a <= 2 OR a >= 7); +id estRows task access object operator info +TableReader 4.00 root partition:p3,p4,p5,p6 data:Selection +└─Selection 4.00 cop[tikv] and(gt(executor__partition__partition_boundaries.t.a, 2), lt(executor__partition__partition_boundaries.t.a, 7)) + └─TableFullScan 7.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE NOT (a <= 2 OR a >= 7); +a b +3 3 Filler... +4 4 Filler... +5 5 Filler... +6 6 Filler... +explain format='brief' SELECT * FROM t WHERE NOT (a >= 2 AND a <= 7); +id estRows task access object operator info +TableReader 2.00 root partition:p0,p1 data:Selection +└─Selection 2.00 cop[tikv] or(lt(executor__partition__partition_boundaries.t.a, 2), gt(executor__partition__partition_boundaries.t.a, 7)) + └─TableFullScan 7.00 cop[tikv] table:t keep order:false +SELECT * FROM t WHERE NOT (a >= 2 AND a <= 7); +a b +0 0 Filler... +1 1 Filler... +set @@tidb_partition_prune_mode = default; diff --git a/tests/integrationtest/r/executor/partition/partition_with_expression.result b/tests/integrationtest/r/executor/partition/partition_with_expression.result new file mode 100644 index 0000000000000..81c168a8d0bc1 --- /dev/null +++ b/tests/integrationtest/r/executor/partition/partition_with_expression.result @@ -0,0 +1,1250 @@ +drop table if exists tp, t; +set tidb_partition_prune_mode='dynamic'; +create table tp(a datetime, b int) partition by range columns (a) (partition p0 values less than("2012-12-10 00:00:00"), partition p1 values less than("2022-12-30 00:00:00"), partition p2 values less than("2025-12-12 00:00:00")); +create table t(a datetime, b int) partition by range columns (a) (partition p0 values less than("2012-12-10 00:00:00"), partition p1 values less than("2022-12-30 00:00:00"), partition p2 values less than("2025-12-12 00:00:00")); +insert into tp values("2015-09-09 00:00:00", 1), ("2020-08-08 19:00:01", 2), ("2024-01-01 01:01:01", 3); +insert into t values("2015-09-09 00:00:00", 1), ("2020-08-08 19:00:01", 2), ("2024-01-01 01:01:01", 3); +analyze table tp all columns; +analyze table t all columns; +explain format='brief' select * from tp where a != '2024-01-01 01:01:01'; +id estRows task access object operator info +TableReader 2.00 root partition:all data:Selection +└─Selection 2.00 cop[tikv] ne(executor__partition__partition_with_expression.tp.a, 2024-01-01 01:01:01.000000) + └─TableFullScan 3.00 cop[tikv] table:tp keep order:false +select * from tp where a != '2024-01-01 01:01:01'; +a b +2015-09-09 00:00:00 1 +2020-08-08 19:00:01 2 +select * from t where a != '2024-01-01 01:01:01'; +a b +2015-09-09 00:00:00 1 +2020-08-08 19:00:01 2 +explain format='brief' select * from tp where a != '2024-01-01 01:01:01' and a > '2015-09-09 00:00:00'; +id estRows task access object operator info +TableReader 1.00 root partition:p1,p2 data:Selection +└─Selection 1.00 cop[tikv] gt(executor__partition__partition_with_expression.tp.a, 2015-09-09 00:00:00.000000), ne(executor__partition__partition_with_expression.tp.a, 2024-01-01 01:01:01.000000) + └─TableFullScan 3.00 cop[tikv] table:tp keep order:false +select * from tp where a != '2024-01-01 01:01:01' and a > '2015-09-09 00:00:00'; +a b +2020-08-08 19:00:01 2 +select * from t where a != '2024-01-01 01:01:01' and a > '2015-09-09 00:00:00'; +a b +2020-08-08 19:00:01 2 +set tidb_partition_prune_mode=default; +drop table if exists tp, t; +set tidb_partition_prune_mode='dynamic'; +create table tp(a datetime, b int) partition by range(weekday(a)) (partition p0 values less than(3), partition p1 values less than(5), partition p2 values less than(8)); +create table t(a datetime, b int); +insert into tp values("2020-08-17 00:00:00", 1), ("2020-08-18 00:00:00", 2), ("2020-08-19 00:00:00", 4), ("2020-08-20 00:00:00", 5), ("2020-08-21 00:00:00", 6), ("2020-08-22 00:00:00", 0); +insert into t values("2020-08-17 00:00:00", 1), ("2020-08-18 00:00:00", 2), ("2020-08-19 00:00:00", 4), ("2020-08-20 00:00:00", 5), ("2020-08-21 00:00:00", 6), ("2020-08-22 00:00:00", 0); +analyze table tp all columns; +analyze table t all columns; +explain format='brief' select * from tp where a = '2020-08-17 00:00:00'; +id estRows task access object operator info +TableReader 1.00 root partition:p0 data:Selection +└─Selection 1.00 cop[tikv] eq(executor__partition__partition_with_expression.tp.a, 2020-08-17 00:00:00.000000) + └─TableFullScan 6.00 cop[tikv] table:tp keep order:false +select * from tp where a = '2020-08-17 00:00:00'; +a b +2020-08-17 00:00:00 1 +select * from t where a = '2020-08-17 00:00:00'; +a b +2020-08-17 00:00:00 1 +explain format='brief' select * from tp where a= '2020-08-20 00:00:00' and a < '2020-08-22 00:00:00'; +id estRows task access object operator info +TableReader 1.00 root partition:p1 data:Selection +└─Selection 1.00 cop[tikv] eq(executor__partition__partition_with_expression.tp.a, 2020-08-20 00:00:00.000000) + └─TableFullScan 6.00 cop[tikv] table:tp keep order:false +select * from tp where a= '2020-08-20 00:00:00' and a < '2020-08-22 00:00:00'; +a b +2020-08-20 00:00:00 5 +select * from t where a= '2020-08-20 00:00:00' and a < '2020-08-22 00:00:00'; +a b +2020-08-20 00:00:00 5 +explain format='brief' select * from tp where a < '2020-08-19 00:00:00'; +id estRows task access object operator info +TableReader 2.00 root partition:all data:Selection +└─Selection 2.00 cop[tikv] lt(executor__partition__partition_with_expression.tp.a, 2020-08-19 00:00:00.000000) + └─TableFullScan 6.00 cop[tikv] table:tp keep order:false +select * from tp where a < '2020-08-19 00:00:00'; +a b +2020-08-17 00:00:00 1 +2020-08-18 00:00:00 2 +select * from t where a < '2020-08-19 00:00:00'; +a b +2020-08-17 00:00:00 1 +2020-08-18 00:00:00 2 +set tidb_partition_prune_mode=default; +drop table if exists tp, t; +set tidb_partition_prune_mode='dynamic'; +create table tp(a timestamp, b int) partition by range(floor(unix_timestamp(a))) (partition p0 values less than(1580670000), partition p1 values less than(1597622400), partition p2 values less than(1629158400)); +create table t(a timestamp, b int); +insert into tp values('2020-01-01 19:00:00', 1),('2020-08-15 00:00:00', -1), ('2020-08-18 05:00:01', 2), ('2020-10-01 14:13:15', 3); +insert into t values('2020-01-01 19:00:00', 1),('2020-08-15 00:00:00', -1), ('2020-08-18 05:00:01', 2), ('2020-10-01 14:13:15', 3); +analyze table tp all columns; +analyze table t all columns; +explain select * from tp where a > '2020-09-11 00:00:00'; +id estRows task access object operator info +TableReader_7 1.00 root partition:p2 data:Selection_6 +└─Selection_6 1.00 cop[tikv] gt(executor__partition__partition_with_expression.tp.a, 2020-09-11 00:00:00.000000) + └─TableFullScan_5 4.00 cop[tikv] table:tp keep order:false +select * from tp where a > '2020-09-11 00:00:00'; +a b +2020-10-01 14:13:15 3 +select * from t where a > '2020-09-11 00:00:00'; +a b +2020-10-01 14:13:15 3 +explain select * from tp where a < '2020-07-07 01:00:00'; +id estRows task access object operator info +TableReader_7 1.00 root partition:p0,p1 data:Selection_6 +└─Selection_6 1.00 cop[tikv] lt(executor__partition__partition_with_expression.tp.a, 2020-07-07 01:00:00.000000) + └─TableFullScan_5 4.00 cop[tikv] table:tp keep order:false +select * from tp where a < '2020-07-07 01:00:00'; +a b +2020-01-01 19:00:00 1 +select * from t where a < '2020-07-07 01:00:00'; +a b +2020-01-01 19:00:00 1 +set tidb_partition_prune_mode=default; +drop table if exists tp, t; +set tidb_partition_prune_mode='dynamic'; +create table tp(a timestamp, b int) partition by range(unix_timestamp(a)) (partition p0 values less than(1580670000), partition p1 values less than(1597622400), partition p2 values less than(1629158400)); +create table t(a timestamp, b int); +insert into tp values('2020-01-01 19:00:00', 1),('2020-08-15 00:00:00', -1), ('2020-08-18 05:00:01', 2), ('2020-10-01 14:13:15', 3); +insert into t values('2020-01-01 19:00:00', 1),('2020-08-15 00:00:00', -1), ('2020-08-18 05:00:01', 2), ('2020-10-01 14:13:15', 3); +analyze table tp all columns; +analyze table t all columns; +explain select * from tp where a > '2020-09-11 00:00:00'; +id estRows task access object operator info +TableReader_7 1.00 root partition:p2 data:Selection_6 +└─Selection_6 1.00 cop[tikv] gt(executor__partition__partition_with_expression.tp.a, 2020-09-11 00:00:00.000000) + └─TableFullScan_5 4.00 cop[tikv] table:tp keep order:false +select * from tp where a > '2020-09-11 00:00:00'; +a b +2020-10-01 14:13:15 3 +select * from t where a > '2020-09-11 00:00:00'; +a b +2020-10-01 14:13:15 3 +explain select * from tp where a < '2020-07-07 01:00:00'; +id estRows task access object operator info +TableReader_7 1.00 root partition:p0,p1 data:Selection_6 +└─Selection_6 1.00 cop[tikv] lt(executor__partition__partition_with_expression.tp.a, 2020-07-07 01:00:00.000000) + └─TableFullScan_5 4.00 cop[tikv] table:tp keep order:false +select * from tp where a < '2020-07-07 01:00:00'; +a b +2020-01-01 19:00:00 1 +select * from t where a < '2020-07-07 01:00:00'; +a b +2020-01-01 19:00:00 1 +set tidb_partition_prune_mode=default; +drop table if exists tp, t; +set tidb_partition_prune_mode='dynamic'; +create table tp(a datetime, b int) partition by range columns(a) (partition p0 values less than('2020-02-02 00:00:00'), partition p1 values less than('2020-09-01 00:00:00'), partition p2 values less than('2020-12-20 00:00:00')); +create table t(a datetime, b int); +insert into tp values('2020-01-01 12:00:00', 1), ('2020-08-22 10:00:00', 2), ('2020-09-09 11:00:00', 3), ('2020-10-01 00:00:00', 4); +insert into t values('2020-01-01 12:00:00', 1), ('2020-08-22 10:00:00', 2), ('2020-09-09 11:00:00', 3), ('2020-10-01 00:00:00', 4); +analyze table tp all columns; +analyze table t all columns; +explain select * from tp where a < '2020-09-01 00:00:00'; +id estRows task access object operator info +TableReader_7 2.00 root partition:p0,p1 data:Selection_6 +└─Selection_6 2.00 cop[tikv] lt(executor__partition__partition_with_expression.tp.a, 2020-09-01 00:00:00.000000) + └─TableFullScan_5 4.00 cop[tikv] table:tp keep order:false +select * from tp where a < '2020-09-01 00:00:00'; +a b +2020-01-01 12:00:00 1 +2020-08-22 10:00:00 2 +select * from t where a < '2020-09-01 00:00:00'; +a b +2020-01-01 12:00:00 1 +2020-08-22 10:00:00 2 +explain select * from tp where a > '2020-07-07 01:00:00'; +id estRows task access object operator info +TableReader_7 3.00 root partition:p1,p2 data:Selection_6 +└─Selection_6 3.00 cop[tikv] gt(executor__partition__partition_with_expression.tp.a, 2020-07-07 01:00:00.000000) + └─TableFullScan_5 4.00 cop[tikv] table:tp keep order:false +select * from tp where a > '2020-07-07 01:00:00'; +a b +2020-08-22 10:00:00 2 +2020-09-09 11:00:00 3 +2020-10-01 00:00:00 4 +select * from t where a > '2020-07-07 01:00:00'; +a b +2020-08-22 10:00:00 2 +2020-09-09 11:00:00 3 +2020-10-01 00:00:00 4 +set tidb_partition_prune_mode=default; +drop table if exists tp, t; +set tidb_partition_prune_mode='dynamic'; +create table tp(a varchar(255), b int) partition by range columns(a) (partition p0 values less than('ddd'), partition p1 values less than('ggggg'), partition p2 values less than('mmmmmm')); +create table t(a varchar(255), b int); +insert into tp values('aaa', 1), ('bbbb', 2), ('ccc', 3), ('dfg', 4), ('kkkk', 5), ('10', 6); +insert into t values('aaa', 1), ('bbbb', 2), ('ccc', 3), ('dfg', 4), ('kkkk', 5), ('10', 6); +analyze table tp all columns; +analyze table t all columns; +explain select * from tp where a < '10'; +id estRows task access object operator info +TableReader_7 1.00 root partition:p0 data:Selection_6 +└─Selection_6 1.00 cop[tikv] lt(executor__partition__partition_with_expression.tp.a, "10") + └─TableFullScan_5 6.00 cop[tikv] table:tp keep order:false +select * from tp where a < '10'; +a b +select * from t where a < '10'; +a b +explain select * from tp where a > 0; +id estRows task access object operator info +TableReader_7 4.80 root partition:all data:Selection_6 +└─Selection_6 4.80 cop[tikv] gt(cast(executor__partition__partition_with_expression.tp.a, double BINARY), 0) + └─TableFullScan_5 6.00 cop[tikv] table:tp keep order:false +select * from tp where a > 0; +a b +10 6 +select * from t where a > 0; +a b +10 6 +explain select * from tp where a < 0; +id estRows task access object operator info +TableReader_7 4.80 root partition:all data:Selection_6 +└─Selection_6 4.80 cop[tikv] lt(cast(executor__partition__partition_with_expression.tp.a, double BINARY), 0) + └─TableFullScan_5 6.00 cop[tikv] table:tp keep order:false +select * from tp where a < 0; +a b +select * from t where a < 0; +a b +set tidb_partition_prune_mode=default; +drop table if exists trange, thash, t; +create table trange(a int, b int) partition by range(a) (partition p0 values less than(3), partition p1 values less than (5), partition p2 values less than(11)); +create table thash(a int, b int) partition by hash(a) partitions 4; +create table t(a int, b int); +insert into trange values(1, NULL), (1, NULL), (1, 1), (2, 1), (3, 2), (4, 3), (5, 5), (6, 7), (7, 7), (7, 7), (10, NULL), (NULL, NULL), (NULL, 1); +insert into thash values(1, NULL), (1, NULL), (1, 1), (2, 1), (3, 2), (4, 3), (5, 5), (6, 7), (7, 7), (7, 7), (10, NULL), (NULL, NULL), (NULL, 1); +insert into t values(1, NULL), (1, NULL), (1, 1), (2, 1), (3, 2), (4, 3), (5, 5), (6, 7), (7, 7), (7, 7), (10, NULL), (NULL, NULL), (NULL, 1); +set session tidb_partition_prune_mode='dynamic'; +analyze table trange all columns; +analyze table thash all columns; +analyze table t all columns; +SELECT * from t where a = 2; +a b +2 1 +explain format='brief' select * from trange where a = 2; +id estRows task access object operator info +TableReader 1.00 root partition:p0 data:Selection +└─Selection 1.00 cop[tikv] eq(executor__partition__partition_with_expression.trange.a, 2) + └─TableFullScan 13.00 cop[tikv] table:trange keep order:false +SELECT * from trange where a = 2; +a b +2 1 +explain format='brief' select * from thash where a = 2; +id estRows task access object operator info +TableReader 1.00 root partition:p2 data:Selection +└─Selection 1.00 cop[tikv] eq(executor__partition__partition_with_expression.thash.a, 2) + └─TableFullScan 13.00 cop[tikv] table:thash keep order:false +SELECT * from thash where a = 2; +a b +2 1 +SELECT * from t where a = 4 or a = 1; +a b +1 NULL +1 NULL +1 1 +4 3 +explain format='brief' select * from trange where a = 4 or a = 1; +id estRows task access object operator info +TableReader 4.00 root partition:p0,p1 data:Selection +└─Selection 4.00 cop[tikv] or(eq(executor__partition__partition_with_expression.trange.a, 4), eq(executor__partition__partition_with_expression.trange.a, 1)) + └─TableFullScan 13.00 cop[tikv] table:trange keep order:false +SELECT * from trange where a = 4 or a = 1; +a b +1 NULL +1 NULL +1 1 +4 3 +explain format='brief' select * from thash where a = 4 or a = 1; +id estRows task access object operator info +TableReader 4.00 root partition:p0,p1 data:Selection +└─Selection 4.00 cop[tikv] or(eq(executor__partition__partition_with_expression.thash.a, 4), eq(executor__partition__partition_with_expression.thash.a, 1)) + └─TableFullScan 13.00 cop[tikv] table:thash keep order:false +SELECT * from thash where a = 4 or a = 1; +a b +1 NULL +1 NULL +1 1 +4 3 +SELECT * from t where a = -1; +a b +explain format='brief' select * from trange where a = -1; +id estRows task access object operator info +TableReader 1.00 root partition:p0 data:Selection +└─Selection 1.00 cop[tikv] eq(executor__partition__partition_with_expression.trange.a, -1) + └─TableFullScan 13.00 cop[tikv] table:trange keep order:false +SELECT * from trange where a = -1; +a b +explain format='brief' select * from thash where a = -1; +id estRows task access object operator info +TableReader 1.00 root partition:p1 data:Selection +└─Selection 1.00 cop[tikv] eq(executor__partition__partition_with_expression.thash.a, -1) + └─TableFullScan 13.00 cop[tikv] table:thash keep order:false +SELECT * from thash where a = -1; +a b +SELECT * from t where a is NULL; +a b +NULL NULL +NULL 1 +explain format='brief' select * from trange where a is NULL; +id estRows task access object operator info +TableReader 2.00 root partition:p0 data:Selection +└─Selection 2.00 cop[tikv] isnull(executor__partition__partition_with_expression.trange.a) + └─TableFullScan 13.00 cop[tikv] table:trange keep order:false +SELECT * from trange where a is NULL; +a b +NULL NULL +NULL 1 +explain format='brief' select * from thash where a is NULL; +id estRows task access object operator info +TableReader 2.00 root partition:p0 data:Selection +└─Selection 2.00 cop[tikv] isnull(executor__partition__partition_with_expression.thash.a) + └─TableFullScan 13.00 cop[tikv] table:thash keep order:false +SELECT * from thash where a is NULL; +a b +NULL NULL +NULL 1 +SELECT * from t where b is NULL; +a b +NULL NULL +1 NULL +1 NULL +10 NULL +explain format='brief' select * from trange where b is NULL; +id estRows task access object operator info +TableReader 4.00 root partition:all data:Selection +└─Selection 4.00 cop[tikv] isnull(executor__partition__partition_with_expression.trange.b) + └─TableFullScan 13.00 cop[tikv] table:trange keep order:false +SELECT * from trange where b is NULL; +a b +NULL NULL +1 NULL +1 NULL +10 NULL +explain format='brief' select * from thash where b is NULL; +id estRows task access object operator info +TableReader 4.00 root partition:all data:Selection +└─Selection 4.00 cop[tikv] isnull(executor__partition__partition_with_expression.thash.b) + └─TableFullScan 13.00 cop[tikv] table:thash keep order:false +SELECT * from thash where b is NULL; +a b +NULL NULL +1 NULL +1 NULL +10 NULL +SELECT * from t where a > -1; +a b +1 NULL +1 NULL +1 1 +10 NULL +2 1 +3 2 +4 3 +5 5 +6 7 +7 7 +7 7 +explain format='brief' select * from trange where a > -1; +id estRows task access object operator info +TableReader 11.00 root partition:all data:Selection +└─Selection 11.00 cop[tikv] gt(executor__partition__partition_with_expression.trange.a, -1) + └─TableFullScan 13.00 cop[tikv] table:trange keep order:false +SELECT * from trange where a > -1; +a b +1 NULL +1 NULL +1 1 +10 NULL +2 1 +3 2 +4 3 +5 5 +6 7 +7 7 +7 7 +explain format='brief' select * from thash where a > -1; +id estRows task access object operator info +TableReader 11.00 root partition:all data:Selection +└─Selection 11.00 cop[tikv] gt(executor__partition__partition_with_expression.thash.a, -1) + └─TableFullScan 13.00 cop[tikv] table:thash keep order:false +SELECT * from thash where a > -1; +a b +1 NULL +1 NULL +1 1 +10 NULL +2 1 +3 2 +4 3 +5 5 +6 7 +7 7 +7 7 +SELECT * from t where a >= 4 and a <= 5; +a b +4 3 +5 5 +explain format='brief' select * from trange where a >= 4 and a <= 5; +id estRows task access object operator info +TableReader 2.00 root partition:p1,p2 data:Selection +└─Selection 2.00 cop[tikv] ge(executor__partition__partition_with_expression.trange.a, 4), le(executor__partition__partition_with_expression.trange.a, 5) + └─TableFullScan 13.00 cop[tikv] table:trange keep order:false +SELECT * from trange where a >= 4 and a <= 5; +a b +4 3 +5 5 +explain format='brief' select * from thash where a >= 4 and a <= 5; +id estRows task access object operator info +TableReader 2.00 root partition:p0,p1 data:Selection +└─Selection 2.00 cop[tikv] ge(executor__partition__partition_with_expression.thash.a, 4), le(executor__partition__partition_with_expression.thash.a, 5) + └─TableFullScan 13.00 cop[tikv] table:thash keep order:false +SELECT * from thash where a >= 4 and a <= 5; +a b +4 3 +5 5 +SELECT * from t where a > 10; +a b +explain format='brief' select * from trange where a > 10; +id estRows task access object operator info +TableReader 1.00 root partition:dual data:Selection +└─Selection 1.00 cop[tikv] gt(executor__partition__partition_with_expression.trange.a, 10) + └─TableFullScan 13.00 cop[tikv] table:trange keep order:false +SELECT * from trange where a > 10; +a b +explain format='brief' select * from thash where a > 10; +id estRows task access object operator info +TableReader 1.00 root partition:all data:Selection +└─Selection 1.00 cop[tikv] gt(executor__partition__partition_with_expression.thash.a, 10) + └─TableFullScan 13.00 cop[tikv] table:thash keep order:false +SELECT * from thash where a > 10; +a b +SELECT * from t where a >=2 and a <= 3; +a b +2 1 +3 2 +explain format='brief' select * from trange where a >=2 and a <= 3; +id estRows task access object operator info +TableReader 2.00 root partition:p0,p1 data:Selection +└─Selection 2.00 cop[tikv] ge(executor__partition__partition_with_expression.trange.a, 2), le(executor__partition__partition_with_expression.trange.a, 3) + └─TableFullScan 13.00 cop[tikv] table:trange keep order:false +SELECT * from trange where a >=2 and a <= 3; +a b +2 1 +3 2 +explain format='brief' select * from thash where a >=2 and a <= 3; +id estRows task access object operator info +TableReader 2.00 root partition:p2,p3 data:Selection +└─Selection 2.00 cop[tikv] ge(executor__partition__partition_with_expression.thash.a, 2), le(executor__partition__partition_with_expression.thash.a, 3) + └─TableFullScan 13.00 cop[tikv] table:thash keep order:false +SELECT * from thash where a >=2 and a <= 3; +a b +2 1 +3 2 +SELECT * from t where a between 2 and 3; +a b +2 1 +3 2 +explain format='brief' select * from trange where a between 2 and 3; +id estRows task access object operator info +TableReader 2.00 root partition:p0,p1 data:Selection +└─Selection 2.00 cop[tikv] ge(executor__partition__partition_with_expression.trange.a, 2), le(executor__partition__partition_with_expression.trange.a, 3) + └─TableFullScan 13.00 cop[tikv] table:trange keep order:false +SELECT * from trange where a between 2 and 3; +a b +2 1 +3 2 +explain format='brief' select * from thash where a between 2 and 3; +id estRows task access object operator info +TableReader 2.00 root partition:p2,p3 data:Selection +└─Selection 2.00 cop[tikv] ge(executor__partition__partition_with_expression.thash.a, 2), le(executor__partition__partition_with_expression.thash.a, 3) + └─TableFullScan 13.00 cop[tikv] table:thash keep order:false +SELECT * from thash where a between 2 and 3; +a b +2 1 +3 2 +SELECT * from t where a < 2; +a b +1 NULL +1 NULL +1 1 +explain format='brief' select * from trange where a < 2; +id estRows task access object operator info +TableReader 3.00 root partition:p0 data:Selection +└─Selection 3.00 cop[tikv] lt(executor__partition__partition_with_expression.trange.a, 2) + └─TableFullScan 13.00 cop[tikv] table:trange keep order:false +SELECT * from trange where a < 2; +a b +1 NULL +1 NULL +1 1 +explain format='brief' select * from thash where a < 2; +id estRows task access object operator info +TableReader 3.00 root partition:all data:Selection +└─Selection 3.00 cop[tikv] lt(executor__partition__partition_with_expression.thash.a, 2) + └─TableFullScan 13.00 cop[tikv] table:thash keep order:false +SELECT * from thash where a < 2; +a b +1 NULL +1 NULL +1 1 +SELECT * from t where a <= 3; +a b +1 NULL +1 NULL +1 1 +2 1 +3 2 +explain format='brief' select * from trange where a <= 3; +id estRows task access object operator info +TableReader 5.00 root partition:p0,p1 data:Selection +└─Selection 5.00 cop[tikv] le(executor__partition__partition_with_expression.trange.a, 3) + └─TableFullScan 13.00 cop[tikv] table:trange keep order:false +SELECT * from trange where a <= 3; +a b +1 NULL +1 NULL +1 1 +2 1 +3 2 +explain format='brief' select * from thash where a <= 3; +id estRows task access object operator info +TableReader 5.00 root partition:all data:Selection +└─Selection 5.00 cop[tikv] le(executor__partition__partition_with_expression.thash.a, 3) + └─TableFullScan 13.00 cop[tikv] table:thash keep order:false +SELECT * from thash where a <= 3; +a b +1 NULL +1 NULL +1 1 +2 1 +3 2 +SELECT * from t where a in (2, 3); +a b +2 1 +3 2 +explain format='brief' select * from trange where a in (2, 3); +id estRows task access object operator info +TableReader 2.00 root partition:p0,p1 data:Selection +└─Selection 2.00 cop[tikv] in(executor__partition__partition_with_expression.trange.a, 2, 3) + └─TableFullScan 13.00 cop[tikv] table:trange keep order:false +SELECT * from trange where a in (2, 3); +a b +2 1 +3 2 +explain format='brief' select * from thash where a in (2, 3); +id estRows task access object operator info +TableReader 2.00 root partition:p2,p3 data:Selection +└─Selection 2.00 cop[tikv] in(executor__partition__partition_with_expression.thash.a, 2, 3) + └─TableFullScan 13.00 cop[tikv] table:thash keep order:false +SELECT * from thash where a in (2, 3); +a b +2 1 +3 2 +SELECT * from t where a in (1, 5); +a b +1 NULL +1 NULL +1 1 +5 5 +explain format='brief' select * from trange where a in (1, 5); +id estRows task access object operator info +TableReader 4.00 root partition:p0,p2 data:Selection +└─Selection 4.00 cop[tikv] in(executor__partition__partition_with_expression.trange.a, 1, 5) + └─TableFullScan 13.00 cop[tikv] table:trange keep order:false +SELECT * from trange where a in (1, 5); +a b +1 NULL +1 NULL +1 1 +5 5 +explain format='brief' select * from thash where a in (1, 5); +id estRows task access object operator info +TableReader 4.00 root partition:p1 data:Selection +└─Selection 4.00 cop[tikv] in(executor__partition__partition_with_expression.thash.a, 1, 5) + └─TableFullScan 13.00 cop[tikv] table:thash keep order:false +SELECT * from thash where a in (1, 5); +a b +1 NULL +1 NULL +1 1 +5 5 +SELECT * from t where a not in (1, 5); +a b +10 NULL +2 1 +3 2 +4 3 +6 7 +7 7 +7 7 +explain format='brief' select * from trange where a not in (1, 5); +id estRows task access object operator info +TableReader 7.00 root partition:all data:Selection +└─Selection 7.00 cop[tikv] not(in(executor__partition__partition_with_expression.trange.a, 1, 5)) + └─TableFullScan 13.00 cop[tikv] table:trange keep order:false +SELECT * from trange where a not in (1, 5); +a b +10 NULL +2 1 +3 2 +4 3 +6 7 +7 7 +7 7 +explain format='brief' select * from thash where a not in (1, 5); +id estRows task access object operator info +TableReader 7.00 root partition:all data:Selection +└─Selection 7.00 cop[tikv] not(in(executor__partition__partition_with_expression.thash.a, 1, 5)) + └─TableFullScan 13.00 cop[tikv] table:thash keep order:false +SELECT * from thash where a not in (1, 5); +a b +10 NULL +2 1 +3 2 +4 3 +6 7 +7 7 +7 7 +SELECT * from t where a = 2 and a = 2; +a b +2 1 +explain format='brief' select * from trange where a = 2 and a = 2; +id estRows task access object operator info +TableReader 1.00 root partition:p0 data:Selection +└─Selection 1.00 cop[tikv] eq(executor__partition__partition_with_expression.trange.a, 2) + └─TableFullScan 13.00 cop[tikv] table:trange keep order:false +SELECT * from trange where a = 2 and a = 2; +a b +2 1 +explain format='brief' select * from thash where a = 2 and a = 2; +id estRows task access object operator info +TableReader 1.00 root partition:p2 data:Selection +└─Selection 1.00 cop[tikv] eq(executor__partition__partition_with_expression.thash.a, 2) + └─TableFullScan 13.00 cop[tikv] table:thash keep order:false +SELECT * from thash where a = 2 and a = 2; +a b +2 1 +SELECT * from t where a = 2 and a = 3; +a b +explain format='brief' select * from trange where a = 2 and a = 3; +id estRows task access object operator info +TableDual 0.00 root rows:0 +SELECT * from trange where a = 2 and a = 3; +a b +explain format='brief' select * from thash where a = 2 and a = 3; +id estRows task access object operator info +TableDual 0.00 root rows:0 +SELECT * from thash where a = 2 and a = 3; +a b +SELECT * from t where a < 2 and a > 0; +a b +1 NULL +1 NULL +1 1 +explain format='brief' select * from trange where a < 2 and a > 0; +id estRows task access object operator info +TableReader 3.00 root partition:p0 data:Selection +└─Selection 3.00 cop[tikv] gt(executor__partition__partition_with_expression.trange.a, 0), lt(executor__partition__partition_with_expression.trange.a, 2) + └─TableFullScan 13.00 cop[tikv] table:trange keep order:false +SELECT * from trange where a < 2 and a > 0; +a b +1 NULL +1 NULL +1 1 +explain format='brief' select * from thash where a < 2 and a > 0; +id estRows task access object operator info +TableReader 3.00 root partition:p1 data:Selection +└─Selection 3.00 cop[tikv] gt(executor__partition__partition_with_expression.thash.a, 0), lt(executor__partition__partition_with_expression.thash.a, 2) + └─TableFullScan 13.00 cop[tikv] table:thash keep order:false +SELECT * from thash where a < 2 and a > 0; +a b +1 NULL +1 NULL +1 1 +SELECT * from t where a < 2 and a < 3; +a b +1 NULL +1 NULL +1 1 +explain format='brief' select * from trange where a < 2 and a < 3; +id estRows task access object operator info +TableReader 3.00 root partition:p0 data:Selection +└─Selection 3.00 cop[tikv] lt(executor__partition__partition_with_expression.trange.a, 2), lt(executor__partition__partition_with_expression.trange.a, 3) + └─TableFullScan 13.00 cop[tikv] table:trange keep order:false +SELECT * from trange where a < 2 and a < 3; +a b +1 NULL +1 NULL +1 1 +explain format='brief' select * from thash where a < 2 and a < 3; +id estRows task access object operator info +TableReader 3.00 root partition:all data:Selection +└─Selection 3.00 cop[tikv] lt(executor__partition__partition_with_expression.thash.a, 2), lt(executor__partition__partition_with_expression.thash.a, 3) + └─TableFullScan 13.00 cop[tikv] table:thash keep order:false +SELECT * from thash where a < 2 and a < 3; +a b +1 NULL +1 NULL +1 1 +SELECT * from t where a > 1 and a > 2; +a b +10 NULL +3 2 +4 3 +5 5 +6 7 +7 7 +7 7 +explain format='brief' select * from trange where a > 1 and a > 2; +id estRows task access object operator info +TableReader 7.00 root partition:p1,p2 data:Selection +└─Selection 7.00 cop[tikv] gt(executor__partition__partition_with_expression.trange.a, 1), gt(executor__partition__partition_with_expression.trange.a, 2) + └─TableFullScan 13.00 cop[tikv] table:trange keep order:false +SELECT * from trange where a > 1 and a > 2; +a b +10 NULL +3 2 +4 3 +5 5 +6 7 +7 7 +7 7 +explain format='brief' select * from thash where a > 1 and a > 2; +id estRows task access object operator info +TableReader 7.00 root partition:all data:Selection +└─Selection 7.00 cop[tikv] gt(executor__partition__partition_with_expression.thash.a, 1), gt(executor__partition__partition_with_expression.thash.a, 2) + └─TableFullScan 13.00 cop[tikv] table:thash keep order:false +SELECT * from thash where a > 1 and a > 2; +a b +10 NULL +3 2 +4 3 +5 5 +6 7 +7 7 +7 7 +SELECT * from t where a = 2 or a = 3; +a b +2 1 +3 2 +explain format='brief' select * from trange where a = 2 or a = 3; +id estRows task access object operator info +TableReader 2.00 root partition:p0,p1 data:Selection +└─Selection 2.00 cop[tikv] or(eq(executor__partition__partition_with_expression.trange.a, 2), eq(executor__partition__partition_with_expression.trange.a, 3)) + └─TableFullScan 13.00 cop[tikv] table:trange keep order:false +SELECT * from trange where a = 2 or a = 3; +a b +2 1 +3 2 +explain format='brief' select * from thash where a = 2 or a = 3; +id estRows task access object operator info +TableReader 2.00 root partition:p2,p3 data:Selection +└─Selection 2.00 cop[tikv] or(eq(executor__partition__partition_with_expression.thash.a, 2), eq(executor__partition__partition_with_expression.thash.a, 3)) + └─TableFullScan 13.00 cop[tikv] table:thash keep order:false +SELECT * from thash where a = 2 or a = 3; +a b +2 1 +3 2 +SELECT * from t where a = 2 or a in (3); +a b +2 1 +3 2 +explain format='brief' select * from trange where a = 2 or a in (3); +id estRows task access object operator info +TableReader 2.00 root partition:p0,p1 data:Selection +└─Selection 2.00 cop[tikv] or(eq(executor__partition__partition_with_expression.trange.a, 2), eq(executor__partition__partition_with_expression.trange.a, 3)) + └─TableFullScan 13.00 cop[tikv] table:trange keep order:false +SELECT * from trange where a = 2 or a in (3); +a b +2 1 +3 2 +explain format='brief' select * from thash where a = 2 or a in (3); +id estRows task access object operator info +TableReader 2.00 root partition:p2,p3 data:Selection +└─Selection 2.00 cop[tikv] or(eq(executor__partition__partition_with_expression.thash.a, 2), eq(executor__partition__partition_with_expression.thash.a, 3)) + └─TableFullScan 13.00 cop[tikv] table:thash keep order:false +SELECT * from thash where a = 2 or a in (3); +a b +2 1 +3 2 +SELECT * from t where a = 2 or a > 3; +a b +10 NULL +2 1 +4 3 +5 5 +6 7 +7 7 +7 7 +explain format='brief' select * from trange where a = 2 or a > 3; +id estRows task access object operator info +TableReader 7.00 root partition:all data:Selection +└─Selection 7.00 cop[tikv] or(eq(executor__partition__partition_with_expression.trange.a, 2), gt(executor__partition__partition_with_expression.trange.a, 3)) + └─TableFullScan 13.00 cop[tikv] table:trange keep order:false +SELECT * from trange where a = 2 or a > 3; +a b +10 NULL +2 1 +4 3 +5 5 +6 7 +7 7 +7 7 +explain format='brief' select * from thash where a = 2 or a > 3; +id estRows task access object operator info +TableReader 7.00 root partition:all data:Selection +└─Selection 7.00 cop[tikv] or(eq(executor__partition__partition_with_expression.thash.a, 2), gt(executor__partition__partition_with_expression.thash.a, 3)) + └─TableFullScan 13.00 cop[tikv] table:thash keep order:false +SELECT * from thash where a = 2 or a > 3; +a b +10 NULL +2 1 +4 3 +5 5 +6 7 +7 7 +7 7 +SELECT * from t where a = 2 or a <= 1; +a b +1 NULL +1 NULL +1 1 +2 1 +explain format='brief' select * from trange where a = 2 or a <= 1; +id estRows task access object operator info +TableReader 4.00 root partition:p0 data:Selection +└─Selection 4.00 cop[tikv] or(eq(executor__partition__partition_with_expression.trange.a, 2), le(executor__partition__partition_with_expression.trange.a, 1)) + └─TableFullScan 13.00 cop[tikv] table:trange keep order:false +SELECT * from trange where a = 2 or a <= 1; +a b +1 NULL +1 NULL +1 1 +2 1 +explain format='brief' select * from thash where a = 2 or a <= 1; +id estRows task access object operator info +TableReader 4.00 root partition:all data:Selection +└─Selection 4.00 cop[tikv] or(eq(executor__partition__partition_with_expression.thash.a, 2), le(executor__partition__partition_with_expression.thash.a, 1)) + └─TableFullScan 13.00 cop[tikv] table:thash keep order:false +SELECT * from thash where a = 2 or a <= 1; +a b +1 NULL +1 NULL +1 1 +2 1 +SELECT * from t where a = 2 or a between 2 and 2; +a b +2 1 +explain format='brief' select * from trange where a = 2 or a between 2 and 2; +id estRows task access object operator info +TableReader 1.00 root partition:p0 data:Selection +└─Selection 1.00 cop[tikv] or(eq(executor__partition__partition_with_expression.trange.a, 2), and(ge(executor__partition__partition_with_expression.trange.a, 2), le(executor__partition__partition_with_expression.trange.a, 2))) + └─TableFullScan 13.00 cop[tikv] table:trange keep order:false +SELECT * from trange where a = 2 or a between 2 and 2; +a b +2 1 +explain format='brief' select * from thash where a = 2 or a between 2 and 2; +id estRows task access object operator info +TableReader 1.00 root partition:p2 data:Selection +└─Selection 1.00 cop[tikv] or(eq(executor__partition__partition_with_expression.thash.a, 2), and(ge(executor__partition__partition_with_expression.thash.a, 2), le(executor__partition__partition_with_expression.thash.a, 2))) + └─TableFullScan 13.00 cop[tikv] table:thash keep order:false +SELECT * from thash where a = 2 or a between 2 and 2; +a b +2 1 +SELECT * from t where a != 2; +a b +1 NULL +1 NULL +1 1 +10 NULL +3 2 +4 3 +5 5 +6 7 +7 7 +7 7 +explain format='brief' select * from trange where a != 2; +id estRows task access object operator info +TableReader 10.00 root partition:all data:Selection +└─Selection 10.00 cop[tikv] ne(executor__partition__partition_with_expression.trange.a, 2) + └─TableFullScan 13.00 cop[tikv] table:trange keep order:false +SELECT * from trange where a != 2; +a b +1 NULL +1 NULL +1 1 +10 NULL +3 2 +4 3 +5 5 +6 7 +7 7 +7 7 +explain format='brief' select * from thash where a != 2; +id estRows task access object operator info +TableReader 10.00 root partition:all data:Selection +└─Selection 10.00 cop[tikv] ne(executor__partition__partition_with_expression.thash.a, 2) + └─TableFullScan 13.00 cop[tikv] table:thash keep order:false +SELECT * from thash where a != 2; +a b +1 NULL +1 NULL +1 1 +10 NULL +3 2 +4 3 +5 5 +6 7 +7 7 +7 7 +SELECT * from t where a != 2 and a > 4; +a b +10 NULL +5 5 +6 7 +7 7 +7 7 +explain format='brief' select * from trange where a != 2 and a > 4; +id estRows task access object operator info +TableReader 5.00 root partition:p2 data:Selection +└─Selection 5.00 cop[tikv] gt(executor__partition__partition_with_expression.trange.a, 4), ne(executor__partition__partition_with_expression.trange.a, 2) + └─TableFullScan 13.00 cop[tikv] table:trange keep order:false +SELECT * from trange where a != 2 and a > 4; +a b +10 NULL +5 5 +6 7 +7 7 +7 7 +explain format='brief' select * from thash where a != 2 and a > 4; +id estRows task access object operator info +TableReader 5.00 root partition:all data:Selection +└─Selection 5.00 cop[tikv] gt(executor__partition__partition_with_expression.thash.a, 4), ne(executor__partition__partition_with_expression.thash.a, 2) + └─TableFullScan 13.00 cop[tikv] table:thash keep order:false +SELECT * from thash where a != 2 and a > 4; +a b +10 NULL +5 5 +6 7 +7 7 +7 7 +SELECT * from t where a != 2 and a != 3; +a b +1 NULL +1 NULL +1 1 +10 NULL +4 3 +5 5 +6 7 +7 7 +7 7 +explain format='brief' select * from trange where a != 2 and a != 3; +id estRows task access object operator info +TableReader 9.00 root partition:all data:Selection +└─Selection 9.00 cop[tikv] ne(executor__partition__partition_with_expression.trange.a, 2), ne(executor__partition__partition_with_expression.trange.a, 3) + └─TableFullScan 13.00 cop[tikv] table:trange keep order:false +SELECT * from trange where a != 2 and a != 3; +a b +1 NULL +1 NULL +1 1 +10 NULL +4 3 +5 5 +6 7 +7 7 +7 7 +explain format='brief' select * from thash where a != 2 and a != 3; +id estRows task access object operator info +TableReader 9.00 root partition:all data:Selection +└─Selection 9.00 cop[tikv] ne(executor__partition__partition_with_expression.thash.a, 2), ne(executor__partition__partition_with_expression.thash.a, 3) + └─TableFullScan 13.00 cop[tikv] table:thash keep order:false +SELECT * from thash where a != 2 and a != 3; +a b +1 NULL +1 NULL +1 1 +10 NULL +4 3 +5 5 +6 7 +7 7 +7 7 +SELECT * from t where a != 2 and a = 3; +a b +3 2 +explain format='brief' select * from trange where a != 2 and a = 3; +id estRows task access object operator info +TableReader 1.00 root partition:p1 data:Selection +└─Selection 1.00 cop[tikv] eq(executor__partition__partition_with_expression.trange.a, 3) + └─TableFullScan 13.00 cop[tikv] table:trange keep order:false +SELECT * from trange where a != 2 and a = 3; +a b +3 2 +explain format='brief' select * from thash where a != 2 and a = 3; +id estRows task access object operator info +TableReader 1.00 root partition:p3 data:Selection +└─Selection 1.00 cop[tikv] eq(executor__partition__partition_with_expression.thash.a, 3) + └─TableFullScan 13.00 cop[tikv] table:thash keep order:false +SELECT * from thash where a != 2 and a = 3; +a b +3 2 +SELECT * from t where not (a = 2); +a b +1 NULL +1 NULL +1 1 +10 NULL +3 2 +4 3 +5 5 +6 7 +7 7 +7 7 +explain format='brief' select * from trange where not (a = 2); +id estRows task access object operator info +TableReader 10.00 root partition:all data:Selection +└─Selection 10.00 cop[tikv] ne(executor__partition__partition_with_expression.trange.a, 2) + └─TableFullScan 13.00 cop[tikv] table:trange keep order:false +SELECT * from trange where not (a = 2); +a b +1 NULL +1 NULL +1 1 +10 NULL +3 2 +4 3 +5 5 +6 7 +7 7 +7 7 +explain format='brief' select * from thash where not (a = 2); +id estRows task access object operator info +TableReader 10.00 root partition:all data:Selection +└─Selection 10.00 cop[tikv] ne(executor__partition__partition_with_expression.thash.a, 2) + └─TableFullScan 13.00 cop[tikv] table:thash keep order:false +SELECT * from thash where not (a = 2); +a b +1 NULL +1 NULL +1 1 +10 NULL +3 2 +4 3 +5 5 +6 7 +7 7 +7 7 +SELECT * from t where not (a > 2); +a b +1 NULL +1 NULL +1 1 +2 1 +explain format='brief' select * from trange where not (a > 2); +id estRows task access object operator info +TableReader 4.00 root partition:p0 data:Selection +└─Selection 4.00 cop[tikv] le(executor__partition__partition_with_expression.trange.a, 2) + └─TableFullScan 13.00 cop[tikv] table:trange keep order:false +SELECT * from trange where not (a > 2); +a b +1 NULL +1 NULL +1 1 +2 1 +explain format='brief' select * from thash where not (a > 2); +id estRows task access object operator info +TableReader 4.00 root partition:all data:Selection +└─Selection 4.00 cop[tikv] le(executor__partition__partition_with_expression.thash.a, 2) + └─TableFullScan 13.00 cop[tikv] table:thash keep order:false +SELECT * from thash where not (a > 2); +a b +1 NULL +1 NULL +1 1 +2 1 +SELECT * from t where not (a < 2); +a b +10 NULL +2 1 +3 2 +4 3 +5 5 +6 7 +7 7 +7 7 +explain format='brief' select * from trange where not (a < 2); +id estRows task access object operator info +TableReader 8.00 root partition:all data:Selection +└─Selection 8.00 cop[tikv] ge(executor__partition__partition_with_expression.trange.a, 2) + └─TableFullScan 13.00 cop[tikv] table:trange keep order:false +SELECT * from trange where not (a < 2); +a b +10 NULL +2 1 +3 2 +4 3 +5 5 +6 7 +7 7 +7 7 +explain format='brief' select * from thash where not (a < 2); +id estRows task access object operator info +TableReader 8.00 root partition:all data:Selection +└─Selection 8.00 cop[tikv] ge(executor__partition__partition_with_expression.thash.a, 2) + └─TableFullScan 13.00 cop[tikv] table:thash keep order:false +SELECT * from thash where not (a < 2); +a b +10 NULL +2 1 +3 2 +4 3 +5 5 +6 7 +7 7 +7 7 +SELECT * from t where a + 1 > 4; +a b +10 NULL +4 3 +5 5 +6 7 +7 7 +7 7 +explain format='brief' select * from trange where a + 1 > 4; +id estRows task access object operator info +TableReader 10.40 root partition:all data:Selection +└─Selection 10.40 cop[tikv] gt(plus(executor__partition__partition_with_expression.trange.a, 1), 4) + └─TableFullScan 13.00 cop[tikv] table:trange keep order:false +SELECT * from trange where a + 1 > 4; +a b +10 NULL +4 3 +5 5 +6 7 +7 7 +7 7 +explain format='brief' select * from thash where a + 1 > 4; +id estRows task access object operator info +TableReader 10.40 root partition:all data:Selection +└─Selection 10.40 cop[tikv] gt(plus(executor__partition__partition_with_expression.thash.a, 1), 4) + └─TableFullScan 13.00 cop[tikv] table:thash keep order:false +SELECT * from thash where a + 1 > 4; +a b +10 NULL +4 3 +5 5 +6 7 +7 7 +7 7 +SELECT * from t where a - 1 > 0; +a b +10 NULL +2 1 +3 2 +4 3 +5 5 +6 7 +7 7 +7 7 +explain format='brief' select * from trange where a - 1 > 0; +id estRows task access object operator info +TableReader 10.40 root partition:all data:Selection +└─Selection 10.40 cop[tikv] gt(minus(executor__partition__partition_with_expression.trange.a, 1), 0) + └─TableFullScan 13.00 cop[tikv] table:trange keep order:false +SELECT * from trange where a - 1 > 0; +a b +10 NULL +2 1 +3 2 +4 3 +5 5 +6 7 +7 7 +7 7 +explain format='brief' select * from thash where a - 1 > 0; +id estRows task access object operator info +TableReader 10.40 root partition:all data:Selection +└─Selection 10.40 cop[tikv] gt(minus(executor__partition__partition_with_expression.thash.a, 1), 0) + └─TableFullScan 13.00 cop[tikv] table:thash keep order:false +SELECT * from thash where a - 1 > 0; +a b +10 NULL +2 1 +3 2 +4 3 +5 5 +6 7 +7 7 +7 7 +SELECT * from t where a * 2 < 0; +a b +explain format='brief' select * from trange where a * 2 < 0; +id estRows task access object operator info +TableReader 10.40 root partition:all data:Selection +└─Selection 10.40 cop[tikv] lt(mul(executor__partition__partition_with_expression.trange.a, 2), 0) + └─TableFullScan 13.00 cop[tikv] table:trange keep order:false +SELECT * from trange where a * 2 < 0; +a b +explain format='brief' select * from thash where a * 2 < 0; +id estRows task access object operator info +TableReader 10.40 root partition:all data:Selection +└─Selection 10.40 cop[tikv] lt(mul(executor__partition__partition_with_expression.thash.a, 2), 0) + └─TableFullScan 13.00 cop[tikv] table:thash keep order:false +SELECT * from thash where a * 2 < 0; +a b +SELECT * from t where a << 1 < 0; +a b +explain format='brief' select * from trange where a << 1 < 0; +id estRows task access object operator info +TableReader 10.40 root partition:all data:Selection +└─Selection 10.40 cop[tikv] lt(leftshift(executor__partition__partition_with_expression.trange.a, 1), 0) + └─TableFullScan 13.00 cop[tikv] table:trange keep order:false +SELECT * from trange where a << 1 < 0; +a b +explain format='brief' select * from thash where a << 1 < 0; +id estRows task access object operator info +TableReader 10.40 root partition:all data:Selection +└─Selection 10.40 cop[tikv] lt(leftshift(executor__partition__partition_with_expression.thash.a, 1), 0) + └─TableFullScan 13.00 cop[tikv] table:thash keep order:false +SELECT * from thash where a << 1 < 0; +a b +SELECT * from t where a > '10'; +a b +explain format='brief' select * from trange where a > '10'; +id estRows task access object operator info +TableReader 1.00 root partition:dual data:Selection +└─Selection 1.00 cop[tikv] gt(executor__partition__partition_with_expression.trange.a, 10) + └─TableFullScan 13.00 cop[tikv] table:trange keep order:false +SELECT * from trange where a > '10'; +a b +explain format='brief' select * from thash where a > '10'; +id estRows task access object operator info +TableReader 1.00 root partition:all data:Selection +└─Selection 1.00 cop[tikv] gt(executor__partition__partition_with_expression.thash.a, 10) + └─TableFullScan 13.00 cop[tikv] table:thash keep order:false +SELECT * from thash where a > '10'; +a b +SELECT * from t where a > '10ab'; +a b +explain format='brief' select * from trange where a > '10ab'; +id estRows task access object operator info +TableReader 1.00 root partition:dual data:Selection +└─Selection 1.00 cop[tikv] gt(executor__partition__partition_with_expression.trange.a, 10) + └─TableFullScan 13.00 cop[tikv] table:trange keep order:false +SELECT * from trange where a > '10ab'; +a b +explain format='brief' select * from thash where a > '10ab'; +id estRows task access object operator info +TableReader 1.00 root partition:all data:Selection +└─Selection 1.00 cop[tikv] gt(executor__partition__partition_with_expression.thash.a, 10) + └─TableFullScan 13.00 cop[tikv] table:thash keep order:false +SELECT * from thash where a > '10ab'; +a b +set tidb_partition_prune_mode=default; diff --git a/tests/integrationtest/r/explain_easy.result b/tests/integrationtest/r/explain_easy.result index 3db721311c08a..f5a7c1b6f7766 100644 --- a/tests/integrationtest/r/explain_easy.result +++ b/tests/integrationtest/r/explain_easy.result @@ -739,8 +739,8 @@ insert into t values (1),(2),(2),(2),(9),(9),(9),(10); analyze table t with 1 buckets; explain format = 'brief' select * from t where a >= 3 and a <= 8; id estRows task access object operator info -TableReader 0.00 root data:Selection -└─Selection 0.00 cop[tikv] ge(explain_easy.t.a, 3), le(explain_easy.t.a, 8) +TableReader 1.00 root data:Selection +└─Selection 1.00 cop[tikv] ge(explain_easy.t.a, 3), le(explain_easy.t.a, 8) └─TableFullScan 8.00 cop[tikv] table:t keep order:false drop table t; create table t(a int, b int, index idx_ab(a, b)); diff --git a/tests/integrationtest/r/explain_generate_column_substitute.result b/tests/integrationtest/r/explain_generate_column_substitute.result index eb91135083776..1d5a461d5fd45 100644 --- a/tests/integrationtest/r/explain_generate_column_substitute.result +++ b/tests/integrationtest/r/explain_generate_column_substitute.result @@ -431,10 +431,10 @@ Projection 1.00 root explain_generate_column_substitute.t.a, explain_generate_c └─TableRowIDScan(Probe) 1.00 cop[tikv] table:t keep order:false desc format = 'brief' select * from t where not (lower(b) >= "a"); id estRows task access object operator info -Projection 0.00 root explain_generate_column_substitute.t.a, explain_generate_column_substitute.t.b -└─IndexLookUp 0.00 root - ├─IndexRangeScan(Build) 0.00 cop[tikv] table:t, index:expression_index(lower(`b`), `a` + 1) range:[-inf,"a"), keep order:false - └─TableRowIDScan(Probe) 0.00 cop[tikv] table:t keep order:false +Projection 1.00 root explain_generate_column_substitute.t.a, explain_generate_column_substitute.t.b +└─IndexLookUp 1.00 root + ├─IndexRangeScan(Build) 1.00 cop[tikv] table:t, index:expression_index(lower(`b`), `a` + 1) range:[-inf,"a"), keep order:false + └─TableRowIDScan(Probe) 1.00 cop[tikv] table:t keep order:false desc format = 'brief' select count(upper(b)) from t group by upper(b); id estRows task access object operator info StreamAgg 4.80 root group by:upper(explain_generate_column_substitute.t.b), funcs:count(upper(explain_generate_column_substitute.t.b))->Column#7 diff --git a/tests/integrationtest/r/imdbload.result b/tests/integrationtest/r/imdbload.result index 066dc14b155ae..073396cea759e 100644 --- a/tests/integrationtest/r/imdbload.result +++ b/tests/integrationtest/r/imdbload.result @@ -287,48 +287,48 @@ IndexLookUp_7 1005030.94 root └─TableRowIDScan_6(Probe) 1005030.94 cop[tikv] table:char_name keep order:false trace plan target = 'estimation' select * from char_name where ((imdb_index = 'I') and (surname_pcode < 'E436')) or ((imdb_index = 'L') and (surname_pcode < 'E436')); CE_trace -[{"table_name":"char_name","type":"Column Stats-Point","expr":"((imdb_index = 'I'))","row_count":0},{"table_name":"char_name","type":"Column Stats-Point","expr":"((imdb_index = 'L'))","row_count":0},{"table_name":"char_name","type":"Column Stats-Range","expr":"((id >= -9223372036854775808 and id <= 9223372036854775807))","row_count":4314864},{"table_name":"char_name","type":"Column Stats-Range","expr":"((surname_pcode < 'E436'))","row_count":1005030},{"table_name":"char_name","type":"Index Stats-Range","expr":"((imdb_index = 'I') and (surname_pcode < 'E436')) or ((imdb_index = 'L') and (surname_pcode < 'E436'))","row_count":0},{"table_name":"char_name","type":"Index Stats-Range","expr":"((surname_pcode < 'E436'))","row_count":1005030},{"table_name":"char_name","type":"Table Stats-Expression-CNF","expr":"`or`(`and`(`eq`(imdbload.char_name.imdb_index, 'I'), `lt`(imdbload.char_name.surname_pcode, 'E436')), `and`(`eq`(imdbload.char_name.imdb_index, 'L'), `lt`(imdbload.char_name.surname_pcode, 'E436')))","row_count":804024}] +[{"table_name":"char_name","type":"Column Stats-Point","expr":"((imdb_index = 'I'))","row_count":1},{"table_name":"char_name","type":"Column Stats-Point","expr":"((imdb_index = 'L'))","row_count":1},{"table_name":"char_name","type":"Column Stats-Range","expr":"((id >= -9223372036854775808 and id <= 9223372036854775807))","row_count":4314864},{"table_name":"char_name","type":"Column Stats-Range","expr":"((surname_pcode < 'E436'))","row_count":1005030},{"table_name":"char_name","type":"Index Stats-Range","expr":"((imdb_index = 'I') and (surname_pcode < 'E436')) or ((imdb_index = 'L') and (surname_pcode < 'E436'))","row_count":2},{"table_name":"char_name","type":"Index Stats-Range","expr":"((surname_pcode < 'E436'))","row_count":1005030},{"table_name":"char_name","type":"Table Stats-Expression-CNF","expr":"`or`(`and`(`eq`(imdbload.char_name.imdb_index, 'I'), `lt`(imdbload.char_name.surname_pcode, 'E436')), `and`(`eq`(imdbload.char_name.imdb_index, 'L'), `lt`(imdbload.char_name.surname_pcode, 'E436')))","row_count":804024}] explain select * from char_name where ((imdb_index = 'V') and (surname_pcode < 'L3416')); id estRows task access object operator info -IndexLookUp_10 0.00 root -├─IndexRangeScan_8(Build) 0.00 cop[tikv] table:char_name, index:itest2(imdb_index, surname_pcode, name_pcode_nf) range:["V" -inf,"V" "L3416"), keep order:false -└─TableRowIDScan_9(Probe) 0.00 cop[tikv] table:char_name keep order:false +IndexLookUp_10 1.00 root +├─IndexRangeScan_8(Build) 1.00 cop[tikv] table:char_name, index:itest2(imdb_index, surname_pcode, name_pcode_nf) range:["V" -inf,"V" "L3416"), keep order:false +└─TableRowIDScan_9(Probe) 1.00 cop[tikv] table:char_name keep order:false explain select * from char_name where imdb_index > 'V'; id estRows task access object operator info -IndexLookUp_10 0.00 root -├─IndexRangeScan_8(Build) 0.00 cop[tikv] table:char_name, index:itest2(imdb_index, surname_pcode, name_pcode_nf) range:("V",+inf], keep order:false -└─TableRowIDScan_9(Probe) 0.00 cop[tikv] table:char_name keep order:false +IndexLookUp_10 1.00 root +├─IndexRangeScan_8(Build) 1.00 cop[tikv] table:char_name, index:itest2(imdb_index, surname_pcode, name_pcode_nf) range:("V",+inf], keep order:false +└─TableRowIDScan_9(Probe) 1.00 cop[tikv] table:char_name keep order:false trace plan target = 'estimation' select * from char_name where imdb_index > 'V'; CE_trace -[{"table_name":"char_name","type":"Column Stats-Range","expr":"((id >= -9223372036854775808 and id <= 9223372036854775807))","row_count":4314864},{"table_name":"char_name","type":"Column Stats-Range","expr":"((imdb_index > 'V' and true))","row_count":0},{"table_name":"char_name","type":"Index Stats-Range","expr":"((imdb_index > 'V' and true))","row_count":0},{"table_name":"char_name","type":"Table Stats-Expression-CNF","expr":"`gt`(imdbload.char_name.imdb_index, 'V')","row_count":0}] +[{"table_name":"char_name","type":"Column Stats-Range","expr":"((id >= -9223372036854775808 and id <= 9223372036854775807))","row_count":4314864},{"table_name":"char_name","type":"Column Stats-Range","expr":"((imdb_index > 'V' and true))","row_count":1},{"table_name":"char_name","type":"Index Stats-Range","expr":"((imdb_index > 'V' and true))","row_count":1},{"table_name":"char_name","type":"Table Stats-Expression-CNF","expr":"`gt`(imdbload.char_name.imdb_index, 'V')","row_count":1}] explain select * from movie_companies where company_type_id > 2; id estRows task access object operator info -IndexLookUp_10 0.00 root -├─IndexRangeScan_8(Build) 0.00 cop[tikv] table:movie_companies, index:movie_companies_idx_ctypeid(company_type_id) range:(2,+inf], keep order:false -└─TableRowIDScan_9(Probe) 0.00 cop[tikv] table:movie_companies keep order:false +IndexLookUp_10 1.00 root +├─IndexRangeScan_8(Build) 1.00 cop[tikv] table:movie_companies, index:movie_companies_idx_ctypeid(company_type_id) range:(2,+inf], keep order:false +└─TableRowIDScan_9(Probe) 1.00 cop[tikv] table:movie_companies keep order:false trace plan target = 'estimation' select * from movie_companies where company_type_id > 2; CE_trace -[{"table_name":"movie_companies","type":"Column Stats-Range","expr":"((company_type_id > 2 and true))","row_count":0},{"table_name":"movie_companies","type":"Column Stats-Range","expr":"((id >= -9223372036854775808 and id <= 9223372036854775807))","row_count":4958296},{"table_name":"movie_companies","type":"Index Stats-Range","expr":"((company_type_id > 2 and true))","row_count":0},{"table_name":"movie_companies","type":"Table Stats-Expression-CNF","expr":"`gt`(imdbload.movie_companies.company_type_id, 2)","row_count":0}] +[{"table_name":"movie_companies","type":"Column Stats-Range","expr":"((company_type_id > 2 and true))","row_count":1},{"table_name":"movie_companies","type":"Column Stats-Range","expr":"((id >= -9223372036854775808 and id <= 9223372036854775807))","row_count":4958296},{"table_name":"movie_companies","type":"Index Stats-Range","expr":"((company_type_id > 2 and true))","row_count":1},{"table_name":"movie_companies","type":"Table Stats-Expression-CNF","expr":"`gt`(imdbload.movie_companies.company_type_id, 2)","row_count":1}] explain select * from char_name where imdb_index > 'I' and imdb_index < 'II'; id estRows task access object operator info -IndexLookUp_10 0.00 root -├─IndexRangeScan_8(Build) 0.00 cop[tikv] table:char_name, index:itest2(imdb_index, surname_pcode, name_pcode_nf) range:("I","II"), keep order:false -└─TableRowIDScan_9(Probe) 0.00 cop[tikv] table:char_name keep order:false +IndexLookUp_10 1.00 root +├─IndexRangeScan_8(Build) 1.00 cop[tikv] table:char_name, index:itest2(imdb_index, surname_pcode, name_pcode_nf) range:("I","II"), keep order:false +└─TableRowIDScan_9(Probe) 1.00 cop[tikv] table:char_name keep order:false trace plan target = 'estimation' select * from char_name where imdb_index > 'I' and imdb_index < 'II'; CE_trace -[{"table_name":"char_name","type":"Column Stats-Range","expr":"((id >= -9223372036854775808 and id <= 9223372036854775807))","row_count":4314864},{"table_name":"char_name","type":"Column Stats-Range","expr":"((imdb_index > 'I' and imdb_index < 'II'))","row_count":0},{"table_name":"char_name","type":"Index Stats-Range","expr":"((imdb_index > 'I' and imdb_index < 'II'))","row_count":0},{"table_name":"char_name","type":"Table Stats-Expression-CNF","expr":"`and`(`gt`(imdbload.char_name.imdb_index, 'I'), `lt`(imdbload.char_name.imdb_index, 'II'))","row_count":0}] +[{"table_name":"char_name","type":"Column Stats-Range","expr":"((id >= -9223372036854775808 and id <= 9223372036854775807))","row_count":4314864},{"table_name":"char_name","type":"Column Stats-Range","expr":"((imdb_index > 'I' and imdb_index < 'II'))","row_count":1},{"table_name":"char_name","type":"Index Stats-Range","expr":"((imdb_index > 'I' and imdb_index < 'II'))","row_count":1},{"table_name":"char_name","type":"Table Stats-Expression-CNF","expr":"`and`(`gt`(imdbload.char_name.imdb_index, 'I'), `lt`(imdbload.char_name.imdb_index, 'II'))","row_count":1}] explain select * from char_name where imdb_index > 'I'; id estRows task access object operator info -IndexLookUp_10 0.00 root -├─IndexRangeScan_8(Build) 0.00 cop[tikv] table:char_name, index:itest2(imdb_index, surname_pcode, name_pcode_nf) range:("I",+inf], keep order:false -└─TableRowIDScan_9(Probe) 0.00 cop[tikv] table:char_name keep order:false +IndexLookUp_10 1.00 root +├─IndexRangeScan_8(Build) 1.00 cop[tikv] table:char_name, index:itest2(imdb_index, surname_pcode, name_pcode_nf) range:("I",+inf], keep order:false +└─TableRowIDScan_9(Probe) 1.00 cop[tikv] table:char_name keep order:false trace plan target = 'estimation' select * from char_name where imdb_index > 'I'; CE_trace -[{"table_name":"char_name","type":"Column Stats-Range","expr":"((id >= -9223372036854775808 and id <= 9223372036854775807))","row_count":4314864},{"table_name":"char_name","type":"Column Stats-Range","expr":"((imdb_index > 'I' and true))","row_count":0},{"table_name":"char_name","type":"Index Stats-Range","expr":"((imdb_index > 'I' and true))","row_count":0},{"table_name":"char_name","type":"Table Stats-Expression-CNF","expr":"`gt`(imdbload.char_name.imdb_index, 'I')","row_count":0}] +[{"table_name":"char_name","type":"Column Stats-Range","expr":"((id >= -9223372036854775808 and id <= 9223372036854775807))","row_count":4314864},{"table_name":"char_name","type":"Column Stats-Range","expr":"((imdb_index > 'I' and true))","row_count":1},{"table_name":"char_name","type":"Index Stats-Range","expr":"((imdb_index > 'I' and true))","row_count":1},{"table_name":"char_name","type":"Table Stats-Expression-CNF","expr":"`gt`(imdbload.char_name.imdb_index, 'I')","row_count":1}] explain select * from cast_info where nr_order < -2068070866; id estRows task access object operator info @@ -342,12 +342,12 @@ IndexLookUp_10 34260.33 root └─TableRowIDScan_9(Probe) 34260.33 cop[tikv] table:aka_title keep order:false explain select * from aka_title where kind_id > 7; id estRows task access object operator info -IndexLookUp_10 0.00 root -├─IndexRangeScan_8(Build) 0.00 cop[tikv] table:aka_title, index:aka_title_idx_kindid(kind_id) range:(7,+inf], keep order:false -└─TableRowIDScan_9(Probe) 0.00 cop[tikv] table:aka_title keep order:false +IndexLookUp_10 1.00 root +├─IndexRangeScan_8(Build) 1.00 cop[tikv] table:aka_title, index:aka_title_idx_kindid(kind_id) range:(7,+inf], keep order:false +└─TableRowIDScan_9(Probe) 1.00 cop[tikv] table:aka_title keep order:false trace plan target = 'estimation' select * from aka_title where kind_id > 7; CE_trace -[{"table_name":"aka_title","type":"Column Stats-Range","expr":"((id >= -9223372036854775808 and id <= 9223372036854775807))","row_count":528337},{"table_name":"aka_title","type":"Column Stats-Range","expr":"((kind_id > 7 and true))","row_count":0},{"table_name":"aka_title","type":"Index Stats-Range","expr":"((kind_id > 7 and true))","row_count":0},{"table_name":"aka_title","type":"Table Stats-Expression-CNF","expr":"`gt`(imdbload.aka_title.kind_id, 7)","row_count":0}] +[{"table_name":"aka_title","type":"Column Stats-Range","expr":"((id >= -9223372036854775808 and id <= 9223372036854775807))","row_count":528337},{"table_name":"aka_title","type":"Column Stats-Range","expr":"((kind_id > 7 and true))","row_count":1},{"table_name":"aka_title","type":"Index Stats-Range","expr":"((kind_id > 7 and true))","row_count":1},{"table_name":"aka_title","type":"Table Stats-Expression-CNF","expr":"`gt`(imdbload.aka_title.kind_id, 7)","row_count":1}] explain select * from keyword where ((phonetic_code = 'R1652') and (keyword > 'ecg-monitor' and keyword < 'killers')); id estRows task access object operator info diff --git a/tests/integrationtest/r/planner/cardinality/selectivity.result b/tests/integrationtest/r/planner/cardinality/selectivity.result index 782067773ad6b..7c1e27495f9fc 100644 --- a/tests/integrationtest/r/planner/cardinality/selectivity.result +++ b/tests/integrationtest/r/planner/cardinality/selectivity.result @@ -1225,8 +1225,14 @@ insert into t values ('tw', 0); analyze table t; explain select * from t where a = 'tw' and b < 0; id estRows task access object operator info +IndexReader_6 1.00 root index:IndexRangeScan_5 +└─IndexRangeScan_5 1.00 cop[tikv] table:t, index:idx(a, b) range:["tw" -inf,"tw" 0), keep order:false +set @@tidb_opt_fix_control = '47400:on'; +explain select * from t where a = 'tw' and b < 0; +id estRows task access object operator info IndexReader_6 0.00 root index:IndexRangeScan_5 └─IndexRangeScan_5 0.00 cop[tikv] table:t, index:idx(a, b) range:["tw" -inf,"tw" 0), keep order:false +set @@tidb_opt_fix_control = '47400:off'; drop table if exists t; create table t(id int auto_increment, kid int, pid int, primary key(id), key(kid, pid)); insert into t (kid, pid) values (1,2), (1,3), (1,4),(1, 11), (1, 12), (1, 13), (1, 14), (2, 2), (2, 3), (2, 4); diff --git a/tests/integrationtest/r/planner/core/casetest/integration.result b/tests/integrationtest/r/planner/core/casetest/integration.result index b533c7fd23200..bacda2a6b8149 100644 --- a/tests/integrationtest/r/planner/core/casetest/integration.result +++ b/tests/integrationtest/r/planner/core/casetest/integration.result @@ -1153,17 +1153,17 @@ TableReader_7 3.00 130.42 root data:Selection_6 └─TableFullScan_5 5.00 1136.54 cop[tikv] table:t keep order:false explain format = 'verbose' select * from t where b = 6 order by a limit 1; id estRows estCost task access object operator info -Limit_11 0.00 98.74 root offset:0, count:1 -└─TableReader_24 0.00 98.74 root data:Limit_23 - └─Limit_23 0.00 1386.04 cop[tikv] offset:0, count:1 - └─Selection_22 0.00 1386.04 cop[tikv] eq(planner__core__casetest__integration.t.b, 6) +Limit_11 1.00 98.74 root offset:0, count:1 +└─TableReader_24 1.00 98.74 root data:Limit_23 + └─Limit_23 1.00 1386.04 cop[tikv] offset:0, count:1 + └─Selection_22 1.00 1386.04 cop[tikv] eq(planner__core__casetest__integration.t.b, 6) └─TableFullScan_21 5.00 1136.54 cop[tikv] table:t keep order:true explain format = 'verbose' select * from t where b = 6 limit 1; id estRows estCost task access object operator info -Limit_8 0.00 98.74 root offset:0, count:1 -└─TableReader_13 0.00 98.74 root data:Limit_12 - └─Limit_12 0.00 1386.04 cop[tikv] offset:0, count:1 - └─Selection_11 0.00 1386.04 cop[tikv] eq(planner__core__casetest__integration.t.b, 6) +Limit_8 1.00 98.74 root offset:0, count:1 +└─TableReader_13 1.00 98.74 root data:Limit_12 + └─Limit_12 1.00 1386.04 cop[tikv] offset:0, count:1 + └─Selection_11 1.00 1386.04 cop[tikv] eq(planner__core__casetest__integration.t.b, 6) └─TableFullScan_10 5.00 1136.54 cop[tikv] table:t keep order:false set tidb_opt_prefer_range_scan = 1; explain format = 'verbose' select * from t where b > 5; @@ -1175,19 +1175,19 @@ Level Code Message Note 1105 [idx_b] remain after pruning paths for t given Prop{SortItems: [], TaskTp: rootTask} explain format = 'verbose' select * from t where b = 6 order by a limit 1; id estRows estCost task access object operator info -TopN_9 0.00 1956.63 root planner__core__casetest__integration.t.a, offset:0, count:1 -└─IndexLookUp_16 0.00 1951.83 root - ├─TopN_15(Build) 0.00 206.70 cop[tikv] planner__core__casetest__integration.t.a, offset:0, count:1 - │ └─IndexRangeScan_13 0.00 203.50 cop[tikv] table:t, index:idx_b(b) range:[6,6], keep order:false - └─TableRowIDScan_14(Probe) 0.00 186.61 cop[tikv] table:t keep order:false +TopN_9 1.00 1956.63 root planner__core__casetest__integration.t.a, offset:0, count:1 +└─IndexLookUp_16 1.00 1951.83 root + ├─TopN_15(Build) 1.00 206.70 cop[tikv] planner__core__casetest__integration.t.a, offset:0, count:1 + │ └─IndexRangeScan_13 1.00 203.50 cop[tikv] table:t, index:idx_b(b) range:[6,6], keep order:false + └─TableRowIDScan_14(Probe) 1.00 186.61 cop[tikv] table:t keep order:false Level Code Message Note 1105 [idx_b] remain after pruning paths for t given Prop{SortItems: [], TaskTp: copMultiReadTask} explain format = 'verbose' select * from t where b = 6 limit 1; id estRows estCost task access object operator info -IndexLookUp_13 0.00 1170.97 root limit embedded(offset:0, count:1) -├─Limit_12(Build) 0.00 203.50 cop[tikv] offset:0, count:1 -│ └─IndexRangeScan_10 0.00 203.50 cop[tikv] table:t, index:idx_b(b) range:[6,6], keep order:false -└─TableRowIDScan_11(Probe) 0.00 186.61 cop[tikv] table:t keep order:false +IndexLookUp_13 1.00 1170.97 root limit embedded(offset:0, count:1) +├─Limit_12(Build) 1.00 203.50 cop[tikv] offset:0, count:1 +│ └─IndexRangeScan_10 1.00 203.50 cop[tikv] table:t, index:idx_b(b) range:[6,6], keep order:false +└─TableRowIDScan_11(Probe) 1.00 186.61 cop[tikv] table:t keep order:false Level Code Message Note 1105 [idx_b] remain after pruning paths for t given Prop{SortItems: [], TaskTp: copMultiReadTask} set @@tidb_enable_chunk_rpc = default; diff --git a/tests/integrationtest/r/planner/core/partition_pruner.result b/tests/integrationtest/r/planner/core/partition_pruner.result index 5cff3913e6afa..5c6430e226c11 100644 --- a/tests/integrationtest/r/planner/core/partition_pruner.result +++ b/tests/integrationtest/r/planner/core/partition_pruner.result @@ -3552,8 +3552,8 @@ IndexReader_10 2.00 root partition:all index:Selection_9 └─IndexFullScan_8 2.00 cop[tikv] table:test1, index:PRIMARY(ID, PARTITION_NO, CREATE_TIME) keep order:false explain select * from test1 where partition_no < 200000; id estRows task access object operator info -IndexReader_10 0.00 root partition:2023p1 index:Selection_9 -└─Selection_9 0.00 cop[tikv] lt(issue43459.test1.partition_no, 200000) +IndexReader_10 1.00 root partition:2023p1 index:Selection_9 +└─Selection_9 1.00 cop[tikv] lt(issue43459.test1.partition_no, 200000) └─IndexFullScan_8 2.00 cop[tikv] table:test1, index:PRIMARY(ID, PARTITION_NO, CREATE_TIME) keep order:false explain select * from test1 where partition_no <= 200000; id estRows task access object operator info @@ -3562,8 +3562,8 @@ IndexReader_10 2.00 root partition:all index:Selection_9 └─IndexFullScan_8 2.00 cop[tikv] table:test1, index:PRIMARY(ID, PARTITION_NO, CREATE_TIME) keep order:false explain select * from test1 where partition_no > 200000; id estRows task access object operator info -IndexReader_10 0.00 root partition:2023p2 index:Selection_9 -└─Selection_9 0.00 cop[tikv] gt(issue43459.test1.partition_no, 200000) +IndexReader_10 1.00 root partition:2023p2 index:Selection_9 +└─Selection_9 1.00 cop[tikv] gt(issue43459.test1.partition_no, 200000) └─IndexFullScan_8 2.00 cop[tikv] table:test1, index:PRIMARY(ID, PARTITION_NO, CREATE_TIME) keep order:false select * from test1 partition (2023p1); ID PARTITION_NO CREATE_TIME @@ -3611,8 +3611,8 @@ IndexReader_10 2.00 root partition:all index:Selection_9 └─IndexFullScan_8 2.00 cop[tikv] table:test1, index:PRIMARY(ID, PARTITION_NO, CREATE_TIME) keep order:false explain select * from test1 where partition_no < 200000; id estRows task access object operator info -IndexReader_10 0.00 root partition:2023p1 index:Selection_9 -└─Selection_9 0.00 cop[tikv] lt(issue43459.test1.partition_no, 200000) +IndexReader_10 1.00 root partition:2023p1 index:Selection_9 +└─Selection_9 1.00 cop[tikv] lt(issue43459.test1.partition_no, 200000) └─IndexFullScan_8 2.00 cop[tikv] table:test1, index:PRIMARY(ID, PARTITION_NO, CREATE_TIME) keep order:false explain select * from test1 where partition_no <= 200000; id estRows task access object operator info @@ -3621,8 +3621,8 @@ IndexReader_10 2.00 root partition:all index:Selection_9 └─IndexFullScan_8 2.00 cop[tikv] table:test1, index:PRIMARY(ID, PARTITION_NO, CREATE_TIME) keep order:false explain select * from test1 where partition_no > 200000; id estRows task access object operator info -IndexReader_10 0.00 root partition:2023p2 index:Selection_9 -└─Selection_9 0.00 cop[tikv] gt(issue43459.test1.partition_no, 200000) +IndexReader_10 1.00 root partition:2023p2 index:Selection_9 +└─Selection_9 1.00 cop[tikv] gt(issue43459.test1.partition_no, 200000) └─IndexFullScan_8 2.00 cop[tikv] table:test1, index:PRIMARY(ID, PARTITION_NO, CREATE_TIME) keep order:false select * from test1 partition (2023p1); ID PARTITION_NO CREATE_TIME diff --git a/tests/integrationtest/r/statistics/integration.result b/tests/integrationtest/r/statistics/integration.result index 65d95fe413f03..53c772a5748c2 100644 --- a/tests/integrationtest/r/statistics/integration.result +++ b/tests/integrationtest/r/statistics/integration.result @@ -17,8 +17,8 @@ explain format = 'brief' select * from t1 left join t2 on t1.a=t2.a order by t1. id estRows task access object operator info Sort 4.00 root statistics__integration.t1.a, statistics__integration.t2.a └─HashJoin 4.00 root left outer join, equal:[eq(statistics__integration.t1.a, statistics__integration.t2.a)] - ├─TableReader(Build) 0.00 root data:Selection - │ └─Selection 0.00 cop[tikv] not(isnull(statistics__integration.t2.a)) + ├─TableReader(Build) 1.00 root data:Selection + │ └─Selection 1.00 cop[tikv] not(isnull(statistics__integration.t2.a)) │ └─TableFullScan 2.00 cop[tikv] table:t2 keep order:false └─TableReader(Probe) 4.00 root data:TableFullScan └─TableFullScan 4.00 cop[tikv] table:t1 keep order:false @@ -26,8 +26,8 @@ explain format = 'brief' select * from t2 left join t1 on t1.a=t2.a order by t1. id estRows task access object operator info Sort 2.00 root statistics__integration.t1.a, statistics__integration.t2.a └─HashJoin 2.00 root left outer join, equal:[eq(statistics__integration.t2.a, statistics__integration.t1.a)] - ├─TableReader(Build) 0.00 root data:Selection - │ └─Selection 0.00 cop[tikv] not(isnull(statistics__integration.t1.a)) + ├─TableReader(Build) 1.00 root data:Selection + │ └─Selection 1.00 cop[tikv] not(isnull(statistics__integration.t1.a)) │ └─TableFullScan 4.00 cop[tikv] table:t1 keep order:false └─TableReader(Probe) 2.00 root data:TableFullScan └─TableFullScan 2.00 cop[tikv] table:t2 keep order:false @@ -35,8 +35,8 @@ explain format = 'brief' select * from t1 right join t2 on t1.a=t2.a order by t1 id estRows task access object operator info Sort 2.00 root statistics__integration.t1.a, statistics__integration.t2.a └─HashJoin 2.00 root right outer join, equal:[eq(statistics__integration.t1.a, statistics__integration.t2.a)] - ├─TableReader(Build) 0.00 root data:Selection - │ └─Selection 0.00 cop[tikv] not(isnull(statistics__integration.t1.a)) + ├─TableReader(Build) 1.00 root data:Selection + │ └─Selection 1.00 cop[tikv] not(isnull(statistics__integration.t1.a)) │ └─TableFullScan 4.00 cop[tikv] table:t1 keep order:false └─TableReader(Probe) 2.00 root data:TableFullScan └─TableFullScan 2.00 cop[tikv] table:t2 keep order:false @@ -44,8 +44,8 @@ explain format = 'brief' select * from t2 right join t1 on t1.a=t2.a order by t1 id estRows task access object operator info Sort 4.00 root statistics__integration.t1.a, statistics__integration.t2.a └─HashJoin 4.00 root right outer join, equal:[eq(statistics__integration.t2.a, statistics__integration.t1.a)] - ├─TableReader(Build) 0.00 root data:Selection - │ └─Selection 0.00 cop[tikv] not(isnull(statistics__integration.t2.a)) + ├─TableReader(Build) 1.00 root data:Selection + │ └─Selection 1.00 cop[tikv] not(isnull(statistics__integration.t2.a)) │ └─TableFullScan 2.00 cop[tikv] table:t2 keep order:false └─TableReader(Probe) 4.00 root data:TableFullScan └─TableFullScan 4.00 cop[tikv] table:t1 keep order:false diff --git a/tests/integrationtest/r/tpch.result b/tests/integrationtest/r/tpch.result index 6df7e5866eabf..e10cfca8e92d1 100644 --- a/tests/integrationtest/r/tpch.result +++ b/tests/integrationtest/r/tpch.result @@ -1293,6 +1293,7 @@ cntrycode; id estRows task access object operator info Sort 1.00 root Column#31 └─Projection 1.00 root Column#31, Column#32, Column#33 +<<<<<<< HEAD └─HashAgg 1.00 root group by:Column#37, funcs:count(1)->Column#32, funcs:sum(Column#35)->Column#33, funcs:firstrow(Column#36)->Column#31 └─Projection 0.00 root tpch.customer.c_acctbal->Column#35, substring(tpch.customer.c_phone, 1, 2)->Column#36, substring(tpch.customer.c_phone, 1, 2)->Column#37 └─HashJoin 0.00 root anti semi join, equal:[eq(tpch.customer.c_custkey, tpch.orders.o_custkey)] @@ -1300,4 +1301,13 @@ Sort 1.00 root Column#31 │ └─TableFullScan 75000000.00 cop[tikv] table:orders keep order:false └─TableReader(Probe) 0.00 root data:Selection └─Selection 0.00 cop[tikv] gt(tpch.customer.c_acctbal, NULL), in(substring(tpch.customer.c_phone, 1, 2), "20", "40", "22", "30", "39", "42", "21") +======= + └─HashAgg 1.00 root group by:Column#36, funcs:count(1)->Column#32, funcs:sum(Column#35)->Column#33, funcs:firstrow(Column#36)->Column#31 + └─Projection 0.64 root tpch50.customer.c_acctbal->Column#35, substring(tpch50.customer.c_phone, 1, 2)->Column#36 + └─HashJoin 0.64 root anti semi join, equal:[eq(tpch50.customer.c_custkey, tpch50.orders.o_custkey)] + ├─TableReader(Build) 75000000.00 root data:TableFullScan + │ └─TableFullScan 75000000.00 cop[tikv] table:orders keep order:false + └─TableReader(Probe) 0.80 root data:Selection + └─Selection 0.80 cop[tikv] gt(tpch50.customer.c_acctbal, NULL), in(substring(tpch50.customer.c_phone, 1, 2), "20", "40", "22", "30", "39", "42", "21") +>>>>>>> f2c278ddc6b (Planner: Do not allow cardinality to go below 1 (#55242)) └─TableFullScan 7500000.00 cop[tikv] table:customer keep order:false diff --git a/tests/integrationtest/r/util/ranger.result b/tests/integrationtest/r/util/ranger.result index d68da2e9b6eff..9d80cb506758d 100644 --- a/tests/integrationtest/r/util/ranger.result +++ b/tests/integrationtest/r/util/ranger.result @@ -195,12 +195,12 @@ select * from t where a = 3; a b explain format='brief' select * from t where a < 1; id estRows task access object operator info -PartitionUnion 1.00 root +PartitionUnion 2.00 root ├─TableReader 1.00 root data:Selection │ └─Selection 1.00 cop[tikv] lt(util__ranger.t.a, 1) │ └─TableFullScan 1.00 cop[tikv] table:t, partition:p0 keep order:false -└─TableReader 0.00 root data:Selection - └─Selection 0.00 cop[tikv] lt(util__ranger.t.a, 1) +└─TableReader 1.00 root data:Selection + └─Selection 1.00 cop[tikv] lt(util__ranger.t.a, 1) └─TableFullScan 3.00 cop[tikv] table:t, partition:p1 keep order:false select * from t where a < 1; a b @@ -227,9 +227,9 @@ select * from t where a < -1; a b explain format='brief' select * from t where a > 0; id estRows task access object operator info -PartitionUnion 3.00 root -├─TableReader 0.00 root data:Selection -│ └─Selection 0.00 cop[tikv] gt(util__ranger.t.a, 0) +PartitionUnion 4.00 root +├─TableReader 1.00 root data:Selection +│ └─Selection 1.00 cop[tikv] gt(util__ranger.t.a, 0) │ └─TableFullScan 1.00 cop[tikv] table:t, partition:p0 keep order:false └─TableReader 3.00 root data:Selection └─Selection 3.00 cop[tikv] gt(util__ranger.t.a, 0) @@ -256,12 +256,12 @@ a b  3 explain format='brief' select * from t where a > 3; id estRows task access object operator info -PartitionUnion 0.00 root -├─TableReader 0.00 root data:Selection -│ └─Selection 0.00 cop[tikv] gt(util__ranger.t.a, 3) +PartitionUnion 2.00 root +├─TableReader 1.00 root data:Selection +│ └─Selection 1.00 cop[tikv] gt(util__ranger.t.a, 3) │ └─TableFullScan 1.00 cop[tikv] table:t, partition:p0 keep order:false -└─TableReader 0.00 root data:Selection - └─Selection 0.00 cop[tikv] gt(util__ranger.t.a, 3) +└─TableReader 1.00 root data:Selection + └─Selection 1.00 cop[tikv] gt(util__ranger.t.a, 3) └─TableFullScan 3.00 cop[tikv] table:t, partition:p1 keep order:false select * from t where a > 3; a b diff --git a/tests/integrationtest/t/planner/cardinality/selectivity.test b/tests/integrationtest/t/planner/cardinality/selectivity.test index 59b5d98b3c5ef..2b1ec6c71a304 100644 --- a/tests/integrationtest/t/planner/cardinality/selectivity.test +++ b/tests/integrationtest/t/planner/cardinality/selectivity.test @@ -647,6 +647,9 @@ insert into t values ('tw', 0); insert into t values ('tw', 0); analyze table t; explain select * from t where a = 'tw' and b < 0; +set @@tidb_opt_fix_control = '47400:on'; +explain select * from t where a = 'tw' and b < 0; +set @@tidb_opt_fix_control = '47400:off'; # TestSelectCombinedLowBound drop table if exists t;