Re: about optimization rules for over(partition by id, age order by id, age)

2024-02-22 Thread Benchao Li
FWIW, FLINK-12575 is a mechanism that removes redundant shuffle/sort in physical stage, and it's not a a generic rule, but it's in AbstractConverter while we try to satisfy Distribution and Collation trait. I'm not aware of any existing rules/RelBuilder in Calcite that has this optimization, it so

Re: about optimization rules for over(partition by id, age order by id, age)

2024-02-22 Thread key lou
thanks I also found a rule in fink. https://issues.apache.org/jira/browse/FLINK-12575 Julian Hyde 于2024年2月23日周五 09:04写道: > I noticed that DuckDB implemented such an optimization recently. > > Can you please log a jira case to remove redundant ORDER BY keys from > OVER? Yes, it would be either

Re: about optimization rules for over(partition by id, age order by id, age)

2024-02-22 Thread Julian Hyde
I noticed that DuckDB implemented such an optimization recently. Can you please log a jira case to remove redundant ORDER BY keys from OVER? Yes, it would be either a planner rule or a rewrite by RelBuilder. Julian > On Feb 21, 2024, at 11:43 PM, key lou wrote: > > HI ALL : > I have the fo

about optimization rules for over(partition by id, age order by id, age)

2024-02-21 Thread key lou
HI ALL : I have the following sql: select name, row_number() over(partition by id, age order by id, age) rn from t; In fact, it can be optimized into select name ,row_number() over(partition by id,age) rn from t; Remove order by because order by and partition by are repeated. Since they are grou