-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
v3: support overlapping multi-column vindexes #4996
Conversation
Signed-off-by: Sugu Sougoumarane <ssougou@gmail.com>
Does this need a specific test for when vindex A is write_only vs vindex B? i.e. one thing somebody might actually do with this? |
I believe not. This fix is orthogonal of whether the vindex is RW or write-only. |
@eeSeeGee ping |
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
"Sharded": true | ||
}, | ||
"Query": "insert into overlap_vindex(kid, column_a, column_b) values (:_kid0, :_column_a0, 3)", | ||
"Values": [ |
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.
this would be easier to understand if we called this VindexValues
while converting to JSON just like in the original Insert
struct.
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.
Yeah. Makes sense. We should make a separate PR.
There exist use cases where one needs vindexes with overlapping columns. In such scenarios, the extraction of values cannot be done simultaneously with the substitution of bindvars. If so, the first vindex will substitute its bindvar name to replace an existing value, and then a subsequent vindex may pick up the previously substituted value instead of the original value.
With this logic change, we pull all necessary values out of the insert values in the first pass, and substitutes those values with bind var names in a separate pass.
Signed-off-by: Sugu Sougoumarane ssougou@gmail.com