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

Add use_cost_based_partitioning #16781

Merged

Conversation

lukasz-stec
Copy link
Member

@lukasz-stec lukasz-stec commented Mar 29, 2023

Description

Use use_cost_based_partitioning instead of use_exact_partitioning to control the cost-based optimization to prefer parent partitioning. The motivation is to be able to disable the optimization if the NDV statistics are overestimated and the optimization would hurt parallelism.

Additional context and related issues

Release notes

( ) This is not user-visible or docs only and no release notes are required.
( ) Release notes are required, please propose a release note for me.
(x) Release notes are required, with the following suggested text:

# General
* Add `optimizer.use-cost-based-partitioning` configuration property and `use_cost_based_partitioning` session property to allow disabling usage of cost based optimizer for determining partitioning of a stage. ({issue}`16781`)

@@ -276,7 +277,7 @@ else if ((!isStreamPartitionedOn(child.getProperties(), partitioningRequirement)
*/
private Optional<List<Symbol>> useParentPreferredPartitioning(AggregationNode node, Set<Symbol> parentPreferredPartitioningColumns)
{
if (isUseExactPartitioning(session)) {
if (!isUseCostBasedPartitioning(session)) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should still check for isUseExactPartitioning(session) right ? If use_exact_partitioning is true, I think that should supercede the new flag.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, done

@lukasz-stec lukasz-stec force-pushed the ls/073-use-cost-based-partitioning branch from affafe6 to 073a13b Compare March 29, 2023 11:20
Use use_cost_based_partitioning instead of use_exact_partitioning to
control the cost based optimization to prefer parent partitioning.
The motivation is to be able to disable the optimization if the NDV
statistics are overestimated and the optimization would hurt parallelism.
@lukasz-stec lukasz-stec force-pushed the ls/073-use-cost-based-partitioning branch from 073a13b to a425718 Compare March 30, 2023 07:08
@github-actions github-actions bot added the docs label Mar 30, 2023
@raunaqmorarka raunaqmorarka merged commit 975bb3e into trinodb:master Mar 31, 2023
@raunaqmorarka raunaqmorarka deleted the ls/073-use-cost-based-partitioning branch March 31, 2023 03:28
@github-actions github-actions bot added this to the 412 milestone Mar 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

2 participants