-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
distsql: support tuples in streams #15938
Comments
Supporting tuples in DistSQL requires two things:
The other part mentioned - converting tuplified queries into untuplified versions - are not strictly necessary for supporting tuples in distsql, so should probably be tracked by the optimizer team. |
Great! A value encoding is functionally sufficient. The other part wasn't meant to be a task for this issue, it was just an example where tuples can pop up unexpectedly. I am filing an issue for the optimizer. |
Glad to see you think a value encoding is sufficient. I was afraid there might be an edge case where it wouldn't suffice. I think optimization wise pushing tuple construction as far down towards the end of the query would probably be sufficient - the value encoding precludes execution optimizations that require orderings between values, but that's about it... Anything that requires a tuple can be accomplished by keeping multiple columns as far as I can see, and constructing the tuple at the very end. |
Exactly, if we need ordering, we will just decode and compare. Unclear how important this optimization is anyway. |
Closes cockroachdb#15938. Release note (performance improvement): using tuples in a query no longer reverts you to single node local SQL execution.
Closes cockroachdb#15938. Release note (performance improvement): using tuples in a query no longer reverts you to single node local SQL execution.
Closes cockroachdb#15938. Release note (performance improvement): using tuples in a query no longer reverts you to single node local SQL execution.
Closes cockroachdb#15938. Release note (performance improvement): using tuples in a query no longer reverts you to single node local SQL execution.
Closes cockroachdb#15938. Release note (performance improvement): using tuples in a query no longer reverts you to single node local SQL execution.
Closes cockroachdb#15938. Release note (performance improvement): using tuples in a query no longer reverts you to single node local SQL execution.
Closes cockroachdb#15938. Release note (performance improvement): using tuples in a query no longer reverts you to single node local SQL execution.
Closes cockroachdb#15938. Release note (performance improvement): using tuples in a query no longer reverts you to single node local SQL execution.
Closes cockroachdb#15938. Release note (performance improvement): using tuples in a query no longer reverts you to single node local SQL execution.
We currently don't support tuples in DistSQL streams. We don't have a
ColumnType_Kind
for it and no way to encode it over the wire. This makes certain queries non-distributed.For example:
SELECT (k, v) FROM t
.Another example is more subtle:
SELECT k, v FROM t ORDER BY (k, v)
. Here the extra parens cause a tuple to be created for each row and used as the sort key. So this query is not supported by DistSQL, as opposed to the equivalentSELECT k, v FROM t ORDER BY k, v
. Granted, this case should be probably converted to latter version before distsql planning.CC @asubiotto
The text was updated successfully, but these errors were encountered: