-
Notifications
You must be signed in to change notification settings - Fork 59
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
Infer array dimensions from index expressions #175
Conversation
Benchmarks
|
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.
Clever :)
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.
Good catch and fix!
I am a little worried about extracting a row from the table and passing it to an expression in index creation but we should be fine with extensive regression testing. We just need to make sure we use the APIs correctly for all kinds of corner cases.
Remaining: add tests
- expression is a non-const function
- expression returns e.g. 5-lengthed array on the first row, and 6-lengthed array on the second (should be easy to implement if you make the expression be the identity function and use a table with a column that has
real[]
type) - add tests from pull Add create expression test #174
- add pgvector tests (need not implement this functionality. just make sure a sane error is thrown)
- test when the expression does not even return an array but returns something else
- test when the expression returns a pgvector array
b329be4
to
1a6834d
Compare
Currently after creating an index with expression, we are not able to query it using cc: @Ngalstyan4 @dqii |
346f3d0
to
3fd8e53
Compare
3fd8e53
to
a8127fa
Compare
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #175 +/- ##
==========================================
- Coverage 83.06% 82.93% -0.14%
==========================================
Files 17 17
Lines 1175 1201 +26
Branches 251 256 +5
==========================================
+ Hits 976 996 +20
- Misses 85 87 +2
- Partials 114 118 +4
|
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 nits. Feel free to merge after addressing those
…ailing tests to todo
Description
When index is being created via expression and
dim
option is not passed we can not infer the array dimensions from the table row. So by this PR we will check if the expression list is not empty when inferring the dimensions, we will evaluate the expression over the first row of the table and try to get the array dimensions from the result.Relates to #174
Issue #162