Skip to content

Commit

Permalink
fix conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
winoros committed Apr 15, 2022
1 parent f0509f4 commit 4e6c383
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions planner/core/find_best_task.go
Original file line number Diff line number Diff line change
Expand Up @@ -542,15 +542,15 @@ func (ds *DataSource) isMatchProp(path *util.AccessPath, prop *property.Physical
func (ds *DataSource) getTableCandidate(path *util.AccessPath, prop *property.PhysicalProperty) *candidatePath {
candidate := &candidatePath{path: path}
candidate.isMatchProp = ds.isMatchProp(path, prop)
candidate.accessCondsColSet = expression.ExtractColumnSet(path.AccessConds)
candidate.accessCondsColSet = expression.ExtractColumnSet(path.AccessConds...)
return candidate
}

func (ds *DataSource) getIndexCandidate(path *util.AccessPath, prop *property.PhysicalProperty) *candidatePath {
candidate := &candidatePath{path: path}
candidate.isMatchProp = ds.isMatchProp(path, prop)
candidate.accessCondsColSet = expression.ExtractColumnSet(path.AccessConds)
candidate.indexFiltersColSet = expression.ExtractColumnSet(path.IndexFilters)
candidate.accessCondsColSet = expression.ExtractColumnSet(path.AccessConds...)
candidate.indexFiltersColSet = expression.ExtractColumnSet(path.IndexFilters...)
return candidate
}

Expand Down
4 changes: 2 additions & 2 deletions planner/core/stats.go
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ func (ds *DataSource) derivePathStatsAndTryHeuristics() error {
if selected == nil && len(uniqueIdxsWithDoubleScan) > 0 {
uniqueIdxColumnSets := make([]*intsets.Sparse, 0, len(uniqueIdxsWithDoubleScan))
for _, uniqueIdx := range uniqueIdxsWithDoubleScan {
uniqueIdxColumnSets = append(uniqueIdxColumnSets, expression.ExtractColumnSet(uniqueIdx.AccessConds))
uniqueIdxColumnSets = append(uniqueIdxColumnSets, expression.ExtractColumnSet(uniqueIdx.AccessConds...))
// Find the unique index with the minimal number of ranges as `uniqueBest`.
if uniqueBest == nil || len(uniqueIdx.Ranges) < len(uniqueBest.Ranges) {
uniqueBest = uniqueIdx
Expand All @@ -313,7 +313,7 @@ func (ds *DataSource) derivePathStatsAndTryHeuristics() error {
// Hence, for each index in `singleScanIdxs`, we check whether it is better than some index in `uniqueIdxsWithDoubleScan`.
// If yes, the index is a refined one. We find the refined index with the minimal number of ranges as `refineBest`.
for _, singleScanIdx := range singleScanIdxs {
columnSet := expression.ExtractColumnSet(singleScanIdx.AccessConds)
columnSet := expression.ExtractColumnSet(singleScanIdx.AccessConds...)
for _, uniqueIdxColumnSet := range uniqueIdxColumnSets {
setsResult, comparable := compareColumnSet(columnSet, uniqueIdxColumnSet)
if comparable && setsResult == 1 {
Expand Down

0 comments on commit 4e6c383

Please sign in to comment.