Skip to content

planner: query cannot hit the plan cache and has no un-cacheable reason #46159

@qw4990

Description

@qw4990

Enhancement

mysql> create table t (a varchar(10), key(a(5)));
Query OK, 0 rows affected (0.02 sec)

mysql> prepare st from 'select a from t use index(a) where a=?';
Query OK, 0 rows affected (0.00 sec)

mysql> set @a='a';
Query OK, 0 rows affected (0.00 sec)

mysql> execute st using @a;
Empty set (0.01 sec)

mysql> execute st using @a;
Empty set (0.00 sec)

mysql> select @@last_plan_from_cache;
+------------------------+
| @@last_plan_from_cache |
+------------------------+
|                      0 |
+------------------------+
1 row in set (0.01 sec)

mysql> show warnings;
Empty set (0.00 sec)

show warnings should output the reason why this query cannot hit the cache.

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.epic/plan-cachesig/plannerSIG: Plannertype/enhancementThe issue or PR belongs to an enhancement.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions