This is an automated email from the ASF dual-hosted git repository.
xiong pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/calcite.git
The following commit(s) were added to refs/heads/main by this push:
new 6226dbad38 [CALCITE-7053] In HepPlanner, move down the collectGarbage
to topological order for better optimizer performance
6226dbad38 is described below
commit 6226dbad38ee08aa4ede747dc81536946fe048c5
Author: Xiong Duan <[email protected]>
AuthorDate: Thu Jun 12 07:46:01 2025 +0800
[CALCITE-7053] In HepPlanner, move down the collectGarbage to topological
order for better optimizer performance
---
.../java/org/apache/calcite/plan/hep/HepPlanner.java | 16 +---------------
1 file changed, 1 insertion(+), 15 deletions(-)
diff --git a/core/src/main/java/org/apache/calcite/plan/hep/HepPlanner.java
b/core/src/main/java/org/apache/calcite/plan/hep/HepPlanner.java
index 3aaab70b1b..30b031f8ba 100644
--- a/core/src/main/java/org/apache/calcite/plan/hep/HepPlanner.java
+++ b/core/src/main/java/org/apache/calcite/plan/hep/HepPlanner.java
@@ -450,28 +450,14 @@ private void applyRules(HepProgram.State programState,
private Iterator<HepRelVertex> getGraphIterator(
HepProgram.State programState, HepRelVertex start) {
- // Make sure there's no garbage, because topological sort
- // doesn't start from a specific root, and rules can't
- // deal with firing on garbage.
-
- // FIXME jvs 25-Sept-2006: I had to move this earlier because
- // of FRG-215, which is still under investigation. Once we
- // figure that one out, move down to location below for
- // better optimizer performance.
- collectGarbage();
-
switch (requireNonNull(programState.matchOrder,
"programState.matchOrder")) {
case ARBITRARY:
case DEPTH_FIRST:
return DepthFirstIterator.of(graph, start).iterator();
-
case TOP_DOWN:
case BOTTOM_UP:
assert start == root;
- // see above
-/*
- collectGarbage();
-*/
+ collectGarbage();
return TopologicalOrderIterator.of(graph,
programState.matchOrder).iterator();
default:
throw new