Skip to content

Esql - Add planner information to the profile #124919

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

Draft
wants to merge 26 commits into
base: main
Choose a base branch
from

Conversation

not-napoleon
Copy link
Member

This adds the ability to capture profile information about planning. It should cover both the initial coordinator level planning and the local replanning.

@not-napoleon
Copy link
Member Author

This is extremely work in progress at the moment. It's still littered with NOCOMMITs, I haven't written any tests yet, and I haven't even started on the actual profiling. I'm just pushing it up for some early feedback on how I plumbed the profile data through the query execution.

elasticsearchmachine and others added 7 commits March 14, 2025 20:05
 Conflicts:
	server/src/main/java/org/elasticsearch/TransportVersions.java
	x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/plugin/ComputeResponse.java
@@ -346,18 +348,48 @@ public EsqlResponse responseInternal() {

public static class Profile implements Writeable, ChunkedToXContentObject {
Copy link
Contributor

Choose a reason for hiding this comment

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

NIT: I wonder if we could make this a record?
This way we could avoid custom equals/hashCode/toString.
Merge could be updated to return a new instance instead of mutating this one

* Stores profiling information about the query plan. This can be the top level planning on the coordinating node, or the local
* planning on the data nodes.
*/
public class PlannerProfile implements Writeable, ChunkedToXContentObject {
Copy link
Contributor

Choose a reason for hiding this comment

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

It looks like this is still work in progress, but I would suggest we try to design it to be a record from the very beginning

not-napoleon and others added 8 commits March 20, 2025 13:12
 Conflicts:
	server/src/main/java/org/elasticsearch/TransportVersions.java
	x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/execution/PlanExecutor.java
	x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/plugin/EsqlPlugin.java
	x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/plugin/TransportEsqlQueryAction.java
	x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/telemetry/PlanExecutorMetricsTests.java
…profile' into esql-planner-profile

 Conflicts:
	x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/planner/PlannerProfile.java
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants