[MDEV-21626] Optimizer misses the details about the picked join order Created: 2020-02-01 Updated: 2020-06-05 Resolved: 2020-06-05 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Optimizer |
| Affects Version/s: | 10.5 |
| Fix Version/s: | 10.5.4, 10.4.14 |
| Type: | Bug | Priority: | Minor |
| Reporter: | Sergei Petrunia | Assignee: | Varun Gupta (Inactive) |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | optimizer_trace | ||
| Description |
|
Take the DBT-3 dataset, make sure you have these indexes:
Run these two queries. The queries are the same, except for the ORDER BY list.
However, looking at the optimizer trace, one can see that the join optimization parts are identical:
The first difference is in "attaching_conditions_to_tables" ? |
| Comments |
| Comment by Sergei Petrunia [ 2020-02-01 ] | ||||||||||
|
The test was done on the mdev8306-orig branch... were there any improvements to the trace since then? | ||||||||||
| Comment by Varun Gupta (Inactive) [ 2020-05-31 ] | ||||||||||
|
The issue here is the cost of adding a temp table is done when the first table doesn't resolve the ORDER BY clause
So I guess it would be ok to add this cost to the trace. | ||||||||||
| Comment by Varun Gupta (Inactive) [ 2020-06-03 ] | ||||||||||
|
Discussed this with psergey, it would be fine to add cost of sorting to 10.4 (the one seen in the code snippet) and we can improve this in 10.6 (with MDEV-8306) | ||||||||||
| Comment by Varun Gupta (Inactive) [ 2020-06-04 ] | ||||||||||
|
Patch | ||||||||||
| Comment by Sergei Petrunia [ 2020-06-04 ] | ||||||||||
|
Ok to push |