Closed 3pointer closed 3 years ago
[REVIEW NOTIFICATION]
This pull request has not been approved.
To complete the pull request process, please ask the reviewers in the list to review by filling /cc @reviewer
in the comment.
After your PR has acquired the required number of LGTMs, you can assign this pull request to the committer in the list by filling /assign @committer
in the comment to help you merge this pull request.
The full list of commands accepted by this bot can be found here.
@3pointer: This cherry pick PR is for a release branch and has not yet been approved by release team.
Adding the do-not-merge/cherry-pick-not-approved
label.
To merge this cherry pick, it must first be approved by the collaborators.
AFTER it has been approved by collaborators, please ping the release team in a comment to request a cherry pick review.
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
SortByPK won't sort the data in memory. Here is the plan:
mysql> explain select a from t1 order by a;
+--------------------+------------+------+----------------------------------------------+
| id | count | task | operator info |
+--------------------+------------+------+----------------------------------------------+
| TableReader_11 | 8480000.00 | root | data:TableScan_10 |
| └─TableScan_10 | 8480000.00 | cop | table:t1, range:[-inf,+inf], keep order:true |
+--------------------+------------+------+----------------------------------------------+
2 rows in set (0.01 sec)
mysql> explain select b from t1 order by b;
+---------------------+------------+------+-----------------------------------------------+
| id | count | task | operator info |
+---------------------+------------+------+-----------------------------------------------+
| Sort_4 | 8480000.00 | root | test.t1.b:asc |
| └─TableReader_8 | 8480000.00 | root | data:TableScan_7 |
| └─TableScan_7 | 8480000.00 | cop | table:t1, range:[-inf,+inf], keep order:false |
+---------------------+------------+------+-----------------------------------------------+
3 rows in set (0.00 sec)
mysql> explain select * from t3 order by _tidb_rowid;
+----------------------+------------+------+----------------------------------------------+
| id | count | task | operator info |
+----------------------+------------+------+----------------------------------------------+
| Projection_5 | 8000000.00 | root | test.t3.a, test.t3.b, test.t3.c, test.t3.d |
| └─TableReader_11 | 8000000.00 | root | data:TableScan_10 |
| └─TableScan_10 | 8000000.00 | cop | table:t3, range:[-inf,+inf], keep order:true |
+----------------------+------------+------+----------------------------------------------+
3 rows in set (0.01 sec)
mysql> explain select * from t3;
+-------------------+------------+------+-----------------------------------------------+
| id | count | task | operator info |
+-------------------+------------+------+-----------------------------------------------+
| TableReader_5 | 8000000.00 | root | data:TableScan_4 |
| └─TableScan_4 | 8000000.00 | cop | table:t3, range:[-inf,+inf], keep order:false |
+-------------------+------------+------+-----------------------------------------------+
2 rows in set (0.00 sec)
What problem does this PR solve?
What is changed and how it works?
Check List
Tests
Side effects
Related changes
Release note