[MDEV-28444] Wrong query plan using partition by range of date Created: 2022-04-29 Updated: 2022-04-29 |
|
| Status: | Open |
| Project: | MariaDB Server |
| Component/s: | None |
| Affects Version/s: | 10.7.1 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major |
| Reporter: | VAROQUI Stephane | Assignee: | Unassigned |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Description |
|
For a table partitioned by day with PK( date , point) to respect primary key ordering
The optimizer wrongly estimate the cost of the range ref access 2 vs 24M where as the 2 partions contains around 50M rows
At the same time the partition pruning should already filtering the date_heure range and a score of 2 is under estimate and should be more estimated to the number records of each pruned partition because it's a range full index scan As the result of this miss estimate the correct plan is ignored
We have observed this regression on pre production while production in 10.1 not affected and also the issue looks like beeing trigger at some point hitting 100% of the CPU with such queries |
| Comments |
| Comment by VAROQUI Stephane [ 2022-04-29 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Ollalala so strange select second voverd by index key or count
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by VAROQUI Stephane [ 2022-04-29 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Indeed this is a statitistic issue and may be not a full bug after all but
|