[ 
https://issues.apache.org/jira/browse/CALCITE-6788?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17913455#comment-17913455
 ] 

Stamatis Zampetakis commented on CALCITE-6788:
----------------------------------------------

In addition users can specify their own metadata handlers so 
{{mq.getCumulativeCost(rel)}} is already customizable. Why do we want to change 
the customization and push the responsibility to the planner?

Worth keeping in mind that this is gonna be a noticeable breaking change for 
various projects that specify their own metadata providers or override the 
{{RelOptPlanner#getCost}} method (e.g., 
[HiveVolcanoPlanner|https://github.com/apache/hive/blob/88e2175b2c04403e35b404634306f60d599c3d83/ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/cost/HiveVolcanoPlanner.java#L98])
 so if we decide to move forward we must ensure that it's worth it.

 

> LoptOptimizeJoinRule should delegate costs to optimization planner
> ------------------------------------------------------------------
>
>                 Key: CALCITE-6788
>                 URL: https://issues.apache.org/jira/browse/CALCITE-6788
>             Project: Calcite
>          Issue Type: Improvement
>          Components: core
>    Affects Versions: 1.38.0
>            Reporter: Claude Brisson
>            Priority: Major
>              Labels: pull-request-available
>
> {{LoptOptimizeJoinRule}} uses costs comparisons to recursively decide whether 
> to add a join at the top of the joins tree or to push it down.
> When doing so, instead of directly calling {{mq.getCumulativeCost(rel)}}, it 
> should rely on {{call.getPlanner.getCost(rel, mq)}}, which will be used 
> thereafter to choose the best joins tree.
> This way, it becomes possible to customize the costs computation during the 
> heuristic joins ordering phase by just overriding the {{getCost()}} method of 
> the optimization planner.
> Without this patch, it is only possible to alter joins costs at the final 
> phase of the algorithm, which defeats the goal of customizing them, including 
> during the to-top/push-down phase.



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

Reply via email to