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

planner: make the read storage hint not force plan #14644

Merged
merged 5 commits into from
Feb 10, 2020

Conversation

lzmhhh123
Copy link
Contributor

What problem does this PR solve?

mysql> set @@session.tidb_isolation_read_engines ="tiflash";
Query OK, 0 rows affected (0.00 sec)

Set TiFlash isolation.

mysql> explain select /*+ read_from_storage(tikv[test]) */ * from test;
ERROR 1815 (HY000): Internal : Can't find a proper physical plan for this query

It looks a good behavior.

mysql> set @@session.tidb_isolation_read_engines ="tikv";
Query OK, 0 rows affected (0.00 sec)

Then set TiKV isolation.

mysql> explain select /*+ read_from_storage(tiflash[test]) */ * from test
+-------------------+----------+-----------+------------------------------------------------------------+
| id                | count    | task      | operator info                                              |
+-------------------+----------+-----------+------------------------------------------------------------+
| TableReader_5     | 10000.00 | root      | data:TableScan_4                                           |
| └─TableScan_4     | 10000.00 | cop[tiflash] | table:t, range:[-inf,+inf], keep order:false, stats:pseudo |
+-------------------+----------+-----------+------------------------------------------------------------+
2 rows in set (0.00 sec)

That's not the same behavior of TiFlash isolation read.

What is changed and how it works?

Remove the TODO in set hint storage type and make the hint not force the possible path for the DataSource.

Check List

Tests

  • Unit test
  • Integration test

Code changes

  • Has persistent data change

@lzmhhh123 lzmhhh123 added type/bugfix This PR fixes a bug. sig/planner SIG: Planner labels Feb 5, 2020
@lzmhhh123 lzmhhh123 requested a review from a team as a code owner February 5, 2020 06:56
@ghost ghost requested review from francis0407 and alivxxx and removed request for a team February 5, 2020 06:57
Copy link
Contributor

@alivxxx alivxxx left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@windtalker windtalker left a comment

Choose a reason for hiding this comment

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

LGTM

@lzmhhh123 lzmhhh123 added the status/can-merge Indicates a PR has been approved by a committer. label Feb 10, 2020
@sre-bot
Copy link
Contributor

sre-bot commented Feb 10, 2020

/run-all-tests

@sre-bot
Copy link
Contributor

sre-bot commented Feb 10, 2020

@lzmhhh123 merge failed.

@lzmhhh123
Copy link
Contributor Author

/run-unit-test

1 similar comment
@lzmhhh123
Copy link
Contributor Author

/run-unit-test

@lzmhhh123 lzmhhh123 merged commit 74e4908 into pingcap:master Feb 10, 2020
@lzmhhh123 lzmhhh123 deleted the bug-fix/wrong-hint-behavior branch February 10, 2020 12:02
lzmhhh123 added a commit to lzmhhh123/tidb that referenced this pull request Feb 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sig/planner SIG: Planner status/can-merge Indicates a PR has been approved by a committer. type/bugfix This PR fixes a bug.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants