-
-
Notifications
You must be signed in to change notification settings - Fork 214
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
drop sort when secondary index is available #2080
Conversation
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.
Some correctness and reversed tests might be useful. Nulls are the other way secondaries are different, does the presence of NULLs in some secondary index keys behave differently than a regular sort node?
if idxCandidate.IsSpatial() { | ||
continue | ||
} | ||
if isSortFieldsValidPrefix(sfExprs, sfAliases, idxCandidate.Expressions()) { |
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 impl of this looks case-insensitive, but it might be useful to test
for i, fieldExpr := range sfExprs { | ||
fieldName := fieldExpr.String() | ||
if alias, ok := sfAliases[strings.ToLower(pkColNames[i])]; ok && alias == fieldName { | ||
if alias, ok := sfAliases[strings.ToLower(idxColExprs[i])]; ok && alias == fieldName { |
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.
do we have tests with aliases? and table aliases?
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, nice to catch a bunch of edge cases for this optimization
No description provided.