Skip to content

Commit

Permalink
sql: remove unused context parameter in reuseMemo
Browse files Browse the repository at this point in the history
Release note: None
  • Loading branch information
mgartner committed Oct 2, 2024
1 parent 52e7f48 commit faf3310
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions pkg/sql/plan_opt.go
Original file line number Diff line number Diff line change
Expand Up @@ -530,9 +530,7 @@ func (opc *optPlanningCtx) buildReusableMemo(
//
// The returned memo is only safe to use in one thread, during execution of the
// current statement.
func (opc *optPlanningCtx) reuseMemo(
ctx context.Context, cachedMemo *memo.Memo,
) (*memo.Memo, error) {
func (opc *optPlanningCtx) reuseMemo(cachedMemo *memo.Memo) (*memo.Memo, error) {
opc.incPlanTypeTelemetry(cachedMemo)
if cachedMemo.IsOptimized() {
// The query could have been already fully optimized in
Expand Down Expand Up @@ -713,7 +711,7 @@ func (opc *optPlanningCtx) fetchPreparedMemo(ctx context.Context) (_ *memo.Memo,
}
if validMemo != nil {
opc.log(ctx, "reusing cached memo")
return opc.reuseMemo(ctx, validMemo)
return opc.reuseMemo(validMemo)
}

// Otherwise, we need to rebuild the memo.
Expand Down Expand Up @@ -754,7 +752,7 @@ func (opc *optPlanningCtx) fetchPreparedMemo(ctx context.Context) (_ *memo.Memo,
}

// Re-optimize the memo, if necessary.
return opc.reuseMemo(ctx, newMemo)
return opc.reuseMemo(newMemo)
}

// buildExecMemo creates a fully optimized memo, possibly reusing a previously
Expand All @@ -768,7 +766,7 @@ func (opc *optPlanningCtx) buildExecMemo(ctx context.Context) (_ *memo.Memo, _ e
// rollback its transaction. Use resumeProc to resume execution in a new
// transaction where the control statement left off.
opc.log(ctx, "resuming stored procedure execution in a new transaction")
return opc.reuseMemo(ctx, resumeProc)
return opc.reuseMemo(resumeProc)
}

// Fetch and reuse a memo if a valid one is available.
Expand Down Expand Up @@ -802,7 +800,7 @@ func (opc *optPlanningCtx) buildExecMemo(ctx context.Context) (_ *memo.Memo, _ e
opc.log(ctx, "query cache hit")
opc.flags.Set(planFlagOptCacheHit)
}
return opc.reuseMemo(ctx, cachedData.Memo)
return opc.reuseMemo(cachedData.Memo)
}
opc.flags.Set(planFlagOptCacheMiss)
opc.log(ctx, "query cache miss")
Expand Down

0 comments on commit faf3310

Please sign in to comment.