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

fix(trends): only filter breakdown values when needed #21219

Merged
merged 5 commits into from
Mar 28, 2024

Conversation

mariusandra
Copy link
Collaborator

@mariusandra mariusandra commented Mar 28, 2024

Problem

Some new trends queries with breakdowns are slower than their legacy brethren because we always filter them to only include all breakdown values. Sometimes that's all values and the filter is unnecessary.

Changes

Stop adding the breakdown filter if we're selecting all values. Essentially just when the "other" group is enabled.

Anecdotally, this makes some queries feel twice as fast.

How did you test this code?

There are updated snapshots, and I ran queries locally to verify they return what they should.

I'm really not sure what other kinds of test can I add here. I can replace the true (see snapshots) with 6 == 6 and check for that magic combination in the returned AST, but that's steering towards testing a specific implementation, not the effect... so I'm not convinced.

Ideally this is a change that would just be recorded in a benchmark suite somewhere, but we don't have one hooked up right now. Right now I'd like to unblock myself and move fast 😅

@mariusandra mariusandra marked this pull request as ready for review March 28, 2024 20:38
@mariusandra mariusandra requested a review from a team March 28, 2024 20:50
@mariusandra
Copy link
Collaborator Author

Merging it in to fix more bugs.

@mariusandra mariusandra merged commit 01ea124 into master Mar 28, 2024
76 checks passed
@mariusandra mariusandra deleted the filter-trends-breakdown branch March 28, 2024 21:36
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.

1 participant