matrixone icon indicating copy to clipboard operation
matrixone copied to clipboard

[Tech Request]: Improve performance of range frame in over() window function

Open LiSong0214 opened this issue 2 years ago • 0 comments

Is there an existing issue for the same feature request?

  • [X] I have checked the existing issues.

Is your feature request related to a problem?

window_function_name(window_name/expression)
OVER (
[partition_defintion]
[order_definition]
[frame_definition])

●window_function_name:窗口函数的名字,例如 rank
●window_name/expression:窗口函数表达式
●partition_definition:窗口按照指定字段进行分区,如果没有指定partition by 和 frame,则把所有数据当作一个分区。
●order_definition:指定字段排序,对分区后的数据进行排序。
●frame_definition:当前分区的子集,通常作为滑动窗口使用,静态窗口函数没有 frame 子句。frame_unit 有两种 rows 和 range
○rows:基于行号
■可以使用 between <frame_start> and <frame_end>  来表示行范围,其中<frame_start>和<frame_end>支持一些关键字
●current row:当前行
●unbounded preceding:分区中的第一行
●unbounded following:分区中的最后一行
●expr preceding:当前行往前 <expr> 行,expr 为数字表达式
●expr following:当前行往后 <expr> 行,expr 为数字表达式
○range:基于值的范围
■可以使用 between <frame_start> and <frame_end>  来表示值范围,其中<frame_start>和<frame_end>支持一些关键字
●expr preceding:当前行的值 -  <expr>,expr 为数字表达式
●expr following:当前行的值 + <expr> ,expr 为数字表达式

Describe the feature you'd like

当前基于 range 的性能比较差,需要优化

Describe implementation you've considered

No response

Documentation, Adoption, Use Case, Migration Strategy

No response

Additional information

No response

LiSong0214 avatar Nov 24 '23 10:11 LiSong0214