Skip to content

ESQL - Add planning detailed timing to profile information#138564

Merged
carlosdelest merged 29 commits intoelastic:mainfrom
carlosdelest:enhancement/esql-profile-planning-time
Dec 9, 2025
Merged

ESQL - Add planning detailed timing to profile information#138564
carlosdelest merged 29 commits intoelastic:mainfrom
carlosdelest:enhancement/esql-profile-planning-time

Conversation

@carlosdelest
Copy link
Member

@carlosdelest carlosdelest commented Nov 25, 2025

Adds plan profiling to the plans profile section.

Added information:

{
     {
        "plans": [
            {
                "description": "data",
                "cluster_name": "runTask",
                "node_name": "runTask-0",
                "plan": "ExchangeSinkExec...",
                "logical_optimization_nanos": 532791,
                "physical_optimization_nanos": 269042
            },
            {
                "description": "node_reduce",
                "cluster_name": "runTask",
                "node_name": "runTask-0",
                "plan": "ExchangeSinkExec....",
                "reduction_nanos": 61000
            },
            {
                "description": "final",
                "cluster_name": "runTask",
                "node_name": "runTask-0",
                "plan": "...",
                "logical_optimization_nanos": 1804666,
                "physical_optimization_nanos": 565542
            }
        ]
    }
}

@carlosdelest carlosdelest added :Analytics/ES|QL AKA ESQL 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 >enhancement v9.3.0 and removed v9.3.0 labels Nov 25, 2025
@elasticsearchmachine
Copy link
Collaborator

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

elasticsearchmachine added 6 commits November 25, 2025 10:59
…lanning-time' into enhancement/esql-profile-planning-time
…ile-planning-time

# Conflicts:
#	x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/planner/PlannerUtils.java
#	x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/session/EsqlSession.java

/**
* @param logicalOptimizationNanos Time spent on local logical plan optimization (in nanoseconds)
* @param physicalOptimizationNanos Time spent on local physical plan optimization (in nanoseconds)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would like to move my prior question here: #138400 (comment)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you mind clarifying planNanos as well?

It looks like it includes:

breakPlanBetweenCoordinatorAndDataNode
reductionPlan
plan.collect(LookupJoinExec.class::isInstance)...
All of them should be fairly cheap.

I'm looking at it now - as you say, it's fairly cheap and probably makes no sense as it addresses multiple intermediate operations for planning.

I will remove it as it adds some confusion. Thanks!

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've added a reduction_nanos field for taking into account the reduction plan timing on node_reduce. LMKWYT!

…ile-planning-time

# Conflicts:
#	server/src/main/resources/transport/upper_bounds/9.3.csv
#	x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/planner/PlannerUtils.java
@carlosdelest carlosdelest marked this pull request as ready for review November 28, 2025 11:01
@carlosdelest carlosdelest removed the :Analytics/ES|QL AKA ESQL label Nov 28, 2025
@elasticsearchmachine elasticsearchmachine removed the Team:Search - Relevance The Search organization Search Relevance team label Nov 28, 2025
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-search-relevance (Team:Search Relevance)

elasticsearchmachine and others added 7 commits November 28, 2025 11:08
…ile-planning-time

# Conflicts:
#	server/src/main/resources/transport/upper_bounds/9.3.csv
#	x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/action/EsqlQueryResponseProfileTests.java
#	x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/action/EsqlQueryResponseTests.java
…ile-planning-time

# Conflicts:
#	x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/plugin/ComputeService.java
@carlosdelest
Copy link
Member Author

@idegtiarenko , can you please provide another review to this PR? Happy to do incremental updates to it in follow up PRs 👍

…ile-planning-time

# Conflicts:
#	server/src/main/resources/transport/upper_bounds/9.3.csv
#	x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/session/EsqlSession.java
@carlosdelest carlosdelest enabled auto-merge (squash) December 9, 2025 08:41
@carlosdelest carlosdelest merged commit c0b09df into elastic:main Dec 9, 2025
34 checks passed
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 Meta label for the Search Relevance team in Elasticsearch v9.3.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants