-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
sql: add support for scalars on the right of @> in index selection #22503
Conversation
Review status: 0 of 3 files reviewed at latest revision, 2 unresolved discussions, some commit checks broke. pkg/sql/opt/index_constraints.go, line 806 at r1 (raw file):
why do we need offset? it's always 0 for an inverted index pkg/sql/opt/index_constraints.go, line 824 at r1 (raw file):
[nit] move the Comments from Reviewable |
Reviewed 3 of 3 files at r1. pkg/sql/opt_index_selection.go, line 537 at r1 (raw file):
The comment says compare start keys, but it looks like you're comparing pkg/sql/opt/index_constraints.go, line 827 at r1 (raw file):
Isn't this the same as Comments from Reviewable |
b967ddf
to
feb13bb
Compare
Please ignore the encoding change commit. This change needs to be on top of that commit in order to sort correctly. Review status: 0 of 8 files reviewed at latest revision, 4 unresolved discussions. pkg/sql/opt/index_constraints.go, line 806 at r1 (raw file): Previously, RaduBerinde wrote…
Got rid of it. pkg/sql/opt/index_constraints.go, line 824 at r1 (raw file): Previously, RaduBerinde wrote…
Done. pkg/sql/opt/index_constraints.go, line 827 at r1 (raw file): Previously, rytaft wrote…
Good point! pkg/sql/opt_index_selection.go, line 537 at r1 (raw file): Previously, rytaft wrote…
I got rid of the whole thing. After changing the inverted key encoding, everything sorts correctly on the logical span level! Comments from Reviewable |
feb13bb
to
6560c8d
Compare
Reviewed 7 of 9 files at r2, 2 of 2 files at r3. pkg/util/encoding/encoding.go, line 504 at r3 (raw file):
Fix comment to match function name pkg/util/encoding/encoding.go, line 637 at r3 (raw file):
Can you add a comment about why you're skipping the first byte? pkg/util/encoding/encoding.go, line 788 at r3 (raw file):
encodes -> encoded Comments from Reviewable |
Review status: all files reviewed at latest revision, 6 unresolved discussions, all commit checks successful. pkg/sql/opt/index_constraints.go, line 822 at r3 (raw file):
[nit] extra space before pkg/sql/opt/index_constraints.go, line 826 at r3 (raw file):
I would explain "overlap" more clearly. The spans themselves clearly don't overlap, but what we're saying here is that there can't be duplicate results (PKs) when we scan both. pkg/sql/opt/index_constraints.go, line 828 at r3 (raw file):
This doesn't hurt but I don't think we need this check. We already know rightDatum is DJSON or we would have crashed above. If you keep it, add Comments from Reviewable |
57acd77
to
b95ef0a
Compare
Thanks! Review status: 5 of 8 files reviewed at latest revision, 6 unresolved discussions. pkg/sql/opt/index_constraints.go, line 822 at r3 (raw file): Previously, RaduBerinde wrote…
Done. pkg/sql/opt/index_constraints.go, line 826 at r3 (raw file): Previously, RaduBerinde wrote…
Done. pkg/sql/opt/index_constraints.go, line 828 at r3 (raw file):
pkg/util/encoding/encoding.go, line 504 at r3 (raw file): Previously, rytaft wrote…
Thanks for the comments, I'll address them on the original PR. It's at https://reviewable.io/reviews/cockroachdb/cockroach/21889 if you want to follow! pkg/util/encoding/encoding.go, line 637 at r3 (raw file): Previously, rytaft wrote…
Done. pkg/util/encoding/encoding.go, line 788 at r3 (raw file): Previously, rytaft wrote…
Done. Comments from Reviewable |
Reviewed 1 of 3 files at r4, 2 of 2 files at r5. Comments from Reviewable |
b95ef0a
to
dcea3ab
Compare
Closes: cockroachdb#21783 Release note: None
dcea3ab
to
12b9095
Compare
Closes: #21783
Release note: None