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

Enable Point based optimization for custom comparators #8168

Merged
merged 11 commits into from Jun 29, 2023

Conversation

gashutos
Copy link
Contributor

@gashutos gashutos commented Jun 20, 2023

As a part of #6321 and #6424 , we enabled Lucene's numeric sort optimization which are based on BKD point values skipping logic.
We can enable this for our custom comparator as well. Which were disabled while upgrading to Lucene 9.1.0 in this PR 2487.

There is no harm adding this back, queries like below in nyc_taxis are showing 15x improvement on scaled_float numeric types. total_amount is scaled_float.

GET nyc_taxis/_search?size=1000
{
  "sort": [
    {
      "total_amount": {
        "order": "asc"
      }
    }
  ]
}

#8167 will be resolved with this.

@github-actions
Copy link
Contributor

Gradle Check (Jenkins) Run Completed with:

@github-actions
Copy link
Contributor

Gradle Check (Jenkins) Run Completed with:

@reta
Copy link
Collaborator

reta commented Jun 20, 2023

Gradle Check (Jenkins) Run Completed with:

* **RESULT:** FAILURE x

* **URL:** https://build.ci.opensearch.org/job/gradle-check/17993/

* **CommitID:** [0ecb840](https://github.com/opensearch-project/OpenSearch/commit/0ecb84005f2cec2fdff4475482579a1bd317c1bf)
  Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green.
  Is the failure [a flaky test](https://github.com/opensearch-project/OpenSearch/blob/main/DEVELOPER_GUIDE.md#flaky-tests) unrelated to your change?

org.opensearch.search.sort.FieldSortIT failures are legit

@gashutos
Copy link
Contributor Author

Gradle Check (Jenkins) Run Completed with:

* **RESULT:** FAILURE x

* **URL:** https://build.ci.opensearch.org/job/gradle-check/17993/

* **CommitID:** [0ecb840](https://github.com/opensearch-project/OpenSearch/commit/0ecb84005f2cec2fdff4475482579a1bd317c1bf)
  Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green.
  Is the failure [a flaky test](https://github.com/opensearch-project/OpenSearch/blob/main/DEVELOPER_GUIDE.md#flaky-tests) unrelated to your change?

org.opensearch.search.sort.FieldSortIT failures are legit

Yeah, looking at those.

Signed-off-by: gashutos <gashutos@amazon.com>
@github-actions
Copy link
Contributor

Gradle Check (Jenkins) Run Completed with:

  • RESULT: UNSTABLE ❕
  • TEST FAILURES:
      1 org.opensearch.snapshots.RestoreSnapshotIT.testRestoreInSameRemoteStoreEnabledIndex
      1 org.opensearch.remotestore.SegmentReplicationUsingRemoteStoreIT.testNodeDropWithOngoingReplication

@gashutos
Copy link
Contributor Author

@reta hardly people have context here on point based optimizations....
Lets merge it ?
I dont think we will be breaking anything with this.

@reta
Copy link
Collaborator

reta commented Jun 28, 2023

@reta hardly people have context here on point based optimizations....

Will do, but you've got new comment, needs to be resolved (merge is blocked)

…icFieldData.java

Co-authored-by: Andrew Ross <andrross@amazon.com>
Signed-off-by: Chaitanya Gohel <104654647+gashutos@users.noreply.github.com>
@github-actions
Copy link
Contributor

Gradle Check (Jenkins) Run Completed with:

@reta
Copy link
Collaborator

reta commented Jun 28, 2023

@gashutos sorry but needs rebase (to fix the Gradle check)

@github-actions
Copy link
Contributor

Gradle Check (Jenkins) Run Completed with:

  • RESULT: UNSTABLE ❕
  • TEST FAILURES:
      1 org.opensearch.remotestore.SegmentReplicationUsingRemoteStoreIT.testNodeDropWithOngoingReplication

@github-actions
Copy link
Contributor

Gradle Check (Jenkins) Run Completed with:

  • RESULT: UNSTABLE ❕
  • TEST FAILURES:
      1 org.opensearch.snapshots.RestoreSnapshotIT.testRestoreInSameRemoteStoreEnabledIndex
      1 org.opensearch.remotestore.SegmentReplicationUsingRemoteStoreIT.testNodeDropWithOngoingReplication
      1 org.opensearch.indices.replication.SegmentReplicationRelocationIT.testPrimaryRelocation

@gashutos
Copy link
Contributor Author

@gashutos sorry but needs rebase (to fix the Gradle check)

Done :)

@reta reta merged commit 87a833f into opensearch-project:main Jun 29, 2023
15 checks passed
@reta reta added backport 2.x Backport to 2.x branch v2.9.0 'Issues and PRs related to version v2.9.0' labels Jun 29, 2023
@opensearch-trigger-bot
Copy link
Contributor

The backport to 2.x failed:

The process '/usr/bin/git' failed with exit code 128

To backport manually, run these commands in your terminal:

# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add ../.worktrees/backport-2.x 2.x
# Navigate to the new working tree
pushd ../.worktrees/backport-2.x
# Create a new branch
git switch --create backport/backport-8168-to-2.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 87a833fbedfbcf9029d5e14e0597f8c5e8968086
# Push it to GitHub
git push --set-upstream origin backport/backport-8168-to-2.x
# Go back to the original working tree
popd
# Delete the working tree
git worktree remove ../.worktrees/backport-2.x

Then, create a pull request where the base branch is 2.x and the compare/head branch is backport/backport-8168-to-2.x.

@reta
Copy link
Collaborator

reta commented Jun 29, 2023

@gashutos sadly backport to 2.x needs manual work, could you take care of it please?

gashutos added a commit to gashutos/OpenSearch that referenced this pull request Jun 29, 2023
…oject#8168)

* Enable Point based optimization for custom comparators

Signed-off-by: gashutos <gashutos@amazon.com>

* Simplifying enableSkipping logic in IndexField

Signed-off-by: gashutos <gashutos@amazon.com>

* Empty commit

Signed-off-by: gashutos <gashutos@amazon.com>

* Update server/src/main/java/org/opensearch/index/fielddata/IndexNumericFieldData.java

Co-authored-by: Andrew Ross <andrross@amazon.com>
Signed-off-by: Chaitanya Gohel <104654647+gashutos@users.noreply.github.com>

---------

Signed-off-by: gashutos <gashutos@amazon.com>
Signed-off-by: Chaitanya Gohel <104654647+gashutos@users.noreply.github.com>
Co-authored-by: Andrew Ross <andrross@amazon.com>
gashutos added a commit to gashutos/OpenSearch that referenced this pull request Jun 29, 2023
…oject#8168)

* Enable Point based optimization for custom comparators

Signed-off-by: gashutos <gashutos@amazon.com>

* Simplifying enableSkipping logic in IndexField

Signed-off-by: gashutos <gashutos@amazon.com>

* Empty commit

Signed-off-by: gashutos <gashutos@amazon.com>

* Update server/src/main/java/org/opensearch/index/fielddata/IndexNumericFieldData.java

Co-authored-by: Andrew Ross <andrross@amazon.com>
Signed-off-by: Chaitanya Gohel <104654647+gashutos@users.noreply.github.com>

---------

Signed-off-by: gashutos <gashutos@amazon.com>
Signed-off-by: Chaitanya Gohel <104654647+gashutos@users.noreply.github.com>
Co-authored-by: Andrew Ross <andrross@amazon.com>
gashutos added a commit to gashutos/OpenSearch that referenced this pull request Jun 29, 2023
gashutos added a commit to gashutos/OpenSearch that referenced this pull request Jun 29, 2023
gashutos added a commit to gashutos/OpenSearch that referenced this pull request Jun 29, 2023
gashutos added a commit to gashutos/OpenSearch that referenced this pull request Jun 29, 2023
gashutos added a commit to gashutos/OpenSearch that referenced this pull request Jun 29, 2023
reta pushed a commit that referenced this pull request Jun 29, 2023
Signed-off-by: gashutos <gashutos@amazon.com>
baba-devv pushed a commit to baba-devv/OpenSearch that referenced this pull request Jul 29, 2023
…oject#8168)

* Enable Point based optimization for custom comparators

Signed-off-by: gashutos <gashutos@amazon.com>

* Simplifying enableSkipping logic in IndexField

Signed-off-by: gashutos <gashutos@amazon.com>

* Empty commit

Signed-off-by: gashutos <gashutos@amazon.com>

* Update server/src/main/java/org/opensearch/index/fielddata/IndexNumericFieldData.java

Co-authored-by: Andrew Ross <andrross@amazon.com>
Signed-off-by: Chaitanya Gohel <104654647+gashutos@users.noreply.github.com>

---------

Signed-off-by: gashutos <gashutos@amazon.com>
Signed-off-by: Chaitanya Gohel <104654647+gashutos@users.noreply.github.com>
Co-authored-by: Andrew Ross <andrross@amazon.com>
@msfroh msfroh mentioned this pull request Dec 1, 2023
8 tasks
shiv0408 pushed a commit to Gaurav614/OpenSearch that referenced this pull request Apr 25, 2024
…oject#8168)

* Enable Point based optimization for custom comparators

Signed-off-by: gashutos <gashutos@amazon.com>

* Simplifying enableSkipping logic in IndexField

Signed-off-by: gashutos <gashutos@amazon.com>

* Empty commit

Signed-off-by: gashutos <gashutos@amazon.com>

* Update server/src/main/java/org/opensearch/index/fielddata/IndexNumericFieldData.java

Co-authored-by: Andrew Ross <andrross@amazon.com>
Signed-off-by: Chaitanya Gohel <104654647+gashutos@users.noreply.github.com>

---------

Signed-off-by: gashutos <gashutos@amazon.com>
Signed-off-by: Chaitanya Gohel <104654647+gashutos@users.noreply.github.com>
Co-authored-by: Andrew Ross <andrross@amazon.com>
Signed-off-by: Shivansh Arora <hishiv@amazon.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport 2.x Backport to 2.x branch v2.9.0 'Issues and PRs related to version v2.9.0'
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants