MCPcopy Create free account
hub / github.com/apache/cloudberry / calc_nestloop_required_outer

Function calc_nestloop_required_outer

src/backend/optimizer/util/pathnode.c:3804–3829  ·  view source on GitHub ↗

* calc_nestloop_required_outer * Compute the required_outer set for a nestloop join path * * Note: result must not share storage with either input */

Source from the content-addressed store, hash-verified

3802 * Note: result must not share storage with either input
3803 */
3804Relids
3805calc_nestloop_required_outer(Relids outerrelids,
3806 Relids outer_paramrels,
3807 Relids innerrelids,
3808 Relids inner_paramrels)
3809{
3810 Relids required_outer;
3811
3812 /* inner_path can require rels from outer path, but not vice versa */
3813 Assert(!bms_overlap(outer_paramrels, innerrelids));
3814 /* easy case if inner path is not parameterized */
3815 if (!inner_paramrels)
3816 return bms_copy(outer_paramrels);
3817 /* else, form the union ... */
3818 required_outer = bms_union(outer_paramrels, inner_paramrels);
3819 /* ... and remove any mention of now-satisfied outer rels */
3820 required_outer = bms_del_members(required_outer,
3821 outerrelids);
3822 /* maintain invariant that required_outer is exactly NULL if empty */
3823 if (bms_is_empty(required_outer))
3824 {
3825 bms_free(required_outer);
3826 required_outer = NULL;
3827 }
3828 return required_outer;
3829}
3830
3831/*
3832 * calc_non_nestloop_required_outer

Callers 1

try_nestloop_pathFunction · 0.85

Calls 6

bms_overlapFunction · 0.85
bms_copyFunction · 0.85
bms_unionFunction · 0.85
bms_del_membersFunction · 0.85
bms_is_emptyFunction · 0.85
bms_freeFunction · 0.85

Tested by

no test coverage detected