Skip to content

Commit

Permalink
sql: don't make a redundant copy of the SetupFlowRequest for local flow
Browse files Browse the repository at this point in the history
We can just use the setup request directly since all remote requests (if
any) did make copies of the original request.

Release note: None
  • Loading branch information
yuzefovich committed Nov 18, 2021
1 parent ca8f8e4 commit 7a07241
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions pkg/sql/distsql_running.go
Original file line number Diff line number Diff line change
Expand Up @@ -356,15 +356,14 @@ func (dsp *DistSQLPlanner) setupFlows(
}

// Set up the flow on this node.
localReq := setupReq
localReq.Flow = *flows[thisNodeID]
setupReq.Flow = *flows[thisNodeID]
var batchReceiver execinfra.BatchReceiver
if recv.batchWriter != nil {
// Use the DistSQLReceiver as an execinfra.BatchReceiver only if the
// former has the corresponding writer set.
batchReceiver = recv
}
return dsp.distSQLSrv.SetupLocalSyncFlow(ctx, evalCtx.Mon, &localReq, recv, batchReceiver, localState)
return dsp.distSQLSrv.SetupLocalSyncFlow(ctx, evalCtx.Mon, &setupReq, recv, batchReceiver, localState)
}

// Run executes a physical plan. The plan should have been finalized using
Expand Down

0 comments on commit 7a07241

Please sign in to comment.