hbtoo commented on a change in pull request #2187:
URL: https://github.com/apache/calcite/pull/2187#discussion_r502861291
##########
File path: core/src/main/java/org/apache/calcite/plan/volcano/RelSubset.java
##########
@@ -375,76 +373,6 @@ RelNode buildCheapestPlan(VolcanoPlanner planner) {
return cheapest;
}
- /**
- * Checks whether a relexp has made its subset cheaper, and if it so,
- * propagate new cost to parent rel nodes using breadth first manner.
- *
- * @param planner Planner
- * @param mq Metadata query
- * @param rel Relational expression whose cost has improved
- * @param activeSet Set of active subsets, for cycle detection
- */
- void propagateCostImprovements(VolcanoPlanner planner, RelMetadataQuery mq,
- RelNode rel, Set<RelSubset> activeSet) {
- Queue<Pair<RelSubset, RelNode>> propagationQueue = new ArrayDeque<>();
- for (RelSubset subset : set.subsets) {
- if (rel.getTraitSet().satisfies(subset.traitSet)) {
- propagationQueue.offer(Pair.of(subset, rel));
- }
- }
-
- while (!propagationQueue.isEmpty()) {
- Pair<RelSubset, RelNode> p = propagationQueue.poll();
- p.left.propagateCostImprovements0(planner, mq, p.right, activeSet,
propagationQueue);
- }
- }
-
- void propagateCostImprovements0(VolcanoPlanner planner, RelMetadataQuery mq,
- RelNode rel, Set<RelSubset> activeSet,
- Queue<Pair<RelSubset, RelNode>> propagationQueue) {
- ++timestamp;
-
- if (!activeSet.add(this)) {
- // This subset is already in the chain being propagated to. This
- // means that the graph is cyclic, and therefore the cost of this
- // relational expression - not this subset - must be infinite.
- LOGGER.trace("cyclic: {}", this);
Review comment:
I am not sure if there's any. Note that the cycle detection code I
deleted here is already not working in this BFS implementation. It is left-over
dead code when we changed from DFS to BFS.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]