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

plan: new plan support union. #3085

Merged
merged 5 commits into from
Apr 24, 2017
Merged

plan: new plan support union. #3085

merged 5 commits into from
Apr 24, 2017

Conversation

hanfei1991
Copy link
Member

new plan support union all.
@shenli @coocood @zimulala @winoros PTAL

// 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",
Copy link
Member

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?

Copy link
Member Author

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)

// 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",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ditto

@coocood
Copy link
Member

coocood commented Apr 24, 2017

LGTM

@hanfei1991 hanfei1991 added the status/LGT1 Indicates that a PR has LGTM 1. label Apr 24, 2017
@shenli shenli added the priority/P1 The issue has P1 priority. label Apr 24, 2017
Copy link
Member

@winoros winoros left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@winoros winoros added status/LGT2 Indicates that a PR has LGTM 2. and removed status/LGT1 Indicates that a PR has LGTM 1. labels Apr 24, 2017
@coocood coocood merged commit f9a0abc into master Apr 24, 2017
@coocood coocood deleted the hanfei/ua branch April 24, 2017 11:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority/P1 The issue has P1 priority. status/LGT2 Indicates that a PR has LGTM 2.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants