-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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
ranger: split detach process from BuildRange. #4741
Conversation
util/ranger/new_refiner.go
Outdated
@@ -206,35 +211,42 @@ func buildColumnRange(conds []expression.Expression, sc *variable.StatementConte | |||
return ranges, nil | |||
} | |||
|
|||
// DetachCondsForSelectivity distinguishes between conditions dor selectivity calculation and other conditions |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dor
? Also, Add a dot at the end.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
util/ranger/new_refiner.go
Outdated
@@ -206,35 +211,42 @@ func buildColumnRange(conds []expression.Expression, sc *variable.StatementConte | |||
return ranges, nil | |||
} | |||
|
|||
// DetachCondsForSelectivity distinguishes between conditions or selectivity calculation and other conditions. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The comment is not clear.
eqCount int | ||
) | ||
for eqCount = 0; eqCount < len(accessCondition) && eqCount < len(cols); eqCount++ { | ||
if sf, ok := accessCondition[eqCount].(*expression.ScalarFunction); !ok || sf.FuncName.L != ast.EQ { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The original is inAndEqCount
, now only Eq
is counted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in
has be rewritten to or
. Currently there won't be any in
function any more.
PTAL @coocood |
LGTM |
/run-all-test |
BuildRange
is used when calculate range for scan plan and for selectivity. The detach process of this two situation won't be the same in the future, so split the detach process out of theBuildRange
method.PTAL @coocood @hanfei1991 @lamxTyler