[MDEV-30218] Incorrect optimization for rowid_filtering Created: 2022-12-13 Updated: 2023-04-26 Resolved: 2023-02-16 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Optimizer |
| Affects Version/s: | 10.4, 10.5, 10.6, 10.7, 10.8 |
| Fix Version/s: | 10.11.3, 10.4.29, 10.5.20, 10.6.13, 10.7.8, 10.8.8, 10.9.6, 10.10.4 |
| Type: | Bug | Priority: | Blocker |
| Reporter: | Sergei Petrunia | Assignee: | Sergei Petrunia |
| Resolution: | Fixed | Votes: | 1 |
| Labels: | None | ||
| Issue Links: |
|
||||||||||||
| Description |
|
This comes from Monty who got a complaint from a user After Also, reading the optimizer code, one can see obvious cost computation errors. |
| Comments |
| Comment by Sergei Petrunia [ 2022-12-13 ] | |||||||||||||||||||||
|
My poking around in the related code was logged as | |||||||||||||||||||||
| Comment by Sergei Petrunia [ 2022-12-13 ] | |||||||||||||||||||||
|
https://github.com/MariaDB/server/commit/87eccd78a791ff3acfa00914254f0bf858a14aa4 | |||||||||||||||||||||
| Comment by Sergei Golubchik [ 2022-12-27 ] | |||||||||||||||||||||
|
There must be a test case, proving that the new code makes queries faster | |||||||||||||||||||||
| Comment by Sergei Golubchik [ 2023-01-17 ] | |||||||||||||||||||||
|
The following test case
becomes 15% slower after the patch | |||||||||||||||||||||
| Comment by Sergei Petrunia [ 2023-01-24 ] | |||||||||||||||||||||
|
| |||||||||||||||||||||
| Comment by Sergei Petrunia [ 2023-01-25 ] | |||||||||||||||||||||
|
A testcase like just like the above one from serg where original code (before the patch for this MDEV) will not use rowid filter, despite that the query plan is chooses is the same in all other aspects:
| |||||||||||||||||||||
| Comment by Sergei Petrunia [ 2023-01-26 ] | |||||||||||||||||||||
|
Part#2 patch: The change in subselect2.result looks odd. I've investigated - it has nothing | |||||||||||||||||||||
| Comment by Oleksandr Byelkin [ 2023-02-16 ] | |||||||||||||||||||||
|
I pushed it to 10.4 |