[MDEV-16191] Analyze format=json gives incorrect value for r_limit inside a dependent subquery when ORDER BY is present Created: 2018-05-16 Updated: 2018-06-09 Resolved: 2018-06-09 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Optimizer |
| Affects Version/s: | 10.1, 10.2, 10.3 |
| Fix Version/s: | 10.1.34, 10.2.16, 10.3.8, 10.4.0 |
| Type: | Bug | Priority: | Major |
| Reporter: | Varun Gupta (Inactive) | Assignee: | Varun Gupta (Inactive) |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Description |
|
The test is
The output for analyze format=json is
So main concern is that r_limit=0 in filesort, inside the subquery block. |
| Comments |
| Comment by Varun Gupta (Inactive) [ 2018-06-06 ] | |||
|
Also r_output rows in filesort block looks incorrect.
So i expect this value to be 1 in the case as we have limit 1 in the subquery | |||
| Comment by Varun Gupta (Inactive) [ 2018-06-06 ] | |||
|
For r_output rows as discussed with psergey this is not a big issue and we can keep it as it is. This currently happens as the priority queue is full and we create space for an extra element as we need it for replacing the top element when the priority queue is full. This is the reason we get the incorrect value. | |||
| Comment by Varun Gupta (Inactive) [ 2018-06-06 ] | |||
|
Patch | |||
| Comment by Sergei Petrunia [ 2018-06-07 ] | |||
|
Ok to push. |