We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
For the query:
select u.id, u.name, t.num_segments from (select id, count(*) as num_segments from user group by 1 order by 2 desc limit 20) t join unsharded u on u.id = t.id
We produce the following plan:
{ "OperatorType": "Join", "Variant": "Join", "JoinColumnIndexes": "R:0,R:1,L:0", "JoinVars": { "t_id": 1 }, "TableName": "`user`_unsharded", "Inputs": [ { "OperatorType": "Limit", "Count": "20", "Inputs": [ { "OperatorType": "Route", "Variant": "Scatter", "Keyspace": { "Name": "user", "Sharded": true }, "FieldQuery": "select t.num_segments, t.id, count(*) from `user` where 1 != 1 group by id", "OrderBy": "2 DESC", "Query": "select t.num_segments, t.id, count(*) from `user` group by id order by count(*) desc limit 20", "Table": "`user`" } ] }, { "OperatorType": "Route", "Variant": "Unsharded", "Keyspace": { "Name": "main", "Sharded": false }, "FieldQuery": "select u.id, u.`name` from unsharded as u where 1 != 1", "Query": "select u.id, u.`name` from unsharded as u where u.id = :t_id", "Table": "unsharded" } ] }
The issue is with this line:
select t.num_segments, t.id, count(*) from `user` group by id order by count(*) desc limit 20
The derived table t doesn't exist, so this query errors out with:
t
target: xyz.-24.replica: vttablet: rpc error: code = NotFound desc = Unknown column 't.num_segments' in 'field list' (errno 1054)
The text was updated successfully, but these errors were encountered:
Successfully merging a pull request may close this issue.
For the query:
We produce the following plan:
The issue is with this line:
The derived table
t
doesn't exist, so this query errors out with:The text was updated successfully, but these errors were encountered: