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

HIVE-26238: Decouple sort filter predicates optimization from digest normalization in CBO #3299

Closed

Conversation

zabetak
Copy link
Contributor

@zabetak zabetak commented May 18, 2022

What changes were proposed in this pull request and why?

  1. Decouple sort filter optimization from digest normalization by refactoring HiveSortFilterPredicates into a (DFS) visitor. We cannot use planner or rules cause they make use of digest. Performing this optimization using a visitor slightly simplifies the code since there is no need to have a registry since we are not going to visit a node twice.

  2. Move the optimization after all post-join transformations to avoid having other optimizations cancel the benefit of the sort filter predicates. As shown by the plan changes here, now we can see some additional cases where the optimization is effective and wasn't done previously.

Does this PR introduce any user-facing change?

Possibly more efficient plan in certain cases.

How was this patch tested?

Existing CBO tests by enabling (0091373), disabling (7567730) normalization and checking plan changes.

@zabetak zabetak force-pushed the decouple-sort-pred-normalization branch from f6c54df to 9e11f47 Compare June 9, 2022 11:27
@zabetak zabetak closed this in f29cb22 Jun 10, 2022
@zabetak zabetak deleted the decouple-sort-pred-normalization branch June 10, 2022 13:09
DongWei-4 pushed a commit to DongWei-4/hive that referenced this pull request Oct 28, 2022
…normalization in CBO (Stamatis Zampetakis, reviewed by Zoltan Haindrich)

1. Decouple sort filter optimization from digest normalization by
refactoring HiveSortFilterPredicates into a (DFS) visitor. We cannot
use planner or rules cause they make use of digest. Performing this
optimization using a visitor slightly simplifies the code since there
is no need to have a registry since we are not going to visit the same
node twice.

2. Move the optimization after all post-join transformations to avoid
having other optimizations cancel the benefit of the sort filter
predicates.

Closes apache#3299
dengzhhu653 pushed a commit to dengzhhu653/hive that referenced this pull request Dec 15, 2022
…normalization in CBO (Stamatis Zampetakis, reviewed by Zoltan Haindrich)

1. Decouple sort filter optimization from digest normalization by
refactoring HiveSortFilterPredicates into a (DFS) visitor. We cannot
use planner or rules cause they make use of digest. Performing this
optimization using a visitor slightly simplifies the code since there
is no need to have a registry since we are not going to visit the same
node twice.

2. Move the optimization after all post-join transformations to avoid
having other optimizations cancel the benefit of the sort filter
predicates.

Closes apache#3299
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants