[MDEV-21243] Join buffer: condition is checked in wrong place for range access Created: 2019-12-06 Updated: 2020-08-25 Resolved: 2020-01-12 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Optimizer |
| Affects Version/s: | 5.5, 10.3.10, 10.3.21, 10.4 |
| Fix Version/s: | 10.3.22, 10.4.12 |
| Type: | Bug | Priority: | Major |
| Reporter: | Sergei Petrunia | Assignee: | Sergei Petrunia |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Issue Links: |
|
||||||||
| Description |
|
When one uses
then the non-index condition $COND on $T is checked after $T is joined with the contents of the join buffer. It should be checked before that.
shows
Note that B.col1 + 1 < 33333 is checked when doing the join with the join buffer. |
| Comments |
| Comment by Sergei Petrunia [ 2019-12-07 ] | |||||||||||||||||||
|
The condition that is attached to the table is created in JOIN_TAB::make_scan_filter. make_scan_filter is invoked in two places:
Relevant code in make_join_select :
That is, make_scan_filter is not invoked when this heuristic is fired:
I see no reason for this. | |||||||||||||||||||
| Comment by Sergei Petrunia [ 2019-12-07 ] | |||||||||||||||||||
|
Patch committed into bb-10.3-mdev21243 tree. |