-
Notifications
You must be signed in to change notification settings - Fork 110
sql/analyzer: add negate index #289
sql/analyzer: add negate index #289
Conversation
sql/analyzer/assign_indexes.go
Outdated
case *expression.Not: | ||
r, err := getNegatedIndexes(a, e) | ||
if err != nil { | ||
return result, err |
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.
why not return nil, err
?
|
||
return getIndexes(or, a) | ||
default: | ||
return nil, nil |
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.
note that you're returning nil
map here and a nil
error, that will cause a panic iterating in the previous function over the map (since error is nil)
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.
iterate over a nil map doesn't cause a panic https://play.golang.org/p/0xG3j4aeS9R
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.
Uh, you're right. Nvm then
sql/analyzer/assign_indexes.go
Outdated
@@ -438,6 +532,7 @@ func getMultiColumnIndexForExpressions( | |||
exprs []columnExpr, | |||
used map[sql.Expression]struct{}, | |||
) (index sql.Index, lookup sql.IndexLookup, err error) { | |||
|
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.
empty line
Signed-off-by: Manuel Carmona <manu.carmona90@gmail.com>
c44a82a
to
c869740
Compare
Signed-off-by: Manuel Carmona <manu.carmona90@gmail.com>
c869740
to
60ca3a5
Compare
I added a commit handling 'NOT IN' expressions |
Closes #262
Note that multicolumn indexes aren't used for
NOT
expressions.