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

The hint READ_FROM_STORAGE not work for views #37885

Closed
jackysp opened this issue Sep 16, 2022 · 1 comment
Closed

The hint READ_FROM_STORAGE not work for views #37885

jackysp opened this issue Sep 16, 2022 · 1 comment
Labels
type/bug The issue is confirmed as a bug.

Comments

@jackysp
Copy link
Member

jackysp commented Sep 16, 2022

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

mysql --connect-timeout 15 -u '3sDg3oSF1k7eu15.root' -h [gateway01.ap-northeast-1.prod.aws.tidbcloud.com](http://gateway01.ap-northeast-1.prod.aws.tidbcloud.com/) -P 4000 -D test -p

You can use your own tidb-cloud dev_tier.

use gharchive_dev;
create view v1 as select * from github_events;
explain select /*+ READ_FROM_STORAGE(TIFLASH[github_events]) */ * from v1 where id = 1;

2. What did you expect to see? (Required)

The plan should use TiFlash as the storage engine.

3. What did you see instead (Required)

mysql> explain select * from v1 where id=100;
+--------------------------------+---------+-----------+----------------------------------------------------------+-----------------------------------+
| id                             | estRows | task      | access object                                            | operator info                     |
+--------------------------------+---------+-----------+----------------------------------------------------------+-----------------------------------+
| IndexLookUp_15                 | 0.00    | root      |                                                          |                                   |
| ├─IndexRangeScan_13(Build)     | 0.00    | cop[tikv] | table:github_events, index:index_github_events_on_id(id) | range:[100,100], keep order:false |
| └─TableRowIDScan_14(Probe)     | 0.00    | cop[tikv] | table:github_events                                      | keep order:false                  |
+--------------------------------+---------+-----------+----------------------------------------------------------+-----------------------------------+
3 rows in set (0.14 sec)

mysql> explain select /*+ READ_FROM_STORAGE(TIFLASH[github_events]) */ * from v1 where id=100;
+--------------------------------+---------+-----------+----------------------------------------------------------+-----------------------------------+
| id                             | estRows | task      | access object                                            | operator info                     |
+--------------------------------+---------+-----------+----------------------------------------------------------+-----------------------------------+
| IndexLookUp_15                 | 0.00    | root      |                                                          |                                   |
| ├─IndexRangeScan_13(Build)     | 0.00    | cop[tikv] | table:github_events, index:index_github_events_on_id(id) | range:[100,100], keep order:false |
| └─TableRowIDScan_14(Probe)     | 0.00    | cop[tikv] | table:github_events                                      | keep order:false                  |
+--------------------------------+---------+-----------+----------------------------------------------------------+-----------------------------------+
3 rows in set, 1 warning (0.14 sec)

mysql> show warnings;
+---------+------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Level   | Code | Message                                                                                                                                                          |
+---------+------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Warning | 1815 | There are no matching table names for (github_events) in optimizer hint /*+ READ_FROM_STORAGE(tiflash[github_events]) */. Maybe you can use the table alias name |
+---------+------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.14 sec)

4. What is your TiDB version? (Required)

796fb1f

@jackysp jackysp added the type/bug The issue is confirmed as a bug. label Sep 16, 2022
@winoros
Copy link
Member

winoros commented Sep 16, 2022

Now it's duplicated with the #37887 .
So we close this one. You can watch the progress via that one.

@winoros winoros closed this as completed Sep 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/bug The issue is confirmed as a bug.
Projects
None yet
Development

No branches or pull requests

2 participants