[MDEV-23450] Move subquery rewrites from JOIN::prepare into JOIN::optimize Created: 2020-08-11 Updated: 2023-11-09 |
|
| Status: | Open |
| Project: | MariaDB Server |
| Component/s: | Optimizer |
| Fix Version/s: | 11.5 |
| Type: | Task | Priority: | Critical |
| Reporter: | Sergei Petrunia | Assignee: | Sergei Petrunia |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | refactoring | ||
| Issue Links: |
|
||||||||
| Description |
|
Currently some of the subquery rewrites are done in check_and_do_in_subquery_rewrites(). This function is called from
This task is about moving subquery rewrites from JOIN::prepare() phase into JOIN::optimize(). check_and_do_in_subquery_rewrites() does several rewrites:
Note that for semi-joins, check_and_do_in_subquery_rewrites() doesn't actually do the rewrites. It checks the condition and adds the subquery into SELECT_LEX::sj_subselects. The actual conversion happens in JOIN::optimize_inner():
|
| Comments |
| Comment by Sergei Petrunia [ 2020-08-11 ] |
|
... the "remove redundant ORDER BY clause" rewrite should be moved from fix_fields into JOIN::optimize, too. |