Skip to content

Commit f030736

Browse files
ES|QL: do not calculate query plan diff when not needed (#137721) (#137725)
1 parent 3814ce0 commit f030736

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

docs/changelog/137721.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
pr: 137721
2+
summary: Do not calculate query plan diff when not needed
3+
area: ES|QL
4+
type: enhancement
5+
issues: []

x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/session/EsqlSession.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -371,7 +371,12 @@ private void executeSubPlan(
371371
);
372372
// TODO: INLINE STATS can we do better here and further optimize the plan AFTER one of the subplans executed?
373373
newLogicalPlan.setOptimized();
374-
LOGGER.trace("Main plan change after previous subplan execution:\n{}", NodeUtils.diffString(optimizedPlan, newLogicalPlan));
374+
if (LOGGER.isTraceEnabled()) {
375+
LOGGER.trace(
376+
"Main plan change after previous subplan execution:\n{}",
377+
NodeUtils.diffString(optimizedPlan, newLogicalPlan)
378+
);
379+
}
375380

376381
// look for the next inlinejoin plan
377382
var newSubPlan = firstSubPlan(newLogicalPlan, subPlansResults);

0 commit comments

Comments
 (0)