You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "ASF GitHub Bot (Jira)" <ji...@apache.org> on 2023/03/07 13:51:00 UTC
[jira] [Updated] (CALCITE-5563) Add a break to the inner loop of RelSubset#getParents and RelSubset#getParentSubsets after we find a matching Relsubset from its parent input
[ https://issues.apache.org/jira/browse/CALCITE-5563?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
ASF GitHub Bot updated CALCITE-5563:
------------------------------------
Labels: pull-request-available (was: )
> Add a break to the inner loop of RelSubset#getParents and RelSubset#getParentSubsets after we find a matching Relsubset from its parent input
> ---------------------------------------------------------------------------------------------------------------------------------------------
>
> Key: CALCITE-5563
> URL: https://issues.apache.org/jira/browse/CALCITE-5563
> Project: Calcite
> Issue Type: Improvement
> Components: core
> Reporter: asdfgh19
> Assignee: asdfgh19
> Priority: Minor
> Labels: pull-request-available
> Fix For: 1.34.0
>
> Time Spent: 10m
> Remaining Estimate: 0h
>
>
> {code:java}
> /**
> * Returns the collection of RelNodes one of whose inputs is in this
> * subset.
> */
> Set<RelNode> getParents() {
> final Set<RelNode> list = new LinkedHashSet<>();
> for (RelNode parent : set.getParentRels()) {
> for (RelSubset rel : inputSubsets(parent)) {
> // see usage of this method in propagateCostImprovements0()
> if (rel == this) {
> list.add(parent);
> break;
> }
> }
> }
> return list;
> }
> /**
> * Returns the collection of distinct subsets that contain a RelNode one
> * of whose inputs is in this subset.
> */
> Set<RelSubset> getParentSubsets(VolcanoPlanner planner) {
> final Set<RelSubset> list = new LinkedHashSet<>();
> for (RelNode parent : set.getParentRels()) {
> for (RelSubset rel : inputSubsets(parent)) {
> if (rel.set == set && rel.getTraitSet().equals(traitSet)) {
> list.add(planner.getSubsetNonNull(parent));
> break;
> }
> }
> }
> return list;
> }{code}
>
> Once we have found a matching Relsubset from its parent input, we can immediately end the inner loop.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)