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/optimizer/plan/createplan.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/optimizer/plan/createplan.c')
-rw-r--r-- | src/backend/optimizer/plan/createplan.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/src/backend/optimizer/plan/createplan.c b/src/backend/optimizer/plan/createplan.c index 36f22c881c8..fdaed3d472e 100644 --- a/src/backend/optimizer/plan/createplan.c +++ b/src/backend/optimizer/plan/createplan.c @@ -10,7 +10,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/optimizer/plan/createplan.c,v 1.223 2007/01/22 01:35:20 tgl Exp $ + * $PostgreSQL: pgsql/src/backend/optimizer/plan/createplan.c,v 1.224 2007/01/30 01:33:36 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -716,10 +716,10 @@ create_unique_plan(PlannerInfo *root, UniquePath *best_path) numGroups = (long) Min(best_path->rows, (double) LONG_MAX); /* - * Get the (presumed hashable) equality operators for the Agg node - * to use. Normally these are the same as the IN clause operators, - * but if those are cross-type operators then the equality operators - * are the ones for the IN clause operators' RHS datatype. + * Get the hashable equality operators for the Agg node to use. + * Normally these are the same as the IN clause operators, but if + * those are cross-type operators then the equality operators are + * the ones for the IN clause operators' RHS datatype. */ groupOperators = (Oid *) palloc(numGroupCols * sizeof(Oid)); groupColPos = 0; @@ -728,8 +728,7 @@ create_unique_plan(PlannerInfo *root, UniquePath *best_path) Oid in_oper = lfirst_oid(l); Oid eq_oper; - eq_oper = get_compatible_hash_operator(in_oper, false); - if (!OidIsValid(eq_oper)) /* shouldn't happen */ + if (!get_compatible_hash_operators(in_oper, NULL, &eq_oper)) elog(ERROR, "could not find compatible hash operator for operator %u", in_oper); groupOperators[groupColPos++] = eq_oper; |