Skip to content

Conversation

@idegtiarenko
Copy link
Contributor

@idegtiarenko idegtiarenko commented Mar 25, 2025

LogicalPlanOptimizer & LocalLogicalPlanOptimizer were surprisingly visible in the profile output around initializing their long list of rules for each request (mostly spending time around creating loggers).

They do not have a state and could be shared across sessions reducing per session initialization time and amount of objects created.

image
(^^ initialization is hilighted with pink and accounts for ~1.59% of cpu)

@idegtiarenko idegtiarenko added >non-issue Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) :Analytics/ES|QL AKA ESQL v9.1.0 labels Mar 25, 2025
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-analytical-engine (Team:Analytics)

Copy link
Contributor

@bpintea bpintea left a comment

Choose a reason for hiding this comment

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

initialization is hilighted with pink and accounts for ~1.59% of cpu

Of what? I guess this isn't the entire planning, right? It'd be interesting to see what difference this PR makes too.
But in any case, the change makes sense to me.

@idegtiarenko
Copy link
Contributor Author

Of what?

Correct, 1.59 of parent that seems to be planning

Copy link
Contributor

@alex-spies alex-spies left a comment

Choose a reason for hiding this comment

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

Thanks @idegtiarenko , this is a nice simplification and optimization.

We have some slightly stateful renaming mechanisms in some optimizer rules (whenever temporary names need to be created); I double checked and they either rely on local variables (defined in the scope of a method) or synthetic static variables, so all looks good there.

@idegtiarenko idegtiarenko merged commit 2ce2fda into elastic:main Mar 31, 2025
17 checks passed
@idegtiarenko idegtiarenko deleted the static_rules branch March 31, 2025 12:28
idegtiarenko added a commit to idegtiarenko/elasticsearch that referenced this pull request Jun 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

:Analytics/ES|QL AKA ESQL >non-issue Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) v8.19.0 v9.1.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants