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

Optimize filter for timeseries, search, and select queries #2931

Merged
merged 4 commits into from
May 9, 2016

Conversation

acslk
Copy link
Contributor

@acslk acslk commented May 6, 2016

Fixes #2766
Added runner that optimizes the dimension filter for TimeSeries, Search, and Select queries. Note these query types are the only queries other than TopN and GroupBy that has dimension filter. The runner is added in preMergeQueryDecoration of QueryToolChest, which should only be called on the broker once for each query.

@fjy fjy added this to the 0.9.1 milestone May 6, 2016
@fjy fjy added the Improvement label May 6, 2016
)
{
if (!(query instanceof SearchQuery)) {
return runner.run(query, responseContext);
Copy link
Contributor

Choose a reason for hiding this comment

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

we should probably throw an exception here as this should not happen

@drcrallen
Copy link
Contributor

Hi @acslk thanks for the contribution! would you mind filling out the CLA?

Also, do you have performance or benchmarking numbers to back this up?

@fjy
Copy link
Contributor

fjy commented May 6, 2016

@drcrallen he doesn't need CLA. @acslk is with Imply.

@acslk
Copy link
Contributor Author

acslk commented May 6, 2016

@drcrallen I haven't ran any benchmarks yet.

@fjy
Copy link
Contributor

fjy commented May 6, 2016

@drcrallen there's really nothing major being changed in this PR. Do you feel benchmarks are necessary?

Query<Result<SearchResultValue>> query, Map<String, Object> responseContext
)
{
if (!(query instanceof SearchQuery)) {
Copy link
Contributor

Choose a reason for hiding this comment

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

It would be super weird to get anything other than a SearchQuery here, so I think it'd be OK to just do the cast without checking instanceof. If the cast fails due to some insanity then we'll still get a pretty reasonable ClassCastException.

.build();

checkSearchQuery(query, expectedHits);
checkSearchQuery(query, toolChest.mergeResults(toolChest.preMergeQueryDecoration(runner)), expectedHits);
Copy link
Contributor

Choose a reason for hiding this comment

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

If you add this style of checking to the base checkSearchQuery (so it always does both checks – one on a bare runner and one on the decorated runner) then that'll improve the coverage of all search tests, which would be cool.

might as well do a postMergeQueryDecoration too.

@gianm
Copy link
Contributor

gianm commented May 7, 2016

looks good other than minor comments. I don't think benchmarking is necessary, this is just applying the existing Filter.optimize method to queries other than topN and groupBy (which were already doing it).

@nishantmonu51
Copy link
Member

👍

@navis
Copy link
Contributor

navis commented May 9, 2016

With addressed #2931 (comment), 👍

@gianm
Copy link
Contributor

gianm commented May 9, 2016

👍

@gianm gianm merged commit 79a5428 into apache:master May 9, 2016
@acslk acslk deleted the feature-opt branch May 10, 2016 00:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants