Comments (1)
This query is not working because we currently don't support subqueries in complex expressions, and the existence of the OR condition is causing the planner to fail.
If instead, we have run something like select count(*) from user where user.id in (select id from unsharded_a where colb = 2 union select 2)
then the planner is able to work and create a plan like -
{
"QueryType": "SELECT",
"Original": "select count(*) from user where user.id in (select id from unsharded_a where colb = 2 union select 2)",
"Instructions": {
"OperatorType": "Aggregate",
"Variant": "Scalar",
"Aggregates": "sum_count_star(0) AS count(*)",
"Inputs": [
{
"OperatorType": "UncorrelatedSubquery",
"Variant": "PulloutIn",
"PulloutVars": [
"__sq_has_values",
"__sq1"
],
"Inputs": [
{
"InputName": "SubQuery",
"OperatorType": "Route",
"Variant": "Unsharded",
"Keyspace": {
"Name": "main",
"Sharded": false
},
"FieldQuery": "select id from unsharded_a where 1 != 1 union select 2 from dual where 1 != 1",
"Query": "select id from unsharded_a where colb = 2 union select 2 from dual",
"Table": "dual, unsharded_a"
},
{
"InputName": "Outer",
"OperatorType": "Route",
"Variant": "IN",
"Keyspace": {
"Name": "user",
"Sharded": true
},
"FieldQuery": "select count(*) from `user` where 1 != 1",
"Query": "select count(*) from `user` where :__sq_has_values and `user`.id in ::__vals",
"Table": "`user`",
"Values": [
"::__sq1"
],
"Vindex": "user_index"
}
]
}
]
},
"TablesUsed": [
"main.dual",
"main.unsharded_a",
"user.user"
]
}
from vitess.
Related Issues (20)
- VTAdmin to use VTGate's vexplain HOT 2
- Feature Request: Per-table VStream COPY
- Support recursive CTEs
- Feature Request: ability to control streamer snapshot method (GTID tracking vs table locking) HOT 2
- Feature Request: clarify flag documentation for --db_charset
- Bug Report: MySQL 8.4 default configuration contains removed configuration variable `default_authentication_plugin`
- Feature Request: Add more flexibility backing up/restoring from different backup engines. HOT 1
- Feature Request: allow current/before `PRIMARY` to be specified in PRS
- Optimize `schemadiff` inter-dependent diff computation path HOT 1
- Bug Report: Premature buffering stop during concurrent external reparenting can lead to query failures HOT 1
- Feature Request: Speed up disk read for backups with fadvise(2) HOT 1
- Release of `v18.0.6` HOT 1
- Release of `v19.0.5` HOT 1
- Release of `v20.0.1` HOT 1
- Feature Request: Allow cross cell promotion in PRS
- RFC: Add upstream MySQL 9.0 vector type to Vitess
- Feature Request: MySQL 8.4 LTS support
- Bug Report: Can't cancel Materialize workflow on non-existent table
- BUG: Outer join conditions for sharded queries
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vitess.