mirror of
https://github.com/postgres/postgres.git
synced 2025-07-02 09:02:37 +03:00
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.
This commit is contained in:
@ -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;
|
||||
|
Reference in New Issue
Block a user