Skip to content

[CALCITE-6788] LoptOptimizeJoinRule should delegate costs to optimization planner#4148

Closed
arkanovicz wants to merge 1 commit intoapache:mainfrom
arkanovicz:issue6788
Closed

[CALCITE-6788] LoptOptimizeJoinRule should delegate costs to optimization planner#4148
arkanovicz wants to merge 1 commit intoapache:mainfrom
arkanovicz:issue6788

Conversation

@arkanovicz
Copy link
Copy Markdown
Contributor

@arkanovicz arkanovicz commented Jan 15, 2025

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.

@sonarqubecloud
Copy link
Copy Markdown

@zabetak zabetak added the discussion-in-jira There's open discussion in JIRA to be resolved before proceeding with the PR label Jan 15, 2025
@xiedeyantu
Copy link
Copy Markdown
Member

This issue has been resolved in #4231 . We will refer to the PR link and close this PR, and thank the @arkanovicz!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

discussion-in-jira There's open discussion in JIRA to be resolved before proceeding with the PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants