-
Notifications
You must be signed in to change notification settings - Fork 5.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
plan: new plan support union. #3085
Conversation
plan/dag_plan_test.go
Outdated
// Test complex update. | ||
{ | ||
sql: "update t set a = 5 where b < 1 order by d limit 1", | ||
best: "TableReader(Table(t)->Sel([lt(test.t.b, 1)])->Limit)->Limit->*plan.Update", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where is order by d
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is a bug in old planner ...
mysql> create table t1(a int primary key,b int);
Query OK, 0 rows affected (0.01 sec)
mysql> explain update t1 set a = 1 where a < 1 order by b limit 1;
+-------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+----------+
| ID | Json | ParentID |
+-------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+----------+
| TableScan_6 | {
"db": "test",
"table": "t1",
"desc": false,
"keep order": true,
"push down info": {
"limit": 1,
"access conditions": [
"lt(test.t1.a, 1)"
],
"index filter conditions": null,
"table filter conditions": null
}
} | Update_5 |
| Update_5 | {
"children": [
"TableScan_6"
]
} | |
+-------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+----------+
2 rows in set (0.00 sec)
plan/dag_plan_test.go
Outdated
// Test complex delete. | ||
{ | ||
sql: "delete from t where b < 1 order by d limit 1", | ||
best: "TableReader(Table(t)->Sel([lt(test.t.b, 1)])->Limit)->Limit->*plan.Delete", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ditto
LGTM |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
new plan support union all.
@shenli @coocood @zimulala @winoros PTAL