[ 
https://issues.apache.org/jira/browse/FLINK-39583?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Ferenc Csaky updated FLINK-39583:
---------------------------------
    Description: 
Goal is to improve digest-based subplan reuse (when 
{{table.optimizer.reuse-optimize-block-with-digest-enabled}} is set to true) 
for plans containing correlation variables, such as {{CROSS JOIN UNNEST}} and 
decorrelated subqueries.

Currently, structurally equivalent subplans can receive different Calcite 
{{CorrelationIds}} during separate view expansions, cause {{$cor}} uses a 
global counter. These ids become part of the relational digest, so otherwise 
identical subplans do not match and cannot be considered for reuse. The change 
introduces correlation-variable normalization before digest-based reuse, 
assigning deterministic sequential correlation ids per subplan so equivalent 
correlated plans produce matching digests.

> Normalize Calcite correl variables to make subplan reuse by digest more 
> effective
> ---------------------------------------------------------------------------------
>
>                 Key: FLINK-39583
>                 URL: https://issues.apache.org/jira/browse/FLINK-39583
>             Project: Flink
>          Issue Type: Improvement
>          Components: Table SQL / Planner
>            Reporter: Ferenc Csaky
>            Assignee: Ferenc Csaky
>            Priority: Major
>             Fix For: 2.4.0
>
>
> Goal is to improve digest-based subplan reuse (when 
> {{table.optimizer.reuse-optimize-block-with-digest-enabled}} is set to true) 
> for plans containing correlation variables, such as {{CROSS JOIN UNNEST}} and 
> decorrelated subqueries.
> Currently, structurally equivalent subplans can receive different Calcite 
> {{CorrelationIds}} during separate view expansions, cause {{$cor}} uses a 
> global counter. These ids become part of the relational digest, so otherwise 
> identical subplans do not match and cannot be considered for reuse. The 
> change introduces correlation-variable normalization before digest-based 
> reuse, assigning deterministic sequential correlation ids per subplan so 
> equivalent correlated plans produce matching digests.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to