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 cost based decision log for scaled writer optimizer #21120

Merged
merged 1 commit into from
Oct 19, 2023

Conversation

feilong-liu
Copy link
Contributor

Description

#20990 add track of whether an optimization is cost based or not. This PR adds the logging for the new optimizer added in #20901

Motivation and Context

Add logging for new optimizer.

Impact

Make log to be consistent.

Test Plan

Easy change.

Contributor checklist

  • Please make sure your submission complies with our development, formatting, commit message, and attribution guidelines.
  • PR description addresses the issue accurately and concisely. If the change is non-trivial, a GitHub Issue is referenced.
  • Documented new properties (with its default value), SQL syntax, functions, or other functionality.
  • If release notes are required, they follow the release notes guidelines.
  • Adequate tests were added if applicable.
  • CI passed.

Release Notes

Please follow release notes guidelines and fill in the release notes below.

== NO RELEASE NOTE ==

@Override
public Result apply(TableWriterNode node, Captures captures, Context context)
{
double taskNumber = context.getStatsProvider().getStats(node).getTableWriterNodeStatsEstimate().getTaskCountIfScaledWriter();
statsSource = context.getStatsProvider().getStats(node).getSourceInfo().getSourceInfoName();
Copy link
Contributor

Choose a reason for hiding this comment

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

since this construct is used several times I wonder if we should introduce a utility function in PlannerUtils:getStatsSource(Context context, PlanNode node)

@feilong-liu feilong-liu merged commit 70ecc39 into prestodb:master Oct 19, 2023
@feilong-liu feilong-liu deleted the add_cost_log branch October 19, 2023 21:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants