[MDEV-32878] Tuple comparison (kp1,kp2)=(1,2) is not sargable for DML queries Created: 2023-11-25 Updated: 2024-01-09 |
|
| Status: | Open |
| Project: | MariaDB Server |
| Component/s: | Optimizer |
| Affects Version/s: | 10.6, 11.3 |
| Fix Version/s: | 11.4 |
| Type: | Bug | Priority: | Major |
| Reporter: | Sergei Petrunia | Assignee: | Unassigned |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | optimizer-easy, optimizer-feature | ||
| Description |
|
Brought up by Gabriel Ciciliani on LinkedIN: The testcase:
SELECT makes use of the condition
While UPDATE doesn't:
Looking at the Optimizer Trace for SELECT, I can see that tuple-based equality was converted into multiple equalities:
and then the range optimizer produced a 3-keypart interval. For the UPDATE, equality transformation is not performed. I guess, range optimizer is not able to handle the original (a,b,c)=(1,2,3) |
| Comments |
| Comment by Sergei Petrunia [ 2023-11-25 ] | |||||||||||||||
|
It looks particularly odd with IN:
| |||||||||||||||
| Comment by Sergei Petrunia [ 2023-11-25 ] | |||||||||||||||
|
lstartseva? I'm pretty sure it wasn't fixed but Please check the new versions | |||||||||||||||
| Comment by Sergei Petrunia [ 2023-11-25 ] | |||||||||||||||
|
according to the reporter, MySQL 5.7 is not affected. | |||||||||||||||
| Comment by Lena Startseva [ 2023-11-27 ] | |||||||||||||||
|
psergei, yes, bug is reproducing in v. 11.3 |