mirror of
https://github.com/postgres/postgres.git
synced 2025-06-11 20:28:21 +03:00
Add support for cross-type hashing in hash index searches and hash joins.
Hashing for aggregation purposes still needs work, so it's not time to mark any cross-type operators as hashable for general use, but these cases work if the operators are so marked by hand in the system catalogs.
This commit is contained in:
@ -7,7 +7,7 @@
|
||||
* Portions Copyright (c) 1994, Regents of the University of California
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $PostgreSQL: pgsql/src/backend/executor/nodeSubplan.c,v 1.82 2007/01/05 22:19:28 momjian Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/executor/nodeSubplan.c,v 1.83 2007/01/30 01:33:36 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -792,7 +792,8 @@ ExecInitSubPlan(SubPlanState *node, EState *estate, int eflags)
|
||||
Expr *expr;
|
||||
TargetEntry *tle;
|
||||
GenericExprState *tlestate;
|
||||
Oid hashfn;
|
||||
Oid left_hashfn;
|
||||
Oid right_hashfn;
|
||||
|
||||
Assert(IsA(fstate, FuncExprState));
|
||||
Assert(IsA(opexpr, OpExpr));
|
||||
@ -830,12 +831,14 @@ ExecInitSubPlan(SubPlanState *node, EState *estate, int eflags)
|
||||
fmgr_info(opexpr->opfuncid, &node->eqfunctions[i - 1]);
|
||||
node->eqfunctions[i - 1].fn_expr = (Node *) opexpr;
|
||||
|
||||
/* Lookup the associated hash function */
|
||||
hashfn = get_op_hash_function(opexpr->opno);
|
||||
if (!OidIsValid(hashfn))
|
||||
/* Lookup the associated hash functions */
|
||||
if (!get_op_hash_functions(opexpr->opno,
|
||||
&left_hashfn, &right_hashfn))
|
||||
elog(ERROR, "could not find hash function for hash operator %u",
|
||||
opexpr->opno);
|
||||
fmgr_info(hashfn, &node->hashfunctions[i - 1]);
|
||||
/* For the moment, not supporting cross-type cases */
|
||||
Assert(left_hashfn == right_hashfn);
|
||||
fmgr_info(right_hashfn, &node->hashfunctions[i - 1]);
|
||||
|
||||
i++;
|
||||
}
|
||||
|
Reference in New Issue
Block a user