Skip to content

Commit eaa96cf

Browse files
author
James Cor
committed
oops
1 parent be9e4ba commit eaa96cf

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

sql/analyzer/costed_index_scan.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,7 @@ func getCostedIndexScan(ctx *sql.Context, statsProv sql.StatsProvider, rt sql.Ta
315315
}
316316

317317
var bestStat sql.Statistic
318-
if bestStat.FuncDeps().HasMax1Row() {
318+
if c.bestStat.FuncDeps().HasMax1Row() {
319319
bestStat = c.bestStat.WithRowCount(1).WithDistinctCount(1)
320320
} else {
321321
bestStat, err = c.bestStat.WithHistogram(c.bestHist)
@@ -325,7 +325,7 @@ func getCostedIndexScan(ctx *sql.Context, statsProv sql.StatsProvider, rt sql.Ta
325325
bestStat = stats.UpdateCounts(bestStat)
326326
}
327327

328-
if c.bestStat.FuncDeps().HasMax1Row() && !qFlags.JoinIsSet() && !qFlags.SubqueryIsSet() && lookup.Ranges.Len() == 1 {
328+
if bestStat.FuncDeps().HasMax1Row() && !qFlags.JoinIsSet() && !qFlags.SubqueryIsSet() && lookup.Ranges.Len() == 1 {
329329
// Strict index lookup without a join or subquery scope will return
330330
// at most one row. We could also use some sort of scope counting
331331
// to check for single scope.

0 commit comments

Comments
 (0)