[MDEV-9741] Window functions: support being in a subquery Created: 2016-03-16  Updated: 2023-12-05

Status: Stalled
Project: MariaDB Server
Component/s: Optimizer - Window functions
Fix Version/s: 10.2

Type: Task Priority: Major
Reporter: Sergei Petrunia Assignee: Sergei Petrunia
Resolution: Unresolved Votes: 0
Labels: None

Issue Links:
PartOf
is part of MDEV-6115 window functions as in the SQL standard Closed
Sprint: 10.2.0-9

 Description   

Current code assumes that window function computation is a once-in-a-query
event. It creates Item and Cached_item objects, and allocates things on
thd->mem_root.

This task is separate the computations into

  • Stage #1: a part that is done once
  • Stage #2: a part that is re-run for every select re-execution.

Also, all 'cursor' objects must be created at stage #1.



 Comments   
Comment by Sergei Petrunia [ 2016-03-17 ]

Note: we free all that we allocate, so you don't get crashes when running window functions in a dependent subquery currently.

You may get O(#subquery_executions) memory consumption, though.

Comment by Vicențiu Ciorbaru [ 2016-09-06 ]

MDEV-10059 does some work regarding Task 1. Cursor creation is still part of the Window_func_runner::exec call, but it is separate from the computation algorithm. This can be easily refactored out now. We just need to figure out when we should do this.

Comment by Julien Fritsch [ 2023-12-05 ]

Automated message:
----------------------------
Since this issue has not been updated since 6 weeks, it's time to move it back to Stalled.

Generated at Thu Feb 08 07:36:58 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.