[MDEV-9787] Window functions: HAVING and GROUP BY Created: 2016-03-24 Updated: 2016-04-14 Resolved: 2016-04-10 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Optimizer - Window functions |
| Fix Version/s: | N/A |
| Type: | Task | Priority: | Major |
| Reporter: | Sergei Petrunia | Assignee: | Sergei Petrunia |
| Resolution: | Fixed | Votes: | 1 |
| Labels: | None | ||
| Issue Links: |
|
||||||||
| Sprint: | 10.2.0-10, 10.2.0-11 | ||||||||
| Description |
|
Now, add window function, and see that HAVING is not honored anymore:
|
| Comments |
| Comment by Sergei Petrunia [ 2016-03-27 ] | ||||||
|
Consider the query without the window function:
Operations: 2. call filesort Now, let's add a window function into the select list.
The problem is that sorting step also checks the HAVING clause. Two possible options:
| ||||||
| Comment by Sergei Petrunia [ 2016-03-28 ] | ||||||
|
Third option: so, subsequent sorting step also checks the HAVING clause. Let all window functions' filesort() calls check the HAVING clause, too. I'm not sure if this has the best performance but it's easiest to implement. | ||||||
| Comment by Sergei Petrunia [ 2016-04-10 ] | ||||||
|
This was fixed by d146c2cedc88e6d8728584b83861bd9b677a44a3 |