[MDEV-13345] Elimination of materialized view with GROUP BY in equi-join on grouping fields Created: 2017-07-18 Updated: 2023-04-11 |
|
| Status: | Stalled |
| Project: | MariaDB Server |
| Component/s: | None |
| Fix Version/s: | None |
| Type: | Task | Priority: | Major |
| Reporter: | Igor Babaev | Assignee: | Igor Babaev |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Issue Links: |
|
||||||||
| Description |
|
If a query contains a left join where the inner table is materialized view or derived table with GROUP BY and join operation is an equi-jion on grouping fields then the following
Here is an example of such transformation:
This re-writing can be done on the SQL level: both queries are valid SQL queries and they are equivalent.
the transformation produces an illegal query. However, it's obvious how this query can be executed. The transformation with small changes can be applied to join queries as well. This transformation allows to avoid materialization of grouping views / derived tables and improve the performance of many equi-join queries that use these views / derived tables. |
| Comments |
| Comment by Igor Babaev [ 2017-07-20 ] |
|
Here's the plan how this optimization can be implemented.
|