Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

arkanovicz
Copy link
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.

@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
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.

2 participants