diff --git a/pkg/sql/plan_opt.go b/pkg/sql/plan_opt.go index 0f1444428739..661b7b0288a3 100644 --- a/pkg/sql/plan_opt.go +++ b/pkg/sql/plan_opt.go @@ -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 } @@ -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