@@ -590,7 +590,7 @@ func (opc *optPlanningCtx) reuseMemo(cachedMemo *memo.Memo) (*memo.Memo, error)
590
590
opc .flags .Set (planFlagOptimized )
591
591
mem := f .Memo ()
592
592
if prep := opc .p .stmt .Prepared ; opc .allowMemoReuse && prep != nil {
593
- costWithOptimizationCost := mem .RootExpr ().(memo. RelExpr ). Cost ()
593
+ costWithOptimizationCost := mem .RootExpr ().Cost ()
594
594
costWithOptimizationCost .Add (mem .OptimizationCost ())
595
595
prep .Costs .AddCustom (costWithOptimizationCost )
596
596
}
@@ -772,7 +772,7 @@ func (opc *optPlanningCtx) fetchPreparedMemo(ctx context.Context) (_ *memo.Memo,
772
772
prep .IdealGenericPlan = true
773
773
case memoTypeGeneric :
774
774
prep .GenericMemo = newMemo
775
- prep .Costs .SetGeneric (newMemo .RootExpr ().(memo. RelExpr ). Cost ())
775
+ prep .Costs .SetGeneric (newMemo .RootExpr ().Cost ())
776
776
// Now that the cost of the generic plan is known, we need to
777
777
// re-evaluate the decision to use a generic or custom plan.
778
778
if ! opc .chooseGenericPlan () {
@@ -961,11 +961,11 @@ func (opc *optPlanningCtx) runExecBuilder(
961
961
if opc .gf .Initialized () {
962
962
planTop .instrumentation .planGist = opc .gf .PlanGist ()
963
963
}
964
- planTop .instrumentation .costEstimate = mem .RootExpr ().(memo. RelExpr ). Cost ().C
965
- available := mem .RootExpr ().(memo. RelExpr ). Relational ().Statistics ().Available
964
+ planTop .instrumentation .costEstimate = mem .RootExpr ().Cost ().C
965
+ available := mem .RootExpr ().Relational ().Statistics ().Available
966
966
planTop .instrumentation .statsAvailable = available
967
967
if available {
968
- planTop .instrumentation .outputRows = mem .RootExpr ().(memo. RelExpr ). Relational ().Statistics ().RowCount
968
+ planTop .instrumentation .outputRows = mem .RootExpr ().Relational ().Statistics ().RowCount
969
969
}
970
970
971
971
if stmt .ExpectedTypes != nil {
@@ -1045,7 +1045,7 @@ func (opc *optPlanningCtx) makeQueryIndexRecommendation(
1045
1045
f .FoldingControl ().AllowStableFolds ()
1046
1046
f .CopyAndReplace (
1047
1047
savedMemo ,
1048
- savedMemo .RootExpr ().(memo. RelExpr ) ,
1048
+ savedMemo .RootExpr (),
1049
1049
savedMemo .RootProps (),
1050
1050
f .CopyWithoutAssigningPlaceholders ,
1051
1051
)
@@ -1066,7 +1066,7 @@ func (opc *optPlanningCtx) makeQueryIndexRecommendation(
1066
1066
opc .optimizer .Init (ctx , f .EvalContext (), opc .catalog )
1067
1067
f .CopyAndReplace (
1068
1068
savedMemo ,
1069
- savedMemo .RootExpr ().(memo. RelExpr ) ,
1069
+ savedMemo .RootExpr (),
1070
1070
savedMemo .RootProps (),
1071
1071
f .CopyWithoutAssigningPlaceholders ,
1072
1072
)
@@ -1091,7 +1091,7 @@ func (opc *optPlanningCtx) makeQueryIndexRecommendation(
1091
1091
savedMemo .Metadata ().UpdateTableMeta (origCtx , f .EvalContext (), optTables )
1092
1092
f .CopyAndReplace (
1093
1093
savedMemo ,
1094
- savedMemo .RootExpr ().(memo. RelExpr ) ,
1094
+ savedMemo .RootExpr (),
1095
1095
savedMemo .RootProps (),
1096
1096
f .CopyWithoutAssigningPlaceholders ,
1097
1097
)
0 commit comments