Skip to content
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

improve index merge row count estimation #19039

Closed
time-and-fate opened this issue Aug 6, 2020 · 1 comment · Fixed by #19040
Closed

improve index merge row count estimation #19039

time-and-fate opened this issue Aug 6, 2020 · 1 comment · Fixed by #19040
Assignees
Labels
type/enhancement The issue or PR belongs to an enhancement.

Comments

@time-and-fate
Copy link
Member

Development Task

Currently, when index merge estimates total row count of all partial paths, it simply adds up row counts of all partial paths as implemented below.

for _, partPath := range path.PartialIndexPaths {
var scan PhysicalPlan
var partialCost, rowCount float64
if partPath.IsTablePath() {
scan, partialCost, rowCount = ds.convertToPartialTableScan(prop, partPath)
} else {
scan, partialCost, rowCount = ds.convertToPartialIndexScan(prop, partPath)
}
scans = append(scans, scan)
totalCost += partialCost
totalRowCount += rowCount
}

This will cause inaccurate row count estimation because there may be overlapping. We need to improve index merge row count estimation method.

@time-and-fate time-and-fate added the type/enhancement The issue or PR belongs to an enhancement. label Aug 6, 2020
@time-and-fate
Copy link
Member Author

/assign @time-and-fate

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/enhancement The issue or PR belongs to an enhancement.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant