Skip to content

Commit

Permalink
opt: add more tracing events around planning
Browse files Browse the repository at this point in the history
Add a few more tracing events around the use of the optimizer.

Release note: None
  • Loading branch information
RaduBerinde committed Sep 9, 2020
1 parent 322198e commit 7ea3a55
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pkg/sql/plan_opt.go
Original file line number Diff line number Diff line change
Expand Up @@ -405,6 +405,7 @@ func (opc *optPlanningCtx) buildReusableMemo(ctx context.Context) (_ *memo.Memo,
// operators that can be constant folded, then fully optimize it now - it
// can be reused without further changes to build the execution tree.
if !f.Memo().HasPlaceholders() && !f.FoldingControl().PreventedStableFold() {
opc.log(ctx, "optimizing (no placeholders)")
if _, err := opc.optimizer.Optimize(); err != nil {
return nil, err
}
Expand Down Expand Up @@ -499,6 +500,8 @@ func (opc *optPlanningCtx) buildExecMemo(ctx context.Context) (_ *memo.Memo, _ e
}
opc.flags.Set(planFlagOptCacheMiss)
opc.log(ctx, "query cache miss")
} else {
opc.log(ctx, "not using query cache")
}

// We are executing a statement for which there is no reusable memo
Expand Down

0 comments on commit 7ea3a55

Please sign in to comment.