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

DEVPROD-11215 Create benchmarks for TS bucket-level optimizations #1262

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

mattBoros
Copy link
Contributor

@mattBoros mattBoros commented Sep 23, 2024

Extends TimeseriesTsbsOptimizations.yml with benchmarks that will be affected by no longer doing the bucket-level rewrites in SERVER-93874.
Created TimeseriesExtendedRange.yml since there's future work for extended range optimizations, and also since SERVER-93874 will remove a block-processing optimization on $max. We can keep all benchmarks specific to extended range in TimeseriesExtendedRange.yml.

@mattBoros mattBoros requested a review from a team as a code owner September 23, 2024 19:02
@mattBoros mattBoros requested a review from a team as a code owner September 23, 2024 19:21
},
},
]

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The other query we talked about {$group: {_id: time, a: {$min/max: meta}}} wasn't affected, since it can't use bucket-level rewrites anyway.

@mattBoros
Copy link
Contributor Author

mattBoros commented Sep 26, 2024

I wrote the two benchmark files, all other files are automatically generated by genny

Some results:
When bucket-level rewrites are removed and the queries go through BP now, we see a ~3.1x increase in latency. (TimeseriesTsbsOptimizations.yml changes)
When we prevent BP from using the control.max field when its <1970, we see a ~4.4x increase in latency. (TimeseriesExtendedRange.yml changes)

Copy link
Contributor

@galon1 galon1 left a comment

Choose a reason for hiding this comment

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

I just had one main question but most of the changes look good

Comment on lines 3869 to 3873
Query Execution


### Support Channel
[#query-execution](https://mongodb.enterprise.slack.com/archives/CKABWR2CT)
Copy link
Contributor

Choose a reason for hiding this comment

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

Do you think QE should own these? I feel like QI will probably re-enable the optimization, but I'm not sure

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh yea, QI will probably be more involved in this benchmark in the future. I'll change it

Pipeline:
[
{$project: {time: 1, meta: 1}},
{$group: {_id: "$meta", gb: {$min: "$time"}}}
Copy link
Contributor

Choose a reason for hiding this comment

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

Both extended range and not extended range won't be applicable for $group rewrites with $min on the timeField because it's a rounded down value right? So we shouldn't be losing performance here between extended range and not. I'm not saying this isn't relevant here but it should be around the same for extended range and normal time-series collections

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yea! That's true. I was thinking it's probably best to cover both $min/$max instead of just $max, while were writing these benchmarks. Like if in the future we run into a similar $min bug, we'll already have this benchmark and it's perf history.

@mattBoros mattBoros requested a review from galon1 October 2, 2024 15:05
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