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.


---

Reply via email to