From 7a07241ff9957ea58a0b7aa468343bfc59cd5a9c Mon Sep 17 00:00:00 2001 From: Yahor Yuzefovich Date: Thu, 11 Nov 2021 18:40:11 -0800 Subject: [PATCH] sql: don't make a redundant copy of the SetupFlowRequest for local flow We can just use the setup request directly since all remote requests (if any) did make copies of the original request. Release note: None --- pkg/sql/distsql_running.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/pkg/sql/distsql_running.go b/pkg/sql/distsql_running.go index 8db798b40576..65bb7274879e 100644 --- a/pkg/sql/distsql_running.go +++ b/pkg/sql/distsql_running.go @@ -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