[MDEV-13622] Merging non-mergeable views into referring selects Created: 2017-08-22 Updated: 2023-04-11 |
|
| Status: | Open |
| Project: | MariaDB Server |
| Component/s: | Optimizer |
| Fix Version/s: | None |
| Type: | Task | Priority: | Major |
| Reporter: | Igor Babaev | Assignee: | Igor Babaev |
| Resolution: | Unresolved | Votes: | 2 |
| Labels: | None | ||
| Description |
|
Consider the following view:
This is a non-mergeable view, because it contains GROUP BY. In the current code this view is never merged. However it's obvious that if this view is used in the select
the view could be merged into the referring select to produce
The select to which a non-mergeable view is merged must refer only to this view in its FROM list. GROUP BY and HAVING clauses, DISTINCT, aggregate functions, window functions cannot be used in this select at the top level.
|