Skip to content

planner: reading from storage of tiflash may generate table dual path #49285

@AilinKid

Description

@AilinKid

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

create table t3(id int, sala char(10), name char(100), primary key(id, sala)) partition by list columns (sala)(partition p1 values in('a'));
alter table t3 set tiflash replia 1;
explain select /*+ read_from_storage(tiflash[t3]) */ * from t3 where sala='a' and id =1;

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

+-------------------------+---------+--------------+---------------+-------------------------------------------+
| id                      | estRows | task         | access object | operator info                             |
+-------------------------+---------+--------------+---------------+-------------------------------------------+
| TableReader_8           | 1.00    | root         | partition:p1  | MppVersion: 2, data:ExchangeSender_7      |
| └─ExchangeSender_7      | 1.00    | mpp[tiflash] |               | ExchangeType: PassThrough                 |
|   └─TableRangeScan_6     | 1.00    | mpp[tiflash] | table:t3      | range[1 'a', 1 'a']keep order:false, PartitionTableScan:true |
+-------------------------+---------+--------------+---------------+-------------------------------------------+
3 rows in set (6.791 sec)

3. What did you see instead (Required)

MySQL [test]> explain select /*+ read_from_storage(tiflash[t3]) */ * from t3 where sala='a' and id =1;
+-------------+---------+------+---------------+---------------+
| id          | estRows | task | access object | operator info |
+-------------+---------+------+---------------+---------------+
| TableDual_7 | 0.00    | root |               | rows:0        |
+-------------+---------+------+---------------+---------------+
1 row in set, 1 warning (0.001 sec)

4. What is your TiDB version? (Required)

master

Metadata

Metadata

Assignees

Labels

affects-6.5This bug affects the 6.5.x(LTS) versions.affects-7.1This bug affects the 7.1.x(LTS) versions.affects-7.5This bug affects the 7.5.x(LTS) versions.severity/majorsig/plannerSIG: Plannertype/bugThe issue is confirmed as a bug.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions