diff --git a/pkg/planner/core/core_init.go b/pkg/planner/core/core_init.go index d71c2365ac..ff785957c6 100644 --- a/pkg/planner/core/core_init.go +++ b/pkg/planner/core/core_init.go @@ -33,7 +33,6 @@ func init() { utilfuncp.FindBestTask4LogicalShow = findBestTask4LogicalShow utilfuncp.FindBestTask4LogicalCTETable = findBestTask4LogicalCTETable utilfuncp.FindBestTask4LogicalDataSource = findBestTask4LogicalDataSource - utilfuncp.FindBestTask4LogicalShowDDLJobs = findBestTask4LogicalShowDDLJobs utilfuncp.ExhaustPhysicalPlans4LogicalJoin = exhaustPhysicalPlans4LogicalJoin utilfuncp.ExhaustPhysicalPlans4LogicalApply = exhaustPhysicalPlans4LogicalApply utilfuncp.ExhaustPhysicalPlans4LogicalWindow = exhaustPhysicalPlans4LogicalWindow diff --git a/pkg/planner/core/find_best_task.go b/pkg/planner/core/find_best_task.go index 196835174d..1f6ba183c1 100644 --- a/pkg/planner/core/find_best_task.go +++ b/pkg/planner/core/find_best_task.go @@ -76,22 +76,6 @@ func findBestTask4LogicalShow(super base.LogicalPlan, prop *property.PhysicalPro return rt, nil } -func findBestTask4LogicalShowDDLJobs(super base.LogicalPlan, prop *property.PhysicalProperty) (base.Task, error) { - if prop.IndexJoinProp != nil { - // even enforce hint can not work with this. - return base.InvalidTask, nil - } - _, p := base.GetGEAndLogicalOp[*logicalop.LogicalShowDDLJobs](super) - if !prop.IsSortItemEmpty() { - return base.InvalidTask, nil - } - pShow := physicalop.PhysicalShowDDLJobs{JobNumber: p.JobNumber}.Init(p.SCtx()) - pShow.SetSchema(p.Schema()) - rt := &physicalop.RootTask{} - rt.SetPlan(pShow) - return rt, nil -} - func prepareIterationDownElems(super base.LogicalPlan) (*memo.GroupExpression, *logicalop.BaseLogicalPlan, int, iterFunc, base.LogicalPlan) { // get the possible group expression and logical operator from common lp pointer. ge, self := getGEAndSelf(super) diff --git a/pkg/planner/core/operator/physicalop/base_physical_plan.go b/pkg/planner/core/operator/physicalop/base_physical_plan.go index 2e6ab494c6..ba1cede41b 100644 --- a/pkg/planner/core/operator/physicalop/base_physical_plan.go +++ b/pkg/planner/core/operator/physicalop/base_physical_plan.go @@ -493,7 +493,7 @@ func FindBestTask(e base.LogicalPlan, prop *property.PhysicalProperty) (bestTask case *logicalop.DataSource: return utilfuncp.FindBestTask4LogicalDataSource(e, prop) case *logicalop.LogicalShowDDLJobs: - return utilfuncp.FindBestTask4LogicalShowDDLJobs(e, prop) + return findBestTask4LogicalShowDDLJobs(e, prop) case *logicalop.MockDataSource: return findBestTask4LogicalMockDatasource(lop, prop) default: diff --git a/pkg/planner/core/operator/physicalop/physical_show.go b/pkg/planner/core/operator/physicalop/physical_show.go index 8f8ae0933e..43e132dfd3 100644 --- a/pkg/planner/core/operator/physicalop/physical_show.go +++ b/pkg/planner/core/operator/physicalop/physical_show.go @@ -71,3 +71,19 @@ func (p *PhysicalShowDDLJobs) MemoryUsage() (sum int64) { } return p.PhysicalSchemaProducer.MemoryUsage() + size.SizeOfInt64 } + +func findBestTask4LogicalShowDDLJobs(super base.LogicalPlan, prop *property.PhysicalProperty) (base.Task, error) { + if prop.IndexJoinProp != nil { + // even enforce hint can not work with this. + return base.InvalidTask, nil + } + _, p := base.GetGEAndLogicalOp[*logicalop.LogicalShowDDLJobs](super) + if !prop.IsSortItemEmpty() { + return base.InvalidTask, nil + } + pShow := PhysicalShowDDLJobs{JobNumber: p.JobNumber}.Init(p.SCtx()) + pShow.SetSchema(p.Schema()) + rt := &RootTask{} + rt.SetPlan(pShow) + return rt, nil +} diff --git a/pkg/planner/util/utilfuncp/func_pointer_misc.go b/pkg/planner/util/utilfuncp/func_pointer_misc.go index 3571681d92..be4aab2193 100644 --- a/pkg/planner/util/utilfuncp/func_pointer_misc.go +++ b/pkg/planner/util/utilfuncp/func_pointer_misc.go @@ -53,10 +53,6 @@ var FindBestTask4LogicalCTETable func(lp base.LogicalPlan, // FindBestTask4LogicalShow will be called by LogicalShow in logicalOp pkg. var FindBestTask4LogicalShow func(lp base.LogicalPlan, prop *property.PhysicalProperty) (base.Task, error) -// FindBestTask4LogicalShowDDLJobs will be called by LogicalShowDDLJobs in logicalOp pkg. -var FindBestTask4LogicalShowDDLJobs func(lp base.LogicalPlan, - prop *property.PhysicalProperty) (base.Task, error) - // FindBestTask4LogicalCTE will be called by LogicalCTE in logicalOp pkg. var FindBestTask4LogicalCTE func(lp base.LogicalPlan, prop *property.PhysicalProperty) (t base.Task, err error)