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

Improve filtering for standard aggregation queries. #4056

Merged
merged 2 commits into from Aug 10, 2017

Conversation

dennisoelkers
Copy link
Member

@dennisoelkers dennisoelkers commented Aug 3, 2017

Description

Motivation and Context

This change improves the queries generated by the Searches#terms/fieldStats/histogram/fieldHistogram methods. By filtering the search result based on the specified time range in the query instead of the aggregation, overall ES runtime is improved.

Fortunately, filteredSearchRequest is already returning a matching query + time range search builder which can be used for those cases. Before this change, the source builder was generated by the specific method and contained only the query instead of query + time range.

Thanks to @hc4 for the input.

Fixes #4051.

How Has This Been Tested?

Screenshots (if appropriate):

Sample runtimes for the histogram before the change:

screen shot 2017-08-03 at 10 52 02

Sample runtimes for the histogram after the change:

screen shot 2017-08-03 at 10 51 32

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

This change improves the queries generated by the
Searches#terms/fieldStats/histogram/fieldHistogram methods. By filtering
the search result based on the specified time range in the query instead
of the aggregation, overall ES runtime is improved.

Fortunately, filteredSearchRequest is already returning a matching query
+ time range search builder which can be used for those cases. Before
this change, the source builder was generated by the specific method and
contained only the query instead of query + time range.

Fixes #4051.
Copy link
Member

@kroepke kroepke left a comment

Choose a reason for hiding this comment

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

lgtm!

@kroepke kroepke merged commit 0865385 into master Aug 10, 2017
@kroepke kroepke deleted the improve-histogram-query branch August 10, 2017 10:14
@kroepke kroepke mentioned this pull request Aug 10, 2017
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.

Slow histogram request
2 participants