-
-
Notifications
You must be signed in to change notification settings - Fork 238
make st_within use spatial indexes
#1641
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
Conversation
sql/analyzer/indexes.go
Outdated
| // Assume these are all BinaryExpression with exactly two children | ||
| children := e.Children() | ||
| if len(children) != 2 { | ||
| panic("st function is not a binary expression") |
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.
best to just error, the function already has an error return type
| }, | ||
| tests: []SpatialIndexPlanTestAssertion{ | ||
| { | ||
| q: "select p from point_tbl where st_within(p, point(0,0))", |
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.
Just confirming, this validates that point_tbl is indexed? If someone breaks this in the future this will error to notify?
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.
should we have a test for null point? null value input into filter? can the index be a primary? the is a keyless table, maybe a pk table also? query that returns data?
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.
Yes, evalSpatialIndexPlanTest should check that the plan produced contains both a Filter and a IndexAccess
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.
I can add tests for primary key table and a null point.
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, some test suggestions
No description provided.