Skip to content
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

Feature Request: better typing while planning #14310

Open
systay opened this issue Oct 19, 2023 · 0 comments
Open

Feature Request: better typing while planning #14310

systay opened this issue Oct 19, 2023 · 0 comments

Comments

@systay
Copy link
Collaborator

systay commented Oct 19, 2023

Feature Description

Vitess comes with a good expression typing system in the evaluation engine, but that is not used today while planning. This means that for a large number of queries, we end up using weight_strings since the very limited typing system available for the planner can't figure out the type of most expressions.

It would be great if we could use the already existing type system during query planning.

Example

For this simple query:

select 1 from user order by user.col + user.col

the produced plan still uses weight_strings because the planner can't figure out the type of user.col + user.col.

{
  "QueryType": "SELECT",
  "Original": "select 1 from user order by user.col + user.col",
  "Instructions": {
    "OperatorType": "Route",
    "Variant": "Scatter",
    "Keyspace": {
      "Name": "user",
      "Sharded": true
    },
    "FieldQuery": "select 1, `user`.col + `user`.col, weight_string(`user`.col + `user`.col) from `user` where 1 != 1",
    "OrderBy": "(1|2) ASC",
    "Query": "select 1, `user`.col + `user`.col, weight_string(`user`.col + `user`.col) from `user` order by `user`.col + `user`.col asc",
    "ResultColumns": 1,
    "Table": "`user`"
  },
  "TablesUsed": [
    "user.user"
  ]
}
@systay systay added Type: Feature Needs Triage This issue needs to be correctly labelled and triaged labels Oct 19, 2023
@systay systay changed the title Feature Request: Feature Request: better typing while planning Oct 19, 2023
@systay systay added Component: Query Serving and removed Needs Triage This issue needs to be correctly labelled and triaged labels Oct 19, 2023
@systay systay self-assigned this Oct 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant