Skip to content

planner: remove useless code #61227

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 24, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 1 addition & 19 deletions pkg/planner/core/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -230,26 +230,8 @@ func BuildPhysicalJoinSchema(joinType logicalop.JoinType, join base.PhysicalPlan
return newSchema
}

// GetStatsInfoFromFlatPlan gets the statistics info from a FlatPhysicalPlan.
func GetStatsInfoFromFlatPlan(flat *FlatPhysicalPlan) map[string]uint64 {
res := make(map[string]uint64)
for _, op := range flat.Main {
switch p := op.Origin.(type) {
case *PhysicalIndexScan:
if _, ok := res[p.Table.Name.O]; p.StatsInfo() != nil && !ok {
res[p.Table.Name.O] = p.StatsInfo().StatsVersion
}
case *PhysicalTableScan:
if _, ok := res[p.Table.Name.O]; p.StatsInfo() != nil && !ok {
res[p.Table.Name.O] = p.StatsInfo().StatsVersion
}
}
}
return res
}

// GetStatsInfo gets the statistics info from a physical plan tree.
// Deprecated: FlattenPhysicalPlan() + GetStatsInfoFromFlatPlan() is preferred.
// Deprecated: FlattenPhysicalPlan() is preferred.
func GetStatsInfo(i any) map[string]uint64 {
if i == nil {
// it's a workaround for https://github.com/pingcap/tidb/issues/17419
Expand Down