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

Don't load global ordinals with the map execution_hint #38158

Merged
merged 4 commits into from
Feb 1, 2019

Conversation

jimczi
Copy link
Contributor

@jimczi jimczi commented Feb 1, 2019

Backport of #37833

jimczi and others added 2 commits February 1, 2019 09:37
The terms aggregator loads the global ordinals to retrieve the cardinality of the field to aggregate on. This information is then used to select the strategy to use for the aggregation (breadth_first or depth_first). However this should be avoided if the execution_hint is explicitly set to map since this mode doesn't really need the global ordinals. Since we still need the cardinality of the field this change picks the maximum cardinality in the segments as an estimation of the total cardinality to select the strategy to use (breadth_first or depth_first). This estimation is only used if the execution hint is set to map, otherwise the global ordinals are still used to retrieve the accurate cardinality.

Closes elastic#37705
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-analytics-geo

Copy link
Contributor

@jpountz jpountz left a comment

Choose a reason for hiding this comment

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

The approach looks a bit hacky to me, I suggested an alternative.

jimczi added a commit to jimczi/elasticsearch that referenced this pull request Feb 1, 2019
… `global_ordinals`

In elastic#38158 we ensured that global ordinals are not loaded when another execution hint is explicitly set
on the source. This change is a follow up that addresses a comment
https://github.com/elastic/elasticsearch/pull/38158/files/dd6043c1c019974fe1c58810384b89e30cd8b89b#r252984782
added after the merge.
… `global_ordinals`

In elastic#38158 we ensured that global ordinals are not loaded when another execution hint is explicitly set
on the source. This change is a follow up that addresses a comment
https://github.com/elastic/elasticsearch/pull/38158/files/dd6043c1c019974fe1c58810384b89e30cd8b89b#r252984782
added after the merge.
jimczi added a commit that referenced this pull request Feb 1, 2019
… `global_ordinals` (#38169)

In #38158 we ensured that global ordinals are not loaded when another execution hint is explicitly set on the source. This change is a follow up that addresses a comment
https://github.com/elastic/elasticsearch/pull/38158/files/dd6043c1c019974fe1c58810384b89e30cd8b89b#r252984782 added after the merge.
@jimczi jimczi merged commit 3d0e782 into elastic:6.x Feb 1, 2019
@jimczi jimczi deleted the global_ordinals_map_backport branch February 1, 2019 14:50
jasontedor added a commit to jasontedor/elasticsearch that referenced this pull request Feb 1, 2019
…ion-6.x

* elastic/6.x:
  fix compilation error
  Don't load global ordinals with the `map` execution_hint (elastic#38158)
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.

3 participants