diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2007-01-30 01:33:36 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2007-01-30 01:33:36 +0000 |
commit | a635c08fa10fe545d723bcec6eb73bfdca07e2c0 (patch) | |
tree | 83ac01972011232d6841e60cd830fe34ac2463d5 /src/backend/executor/nodeSubplan.c | |
parent | e8cd6f14a26bbecd3d8abcf36235a033cb035678 (diff) | |
download | postgresql-a635c08fa10fe545d723bcec6eb73bfdca07e2c0.tar.gz postgresql-a635c08fa10fe545d723bcec6eb73bfdca07e2c0.zip |
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.
Diffstat (limited to 'src/backend/executor/nodeSubplan.c')
-rw-r--r-- | src/backend/executor/nodeSubplan.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/src/backend/executor/nodeSubplan.c b/src/backend/executor/nodeSubplan.c index c2d4dbea37a..c5c35697c0b 100644 --- a/src/backend/executor/nodeSubplan.c +++ b/src/backend/executor/nodeSubplan.c @@ -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++; } |