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

Function op_hashjoinable

src/backend/utils/cache/lsyscache.c:1580–1613  ·  view source on GitHub ↗

* op_hashjoinable * * Returns true if the operator is hashjoinable. (There must be a suitable * hash opfamily entry for this operator if it is so marked.) * * In some cases (currently only array_eq), hashjoinability depends on the * specific input data type the operator is invoked for, so that must be * passed as well. We currently assume that only one input's type is needed * to check t

Source from the content-addressed store, hash-verified

1578 * to check this --- by convention, pass the left input's data type.
1579 */
1580bool
1581op_hashjoinable(Oid opno, Oid inputtype)
1582{
1583 bool result = false;
1584 HeapTuple tp;
1585 TypeCacheEntry *typentry;
1586
1587 /* As in op_mergejoinable, let the typcache handle the hard cases */
1588 if (opno == ARRAY_EQ_OP)
1589 {
1590 typentry = lookup_type_cache(inputtype, TYPECACHE_HASH_PROC);
1591 if (typentry->hash_proc == F_HASH_ARRAY)
1592 result = true;
1593 }
1594 else if (opno == RECORD_EQ_OP)
1595 {
1596 typentry = lookup_type_cache(inputtype, TYPECACHE_HASH_PROC);
1597 if (typentry->hash_proc == F_HASH_RECORD)
1598 result = true;
1599 }
1600 else
1601 {
1602 /* For all other operators, rely on pg_operator.oprcanhash */
1603 tp = SearchSysCache1(OPEROID, ObjectIdGetDatum(opno));
1604 if (HeapTupleIsValid(tp))
1605 {
1606 Form_pg_operator optup = (Form_pg_operator) GETSTRUCT(tp);
1607
1608 result = optup->oprcanhash;
1609 ReleaseSysCache(tp);
1610 }
1611 }
1612 return result;
1613}
1614
1615/*
1616 * op_strict

Callers 8

std_typanalyzeFunction · 0.85
IsOpHashJoinableMethod · 0.85
addTargetToSortListFunction · 0.85
hash_ok_operatorFunction · 0.85
compute_semijoin_infoFunction · 0.85
check_hashjoinableFunction · 0.85

Calls 4

lookup_type_cacheFunction · 0.85
SearchSysCache1Function · 0.85
ObjectIdGetDatumFunction · 0.85
ReleaseSysCacheFunction · 0.85

Tested by

no test coverage detected