You are viewing a plain text version of this content. The canonical link for it is here.
Posted to codereview@trafodion.apache.org by zellerh <gi...@git.apache.org> on 2018/06/19 15:39:08 UTC

[GitHub] trafodion pull request #1581: [TRAFODION-2901] Self-reference Holloween prob...

Github user zellerh commented on a diff in the pull request:

    https://github.com/apache/trafodion/pull/1581#discussion_r196474928
  
    --- Diff: core/sql/optimizer/RelExpr.cpp ---
    @@ -13341,6 +13341,36 @@ void GenericUpdate::pushdownCoveredExpr(const ValueIdSet &outputExpr,
     				newExternalInputs,
     				predicatesOnParent,
     				&localExprs);
    +
    +  if (avoidHalloween() && child(0) &&
    +      child(0)->getOperatorType() == REL_SCAN &&
    +      child(0)->getGroupAttr())
    +    {
    +      ValueIdSet cur_output = child(0)->getGroupAttr()->getCharacteristicOutputs();
    --- End diff --
    
    This works, but is is not very efficient to create a copy of a ValueIdSet just to check whether it is empty. You could just check
    
    ```
    if (child(0)->getGroupAttr()->getCharacteristicOutputs().isEmpty())
    ```
    in the line below.


---