Plan Cache Should Not Differentiate Precision for Decimal Fields in Execution Plans
- Dominant language
- Go
- Stars
- 40.5k
- Forks
- 6.2k
- PR merge metrics
- PR metrics pending
Description
## Enhancement
During the process of simulating customer workloads, it was discovered that for decimal fields, differences in precision—whether for the integer part or the fractional part—result in different execution plans, causing cache misses. Both float and double types have the same issue.Let's take decimal as an example."
```
mysql> show create table t;
+-------+-----------------------------------------------------------------------------------------------------------------+
| Table | Create Table |
+-------+-----------------------------------------------------------------------------------------------------------------+
| t | CREATE TABLE `t` (
`a` decimal(10,2) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin |
+-------+-----------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)
```
example1

example2

Contributor guide
Assessment
This issue has not been assessed yet.