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

Shortcut counts on exists queries #39570

Merged
merged 5 commits into from
Mar 4, 2019

Conversation

cbuescher
Copy link
Member

@cbuescher cbuescher commented Mar 1, 2019

TopDocsCollectorContext can already shortcut hit counts on match_all and term queries when there are no deletions.
This change adds this ability for exists queries if the index doesn't have deletions and fields are indexed.

Closes #37475

@cbuescher cbuescher added >enhancement WIP :Search/Search Search-related issues that do not fall into other categories v8.0.0 labels Mar 1, 2019
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-search

@cbuescher cbuescher added v7.2.0 and removed WIP labels Mar 4, 2019
@cbuescher cbuescher force-pushed the shortCut-Exists-Query-37475 branch from 068b113 to efd7457 Compare March 4, 2019 09:40
@cbuescher
Copy link
Member Author

@jpountz @jtibshirani I added an update and left a question about also handling NormsFieldExistsQuery. I can add this if the approach is generally similar to DocValuesFieldExistsQuery but would need some clarification on that.

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.

It looks good to me overall. I left one comment about a null check.

@cbuescher
Copy link
Member Author

@jpountz I added the null checks, didn't go into adding specific tests for this though because these cases seem to be triggered by the randomization frequently enough. Let me know if there is anything else to add.

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.

One comment, other than that LGTM. Feel free to push without further review.

@cbuescher cbuescher merged commit eea65da into elastic:master Mar 4, 2019
cbuescher pushed a commit to cbuescher/elasticsearch that referenced this pull request Mar 4, 2019
`TopDocsCollectorContext` can already shortcut hit counts on `match_all` and `term` queries when there are no deletions. 
This change adds this ability for `exists` queries if the index doesn't have deletions and fields are indexed.

Closes elastic#37475
cbuescher pushed a commit that referenced this pull request Mar 4, 2019
`TopDocsCollectorContext` can already shortcut hit counts on `match_all` and `term` queries when there are no deletions. 
This change adds this ability for `exists` queries if the index doesn't have deletions and fields are indexed.

Closes #37475
@cbuescher
Copy link
Member Author

@jpountz I ported this back to 7.1, do you think it should also go into 7.0? Maybe not is my feeling atm.

@jpountz
Copy link
Contributor

jpountz commented Mar 5, 2019

I wouldn't push it to 7.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>enhancement :Search/Search Search-related issues that do not fall into other categories v7.2.0 v8.0.0-alpha1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Shortcut counts on exists queries
5 participants