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

Remove unnecessary JoinOverTimeRange step from dataflow plan #743

Merged
merged 4 commits into from
Aug 29, 2023

Conversation

courtneyholcomb
Copy link
Contributor

@courtneyholcomb courtneyholcomb commented Aug 28, 2023

Description

Currently, for all cumulative metrics, we add a JoinOverTimeRange step to the dataflow plan. However, some cumulative metrics are able to be queried without metric_time, in which case we should not JoinOverTimeRange. When we visit that node unnecessarily, there are two repercussions:

  1. We skip a SQL table alias. No major consequence here, but it is confusing to look at the SQL and wonder why it's skipped.
  2. We assume inaccurate costing, since the JoinOverTimeRangeNode assumes num_aggregations=1. This results in num_aggregations being off by 1 for the overall query.

This PR removes that unneeded step from the dataflow plan.

@cla-bot cla-bot bot added the cla:yes label Aug 28, 2023
@github-actions
Copy link

Thank you for your pull request! We could not find a changelog entry for this change. For details on how to document a change, see the contributing guide.

Copy link
Contributor

@tlento tlento left a comment

Choose a reason for hiding this comment

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

Thanks for splitting this out into such an easily readable PR. The previous silliness is so obvious here!

@courtneyholcomb courtneyholcomb merged commit a61c81e into main Aug 29, 2023
10 checks passed
@courtneyholcomb courtneyholcomb deleted the court/cumulative-dataflow branch August 29, 2023 17:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants