Hi:
The following snippet is cited from version 15.14, function 
check_outerjoin_delay()


2055:                        /* yes; have we included all its rels in relids? */
2056:                        if (!bms_is_subset(sjinfo->min_lefthand, 
relids) ||
2057:                              !bms_is_subset(sjinfo->min_righthand, 
relids))
2058:                        {
2059:                              /* no, so add them in */
2060:                              relids = bms_add_members(relids, 
sjinfo->min_lefthand);
2061:                              relids = bms_add_members(relids, 
sjinfo->min_righthand);
2062:                              outerjoin_delayed = true;
2063:                              /* we'll need another iteration */
2064:                              found_some = true;
2065:                        }
2066:                        /* track all the nullable rels of relevant OJs */
2067:                        nullable_relids = bms_add_members(nullable_relids,
2068:                                                                         
 sjinfo->min_righthand);
2069:                        if (sjinfo->jointype == JOIN_FULL)
2070:                              nullable_relids = 
bms_add_members(nullable_relids,
2071:                                                                           
     sjinfo->min_lefthand);
2072:                        /* set delay_upper_joins if needed */
2073:                        if (is_pushed_down && sjinfo->jointype 
!= JOIN_FULL &&
2074:                              bms_overlap(relids, sjinfo->min_lefthand))
2075:                              sjinfo->delay_upper_joins = true;


The check at line 2074 is redundant and can be safely removed. If relids 
doesn't initially include sjinfo->min_lefthand, then the condition at line 
2056 will be met, and relids will be augmented to include the whole 
sjinfo->min_lefthand at line 2060, making it overlap with 
sjinfo->min_lefthand; If relids does initially include 
sjinfo->min_lefthand,then it also overlap with sjinfo->min_lefthand. The 
condition at 2074 is gratified anyway, so this check is removale

Reply via email to