Skip to content

Conversation

@mayya-sharipova
Copy link
Contributor

@mayya-sharipova mayya-sharipova commented Sep 13, 2021

Lucene 8.7 introduces numeric sort optimization directly in comparators.
This means we don't need to have it in ES.
This removes the sort optimization code in ES, and
the only thing that is needed is setCanUsePoints on sortField.

This also will introduce sort optimization with search_after,
as Lucene directly supports sort optimization with search_after.

As previously, we enable sort optimization only when there is
Long sort on Long or Date fields.

There could be a regression on desc sort, for example on
@timestamp desc field. In this case, we suggest to
convert these indices to data stream indices, as
datatastream indices have their desc sort on
@timestamp field optimized

Backport for #64292

Lucene 8.7 introduces numeric sort optimization directly in comparators.
This means we don't need to have it in ES.
This removes the sort optimization code in ES, and
the only thing that is needed is setCanUsePoints on sortField.

This also will introduce sort optimization with search_after,
as Lucene directly supports sort optimization with search_after.

As previously, we enable sort optimization only when there is
Long sort on Long or Date fields.

There could be a regression on desc sort, for example on
@timestamp desc field. In this case, we suggest to
convert these indices to data stream indices, as
datatastream indices have their desc sort on
@timestamp field optimized.
@mayya-sharipova mayya-sharipova changed the title Add sort optimization with after from Lucene (#64292) Add sort optimization with after from Lucene Sep 13, 2021
@mayya-sharipova mayya-sharipova merged commit 18cc59d into elastic:7.x Sep 13, 2021
@mayya-sharipova mayya-sharipova deleted the sort-optim-after-7.x branch September 13, 2021 12:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants