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

Function build_implied_join_equality

src/backend/optimizer/plan/initsplan.c:2792–2836  ·  view source on GitHub ↗

* build_implied_join_equality --- build a RestrictInfo for a derived equality * * This overlaps the functionality of process_implied_equality(), but we * must not push the RestrictInfo into the joininfo tree. * * Note: this function will copy item1 and item2, but it is caller's * responsibility to make sure that the Relids parameters are fresh copies * not shared with other uses. * * Note

Source from the content-addressed store, hash-verified

2790 * caller's responsibility that left_ec/right_ec be set as necessary.
2791 */
2792RestrictInfo *
2793build_implied_join_equality(PlannerInfo *root,
2794 Oid opno,
2795 Oid collation,
2796 Expr *item1,
2797 Expr *item2,
2798 Relids qualscope,
2799 Relids nullable_relids,
2800 Index security_level)
2801{
2802 RestrictInfo *restrictinfo;
2803 Expr *clause;
2804
2805 /*
2806 * Build the new clause. Copy to ensure it shares no substructure with
2807 * original (this is necessary in case there are subselects in there...)
2808 */
2809 clause = make_opclause(opno,
2810 BOOLOID, /* opresulttype */
2811 false, /* opretset */
2812 copyObject(item1),
2813 copyObject(item2),
2814 InvalidOid,
2815 collation);
2816
2817 /*
2818 * Build the RestrictInfo node itself.
2819 */
2820 restrictinfo = make_restrictinfo(root,
2821 clause,
2822 true, /* is_pushed_down */
2823 false, /* outerjoin_delayed */
2824 false, /* pseudoconstant */
2825 security_level, /* security_level */
2826 qualscope, /* required_relids */
2827 NULL, /* outer_relids */
2828 nullable_relids); /* nullable_relids */
2829
2830 /* Set mergejoinability/hashjoinability flags */
2831 check_mergejoinable(restrictinfo);
2832 check_hashjoinable(restrictinfo);
2833 check_memoizable(restrictinfo);
2834
2835 return restrictinfo;
2836}
2837
2838
2839/*

Callers 3

create_join_clauseFunction · 0.85

Calls 5

make_opclauseFunction · 0.85
make_restrictinfoFunction · 0.85
check_mergejoinableFunction · 0.85
check_hashjoinableFunction · 0.85
check_memoizableFunction · 0.85

Tested by

no test coverage detected