Skip to content

fix: Don't go through the analyze measurement path for profile queries - #5688

Merged
Swiddis merged 2 commits into
opensearch-project:mainfrom
Swiddis:fix/profile-fix
Aug 6, 2026
Merged

fix: Don't go through the analyze measurement path for profile queries#5688
Swiddis merged 2 commits into
opensearch-project:mainfrom
Swiddis:fix/profile-fix

Conversation

@Swiddis

@Swiddis Swiddis commented Aug 6, 2026

Copy link
Copy Markdown
Collaborator

Description

Don't go through the analyze measurement path for profile queries.

This means that "profile": true, "analyze": false queries are still paying the overhead for query analysis, which includes running the query twice among other things. In local measurement this causes ~800% performance regressions on frontend flows that use "profile": true assuming negligible overhead.

Run Config Avg (ms) Overhead vs baseline
baseline profile=false 30.17
reverted profile=true 32.24 +2.07ms (6.9% slower)
current main profile=true 272.66 +242.49ms (804% slower)

Related Issues

N/A

Check List

  • New functionality includes testing.
  • New functionality has been documented.
  • New functionality has javadoc added.
  • New functionality has a user manual doc added.
  • New PPL command checklist all confirmed.
  • API changes companion pull request created.
  • Commits are signed per the DCO using --signoff or -s.
  • Public documentation issue/PR created.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

Signed-off-by: Simeon Widdis <sawiddis@amazon.com>
@ahkcs

ahkcs commented Aug 6, 2026

Copy link
Copy Markdown
Collaborator

Maybe we can hold this PR for now as the PR for analyze may be reverted soon cc @Krish-Gandhi @penghuo

@Swiddis

Swiddis commented Aug 6, 2026

Copy link
Copy Markdown
Collaborator Author

Spoke with Krish, let's revert the one line first, if we need to revert the entire thing later we can just mix this delta in since it's trivial.

Signed-off-by: Simeon Widdis <sawiddis@amazon.com>
@github-actions

github-actions Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

PR Reviewer Guide 🔍

(Review updated until commit 6b67a00)

Here are some key observations to aid the review process:

🧪 PR contains tests
🔒 No security concerns identified
✅ No TODO sections
🔀 No multiple PR themes
⚡ Recommended focus areas for review

Test Coverage Gap

The test removes assertions for query, logicalPlan, physicalPlan, operator_tree, and recommendations fields without verifying they are absent or explaining why they should no longer be present. If these fields are no longer returned when profile=true and analyze=false, the test should explicitly assert their absence to document the behavioral change and prevent regressions.

        profile: true
- gt: {profile.summary.total_time_ms: 0.0}
- gt: {profile.phases.analyze.time_ms: 0.0}
- gt: {profile.phases.optimize.time_ms: 0.0}
- gt: {profile.phases.execute.time_ms: 0.0}
- gte: {profile.phases.format.time_ms: 0.0}
- gt: {profile.plan.time_ms: 0.0}
- match: {profile.plan.rows: 2}
- is_true: schema
- is_true: datarows
- match: {total: 2}
- match: {size: 2}

@github-actions

github-actions Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Persistent review updated to latest commit 6b67a00

@Swiddis
Swiddis merged commit 4d267a3 into opensearch-project:main Aug 6, 2026
38 of 40 checks passed
@Swiddis
Swiddis deleted the fix/profile-fix branch August 6, 2026 23:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugFix performance Make it fast! PPL Piped processing language

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants