[
https://issues.apache.org/jira/browse/CALCITE-7093?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18007658#comment-18007658
]
Claude Brisson commented on CALCITE-7093:
-----------------------------------------
In essence, customizing the cost model's {{getCumulativeCost}} for the joins
ordering phase for one, and customizing the cost function of the corresponding
optimization rule for the other are two different things. The former impacts
all cumulative costs, whereas the latter is specific to the costs used to
compare the candidate join trees.
In other terms, the optimization rule should be given a way to tweak the costs
of the candidates (and *only* those). I guess that tere are many use cases, for
instance if you want to favor specific patterns of join trees (right-deep,
bushy, etc.). This cannot be done, at least easily, with a custom cost-model.
> DPhyp algorithm should accept cost model as parameter
> -----------------------------------------------------
>
> Key: CALCITE-7093
> URL: https://issues.apache.org/jira/browse/CALCITE-7093
> Project: Calcite
> Issue Type: Wish
> Components: core
> Affects Versions: 1.40.0
> Reporter: Mihai Budiu
> Priority: Minor
>
> This is about the hypergraph-based optimization introduced in [CALCITE-6846]
> by [~dongsl].
> The algorithm makes calls to a cost model using getCumulativeCost() (function
> chooseBetterPlan()); the cost model is obtained from the Rel nodes.
> It could be useful to allow add to the the rule configuration an API to
> specify a cost model, similar to the MULTI_JOIN_OPTIMIZE rule
> (LoptOptimizeJoinRule), whose Config has as "withCostFunction" api.
> For example, this would allow the algorithm to emulate bushy join
> optimization using a cost model that optimizes for plan depth.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)