-
-
Notifications
You must be signed in to change notification settings - Fork 210
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
Improve how index lookups and ranges address NULL values. #1078
Conversation
…ake it participate in the Range machinery.
Print lower bound AboveAll as (∞. Make IsEmpty return true is Lower >= Upper. Make RangeTree.GetRangeCollection() merge adjacent ranges on return. Make IndexBuilder exclude superfluous empty ranges.
…ilding static lookups that can actually match NULL.
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
rangeColumnExpr = expression.NewNullSafeLessThan(idx.Exprs[i], expression.NewLiteral(lit, typ)) | ||
rangeColumnExpr = or( | ||
expression.NewLessThan(idx.Exprs[i], expression.NewLiteral(lit, typ)), | ||
expression.NewIsNull(idx.Exprs[i]), |
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.
select * from t where c0 < 3
does not return nulls, so I'm assuming it doesn't get translated to a RangeType_LessThan
"github.com/stretchr/testify/assert" | ||
) | ||
|
||
func TestIndexBuilderRanges(t *testing.T) { |
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.
you should add a LT4=(NULL,4)
return RangeColumnExpr{ | ||
BelowAll{}, | ||
AboveNull{}, |
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.
+1
…they include NULL.
…on = do not scan NULL entries.
…-null' into aaron/sql-ranges-add-above-below-null
…anges-add-above-below-null-2
…w-null-2 sql/analyzer: Make indexed joins more aware of NULL safe comparisons.
No description provided.