From f68f11928d5c791873073c882775dae10283ff49 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Fri, 29 Nov 2002 21:39:12 +0000 Subject: Tighten selection of equality and ordering operators for grouping operations: make sure we use operators that are compatible, as determined by a mergejoin link in pg_operator. Also, add code to planner to ensure we don't try to use hashed grouping when the grouping operators aren't marked hashable. --- src/backend/commands/analyze.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) (limited to 'src/backend/commands/analyze.c') diff --git a/src/backend/commands/analyze.c b/src/backend/commands/analyze.c index e15320225d..2af7a3cd7c 100644 --- a/src/backend/commands/analyze.c +++ b/src/backend/commands/analyze.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/commands/analyze.c,v 1.50 2002/11/13 00:39:46 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/commands/analyze.c,v 1.51 2002/11/29 21:39:10 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -402,10 +402,7 @@ examine_attribute(Relation onerel, int attnum) return NULL; /* If column has no "=" operator, we can't do much of anything */ - func_operator = compatible_oper(makeList1(makeString("=")), - attr->atttypid, - attr->atttypid, - true); + func_operator = equality_oper(attr->atttypid, true); if (func_operator != NULL) { oprrest = ((Form_pg_operator) GETSTRUCT(func_operator))->oprrest; @@ -443,10 +440,7 @@ examine_attribute(Relation onerel, int attnum) stats->attr->attstattarget = default_statistics_target; /* Is there a "<" operator with suitable semantics? */ - func_operator = compatible_oper(makeList1(makeString("<")), - attr->atttypid, - attr->atttypid, - true); + func_operator = ordering_oper(attr->atttypid, true); if (func_operator != NULL) { oprrest = ((Form_pg_operator) GETSTRUCT(func_operator))->oprrest; -- cgit v1.2.1