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

make "_tidb_rowid" be able to build range #7946

Closed
zz-jason opened this issue Oct 18, 2018 · 1 comment · Fixed by #8047
Closed

make "_tidb_rowid" be able to build range #7946

zz-jason opened this issue Oct 18, 2018 · 1 comment · Fixed by #8047
Labels
sig/planner SIG: Planner type/enhancement The issue or PR belongs to an enhancement.

Comments

@zz-jason
Copy link
Member

zz-jason commented Oct 18, 2018

Feature Request

Is your feature request related to a problem? Please describe:

For now, _tidb_rowid can not be used to calculate the handle range, which causes a full range table scan + filter, leads to a poor performance.

TiDB(localhost:4000) > desc select * from t where _tidb_rowid = 1;
+-----------------------+----------+------+------------------------------------------------------------+
| id                    | count    | task | operator info                                              |
+-----------------------+----------+------+------------------------------------------------------------+
| Projection_4          | 8000.00  | root | test.t.a                                                   |
| └─TableReader_7       | 8000.00  | root | data:Selection_6                                           |
|   └─Selection_6       | 8000.00  | cop  | eq(test.t._tidb_rowid, 1)                                  |
|     └─TableScan_5     | 10000.00 | cop  | table:t, range:[-inf,+inf], keep order:false, stats:pseudo |
+-----------------------+----------+------+------------------------------------------------------------+
4 rows in set (0.00 sec)

Describe the feature you'd like:

make "_tidb_rowid" be able to build range, avoid the full range table scan.

@zz-jason zz-jason added type/enhancement The issue or PR belongs to an enhancement. sig/planner SIG: Planner labels Oct 18, 2018
@zz-jason zz-jason changed the title make "_tidb_rowid" is be able to build range make "_tidb_rowid" be able to build range Oct 18, 2018
@morgo
Copy link
Contributor

morgo commented Oct 18, 2018

+1 This is useful for logical dumpers that chunk split based on _tidb_rowid. I didn't even realize it was table scanning.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sig/planner SIG: Planner type/enhancement The issue or PR belongs to an enhancement.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants