Skip to content

ESQL - Add lucene query profiling to profile#138560

Draft
carlosdelest wants to merge 8 commits intoelastic:mainfrom
carlosdelest:enhancement/esql-lucene-query-profile
Draft

ESQL - Add lucene query profiling to profile#138560
carlosdelest wants to merge 8 commits intoelastic:mainfrom
carlosdelest:enhancement/esql-lucene-query-profile

Conversation

@carlosdelest
Copy link
Member

Adds the Lucene query profiling information to the LuceneOperators.

Example output (other profile sections removed):

{
  "profile": {
    "drivers": [
      {
        "operators": [
          {
            "operator": "LuceneSourceOperator[shards = [employees:0], maxPageSize = 4519, remainingDocs = 997]",
            "status": {
              "processed_slices": 1,
              "processed_queries": [
                "ConstantScore(ConstantScore(IndexOrDocValuesQuery(indexQuery=emp_no:[10091 TO 10093], dvQuery=emp_no:[10091 TO 10093])))"
              ],
              "processed_shards": [
                "employees:0"
              ],
              "process_nanos": 6325459,
              "slice_index": 0,
              "total_slices": 1,
              "pages_emitted": 1,
              "slice_min": 0,
              "slice_max": 0,
              "current": 2147483647,
              "rows_emitted": 3,
              "partitioning_strategies": {
                "employees:0": "SHARD"
              },
              "query_profile": [
                {
                  "type": "ConstantScoreQuery",
                  "description": "ConstantScore(ConstantScore(IndexOrDocValuesQuery(indexQuery=emp_no:[10091 TO 10093], dvQuery=emp_no:[10091 TO 10093])))",
                  "time_in_nanos": 6361249,
                  "breakdown": {
                    "set_min_competitive_score_count": 0,
                    "match_count": 0,
                    "shallow_advance_count": 0,
                    "set_min_competitive_score": 0,
                    "next_doc": 3749,
                    "match": 0,
                    "next_doc_count": 4,
                    "score_count": 0,
                    "compute_max_score_count": 0,
                    "compute_max_score": 0,
                    "advance": 0,
                    "advance_count": 0,
                    "count_weight_count": 0,
                    "score": 0,
                    "build_scorer_count": 2,
                    "create_weight": 544042,
                    "shallow_advance": 0,
                    "count_weight": 0,
                    "create_weight_count": 1,
                    "build_scorer": 5813458
                  },
                  "children": [
                    {
                      "type": "ConstantScoreQuery",
                      "description": "ConstantScore(IndexOrDocValuesQuery(indexQuery=emp_no:[10091 TO 10093], dvQuery=emp_no:[10091 TO 10093]))",
                      "time_in_nanos": 6351124,
                      "breakdown": {
                        "set_min_competitive_score_count": 0,
                        "match_count": 0,
                        "shallow_advance_count": 0,
                        "set_min_competitive_score": 0,
                        "next_doc": 3583,
                        "match": 0,
                        "next_doc_count": 4,
                        "score_count": 0,
                        "compute_max_score_count": 0,
                        "compute_max_score": 0,
                        "advance": 0,
                        "advance_count": 0,
                        "count_weight_count": 0,
                        "score": 0,
                        "build_scorer_count": 2,
                        "create_weight": 535291,
                        "shallow_advance": 0,
                        "count_weight": 0,
                        "create_weight_count": 1,
                        "build_scorer": 5812250
                      },
                      "children": [
                        {
                          "type": "IndexOrDocValuesQuery",
                          "description": "IndexOrDocValuesQuery(indexQuery=emp_no:[10091 TO 10093], dvQuery=emp_no:[10091 TO 10093])",
                          "time_in_nanos": 6346501,
                          "breakdown": {
                            "set_min_competitive_score_count": 0,
                            "match_count": 0,
                            "shallow_advance_count": 0,
                            "set_min_competitive_score": 0,
                            "next_doc": 3377,
                            "match": 0,
                            "next_doc_count": 4,
                            "score_count": 0,
                            "compute_max_score_count": 0,
                            "compute_max_score": 0,
                            "advance": 0,
                            "advance_count": 0,
                            "count_weight_count": 0,
                            "score": 0,
                            "build_scorer_count": 2,
                            "create_weight": 532583,
                            "shallow_advance": 0,
                            "count_weight": 0,
                            "create_weight_count": 1,
                            "build_scorer": 5810541
                          }
                        }
                      ]
                    }
                  ]
                }
              ]
            }
          }
        ]
      }
    ]
  }
}
    



@carlosdelest carlosdelest added >enhancement Team:Search Relevance Meta label for the Search Relevance team in Elasticsearch Team:Search - Relevance The Search organization Search Relevance team :Search Relevance/ES|QL Search functionality in ES|QL labels Nov 25, 2025
@elasticsearchmachine
Copy link
Collaborator

Hi @carlosdelest, I've created a changelog YAML for you.

elasticsearchmachine added 3 commits November 25, 2025 10:27
…ery-profile' into enhancement/esql-lucene-query-profile

# Conflicts:
#	x-pack/plugin/esql/compute/src/main/java/org/elasticsearch/compute/lucene/LuceneOperator.java
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

>enhancement :Search Relevance/ES|QL Search functionality in ES|QL Team:Search - Relevance The Search organization Search Relevance team Team:Search Relevance Meta label for the Search Relevance team in Elasticsearch v9.4.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants