[MDEV-13156] Equality propagation not working properly for non-merged derived tables Created: 2017-06-22 Updated: 2017-06-23 Resolved: 2017-06-23 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Optimizer |
| Affects Version/s: | 10.2 |
| Fix Version/s: | N/A |
| Type: | Bug | Priority: | Major |
| Reporter: | Sergei Petrunia | Assignee: | Unassigned |
| Resolution: | Not a Bug | Votes: | 0 |
| Labels: | None | ||
| Description |
|
Equality propagation is not working to a full extent when one of the members of the multi-equality is a field of derived table
I would expect that in the above query:
However, this EXPLAIN plan shows that the latter didn't occur:
|
| Comments |
| Comment by Sergei Petrunia [ 2017-06-22 ] | ||||||||||||||||||||||||||||||||||||||||||
|
(TODO: check if this is just caused by CNT and other columns having different data types) | ||||||||||||||||||||||||||||||||||||||||||
| Comment by Igor Babaev [ 2017-06-23 ] | ||||||||||||||||||||||||||||||||||||||||||
|
Most probably multiple-equal(TBL.a, CNT, t21.c) is not built here because the type of CNT differs from the type of the columns. It should be checked in debugger. | ||||||||||||||||||||||||||||||||||||||||||
| Comment by Sergei Petrunia [ 2017-06-23 ] | ||||||||||||||||||||||||||||||||||||||||||
|
Indeed if I change it to MAX:
Then equality propagation will work:
So this limitation is not really a bug (in a way that everything works like expected) | ||||||||||||||||||||||||||||||||||||||||||
| Comment by Sergei Petrunia [ 2017-06-23 ] | ||||||||||||||||||||||||||||||||||||||||||
|
Closing as this limitation is not considered a bug ( that is, a limitation but it's not worth working on) |