[MDEV-22417] "pushdown" of MIN/MAX inside UNION with WHERE and GROUP BY Created: 2020-04-05 Updated: 2023-12-12 |
|
| Status: | Open |
| Project: | MariaDB Server |
| Component/s: | Optimizer |
| Fix Version/s: | 11.5 |
| Type: | New Feature | Priority: | Major |
| Reporter: | Oleksandr Byelkin | Assignee: | Sergei Petrunia |
| Resolution: | Unresolved | Votes: | 1 |
| Labels: | optimizer | ||
| Issue Links: |
|
||||||||
| Description |
|
Even if we will not have MIN/MAX optimisation (as in MENT-693) we can get gail from early filtering by MIN/MAX pushdown. Transformation:
to
The idea of this task is to lift WHERE/GROUP BY limitations of MENT-693. We can clone WHERE condition portion which depend on field under MAX/MIN and GROUP BY (if possible to clone and to separate this portion from other condition (could be side effect, random, outer references mixed with the fields)), clone GROUP BY list (also if possible), in both (WHERE & GROUP BY) change fields of UNION result by references (direct reference?) on SELECT LIST of each underlying SELECT. Cloned WHERE will be add (AND) to the WHERE of each underlying SELECT and GROUP BY just add to each such SELECT (the select should not have own GROUP BY). |
| Comments |
| Comment by Julien Fritsch [ 2020-04-06 ] |
|
sanja since the fixversion is missing, I've added N/A to ensure this get listed into the dev or maintenance list, but please adjust it later. |