diff --git a/executor/distsql_test.go b/executor/distsql_test.go index 1f895a6703420..59b3aecc2bb6a 100644 --- a/executor/distsql_test.go +++ b/executor/distsql_test.go @@ -431,6 +431,9 @@ func TestCoprocessorPagingSize(t *testing.T) { tk.MustExec(fmt.Sprintf("insert into t_paging values %v", strings.Join(values, ", "))) tk.MustQuery("select @@tidb_min_paging_size").Check(testkit.Rows(strconv.FormatUint(paging.MinPagingSize, 10))) + // Enable the coprocessor paging protocol. + tk.MustExec("set @@tidb_enable_paging = on") + // When the min paging size is small, we need more RPC roundtrip! // Check 'rpc_num' in the execution information // diff --git a/planner/core/testdata/plan_suite_out.json b/planner/core/testdata/plan_suite_out.json index 4af35c8f71984..18e4396e16de6 100644 --- a/planner/core/testdata/plan_suite_out.json +++ b/planner/core/testdata/plan_suite_out.json @@ -6090,11 +6090,11 @@ " │ ├─IndexRangeScan(Build) 250.00 cop[tikv] table:ta, index:idx_ta_name(name) range:[\"chad999\",\"chad99:\"), keep order:false, stats:pseudo", " │ └─TableRowIDScan(Probe) 250.00 cop[tikv] table:ta keep order:false, stats:pseudo", " └─MaxOneRow(Probe) 1.00 root ", - " └─HashAgg 1.00 root funcs:sum(Column#17)->Column#13", - " └─IndexLookUp 1.00 root ", - " ├─IndexRangeScan(Build) 10.00 cop[tikv] table:tb, index:idx_tb_id(id) range: decided by [eq(test.ta.id, test.tb.id)], keep order:false, stats:pseudo", - " └─HashAgg(Probe) 1.00 cop[tikv] funcs:sum(test.tb.code)->Column#17", - " └─TableRowIDScan 10.00 cop[tikv] table:tb keep order:false, stats:pseudo" + " └─StreamAgg 1.00 root funcs:sum(Column#21)->Column#13", + " └─Projection 10.00 root cast(test.tb.code, decimal(10,0) BINARY)->Column#21", + " └─IndexLookUp 10.00 root ", + " ├─IndexRangeScan(Build) 10.00 cop[tikv] table:tb, index:idx_tb_id(id) range: decided by [eq(test.ta.id, test.tb.id)], keep order:false, stats:pseudo", + " └─TableRowIDScan(Probe) 10.00 cop[tikv] table:tb keep order:false, stats:pseudo" ], "Result": null, "Warning": null @@ -6287,12 +6287,12 @@ " └─Selection(Probe) 0.80 root gt(Column#19, 100)", " └─MaxOneRow 1.00 root ", " └─StreamAgg 1.00 root funcs:max(test.td.id)->Column#19", - " └─TopN 0.25 root test.td.id:desc, offset:0, count:1", - " └─IndexLookUp 0.25 root ", - " ├─Selection(Build) 9.99 cop[tikv] eq(test.ta.id, test.td.id)", - " │ └─IndexFullScan 9990.00 cop[tikv] table:td, index:idx_tc_id(id) keep order:false, stats:pseudo", - " └─TopN(Probe) 0.25 cop[tikv] test.td.id:desc, offset:0, count:1", - " └─Selection 0.25 cop[tikv] like(test.td.name, \"chad999%\", 92)", + " └─Limit 0.25 root offset:0, count:1", + " └─Projection 0.25 root test.td.id, test.td.name", + " └─IndexLookUp 0.25 root ", + " ├─Selection(Build) 9.99 cop[tikv] eq(test.ta.id, test.td.id)", + " │ └─IndexFullScan 9990.00 cop[tikv] table:td, index:idx_tc_id(id) keep order:true, desc, stats:pseudo", + " └─Selection(Probe) 0.25 cop[tikv] like(test.td.name, \"chad999%\", 92)", " └─TableRowIDScan 9.99 cop[tikv] table:td keep order:false, stats:pseudo" ], "Result": null, @@ -6324,12 +6324,12 @@ " └─Selection(Probe) 0.80 root gt(Column#19, 100)", " └─MaxOneRow 1.00 root ", " └─StreamAgg 1.00 root funcs:max(test.td.id)->Column#19", - " └─TopN 0.25 root test.td.id:desc, offset:0, count:1", - " └─IndexLookUp 0.25 root ", - " ├─Selection(Build) 9.99 cop[tikv] eq(test.ta.id, test.td.id)", - " │ └─IndexFullScan 9990.00 cop[tikv] table:td, index:idx_tc_id(id) keep order:false, stats:pseudo", - " └─TopN(Probe) 0.25 cop[tikv] test.td.id:desc, offset:0, count:1", - " └─Selection 0.25 cop[tikv] like(test.td.name, \"chad999%\", 92)", + " └─Limit 0.25 root offset:0, count:1", + " └─Projection 0.25 root test.td.id, test.td.name", + " └─IndexLookUp 0.25 root ", + " ├─Selection(Build) 9.99 cop[tikv] eq(test.ta.id, test.td.id)", + " │ └─IndexFullScan 9990.00 cop[tikv] table:td, index:idx_tc_id(id) keep order:true, desc, stats:pseudo", + " └─Selection(Probe) 0.25 cop[tikv] like(test.td.name, \"chad999%\", 92)", " └─TableRowIDScan 9.99 cop[tikv] table:td keep order:false, stats:pseudo" ], "Result": null, diff --git a/sessionctx/variable/tidb_vars.go b/sessionctx/variable/tidb_vars.go index 2d4c79954fad3..47ef49a593648 100644 --- a/sessionctx/variable/tidb_vars.go +++ b/sessionctx/variable/tidb_vars.go @@ -1055,7 +1055,7 @@ const ( DefTiDBPrepPlanCacheMemoryGuardRatio = 0.1 DefTiDBEnableConcurrentDDL = concurrencyddl.TiDBEnableConcurrentDDL DefTiDBSimplifiedMetrics = false - DefTiDBEnablePaging = false + DefTiDBEnablePaging = true DefTiFlashFineGrainedShuffleStreamCount = 0 DefStreamCountWhenMaxThreadsNotSet = 8 DefTiFlashFineGrainedShuffleBatchSize = 8192