Skip to content

Commit

Permalink
executor,sessionctx: enable coprocessor paging and make TestCoprocess…
Browse files Browse the repository at this point in the history
…orPagingSize stable (#38161)

close #38158
  • Loading branch information
tiancaiamao authored Sep 29, 2022
1 parent 99247f4 commit 14d085b
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 18 deletions.
3 changes: 3 additions & 0 deletions executor/distsql_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
//
Expand Down
34 changes: 17 additions & 17 deletions planner/core/testdata/plan_suite_out.json
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion sessionctx/variable/tidb_vars.go
Original file line number Diff line number Diff line change
Expand Up @@ -1055,7 +1055,7 @@ const (
DefTiDBPrepPlanCacheMemoryGuardRatio = 0.1
DefTiDBEnableConcurrentDDL = concurrencyddl.TiDBEnableConcurrentDDL
DefTiDBSimplifiedMetrics = false
DefTiDBEnablePaging = false
DefTiDBEnablePaging = true
DefTiFlashFineGrainedShuffleStreamCount = 0
DefStreamCountWhenMaxThreadsNotSet = 8
DefTiFlashFineGrainedShuffleBatchSize = 8192
Expand Down

0 comments on commit 14d085b

Please sign in to comment.