Skip to content

Commit

Permalink
Update plan_cache.go
Browse files Browse the repository at this point in the history
  • Loading branch information
fzzf678 committed Jul 28, 2022
1 parent 7afe5d3 commit 22f18bb
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions planner/core/plan_cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ func GetPlanFromSessionPlanCache(ctx context.Context, sctx sessionctx.Context, i
}
}

return rebuildPhysicalPlan(ctx, sctx, is, preparedStmt, ignorePlanCache, cacheKey,
return generateNewPlan(ctx, sctx, is, preparedStmt, ignorePlanCache, cacheKey,
latestSchemaVersion, isBinProtocol, varsNum, binVarTypes, txtVarTypes)
}

Expand Down Expand Up @@ -195,7 +195,9 @@ func getGeneralPlan(ctx context.Context, sctx sessionctx.Context, cacheKey kvcac
return nil, nil, false, nil
}

func rebuildPhysicalPlan(ctx context.Context, sctx sessionctx.Context, is infoschema.InfoSchema, preparedStmt *CachedPrepareStmt,
// generateNewPlan call the optimizer to generate a new plan for current statement
// and try to add it to cache
func generateNewPlan(ctx context.Context, sctx sessionctx.Context, is infoschema.InfoSchema, preparedStmt *CachedPrepareStmt,
ignorePlanCache bool, cacheKey kvcache.Key, latestSchemaVersion int64, isBinProtocol bool, varsNum int, binVarTypes []byte,
txtVarTypes []*types.FieldType) (Plan, []*types.FieldName, error) {
prepared := preparedStmt.PreparedAst
Expand Down

0 comments on commit 22f18bb

Please sign in to comment.