mirror of
https://github.com/postgres/postgres.git
synced 2025-07-02 09:02:37 +03:00
Create a 'type cache' that keeps track of the data needed for any particular
datatype by array_eq and array_cmp; use this to solve problems with memory leaks in array indexing support. The parser's equality_oper and ordering_oper routines also use the cache. Change the operator search algorithms to look for appropriate btree or hash index opclasses, instead of assuming operators named '<' or '=' have the right semantics. (ORDER BY ASC/DESC now also look at opclasses, instead of assuming '<' and '>' are the right things.) Add several more index opclasses so that there is no regression in functionality for base datatypes. initdb forced due to catalog additions.
This commit is contained in:
@ -8,7 +8,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/commands/analyze.c,v 1.58 2003/08/04 02:39:58 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/commands/analyze.c,v 1.59 2003/08/17 19:58:04 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -390,7 +390,6 @@ examine_attribute(Relation onerel, int attnum)
|
||||
{
|
||||
Form_pg_attribute attr = onerel->rd_att->attrs[attnum - 1];
|
||||
Operator func_operator;
|
||||
Oid oprrest;
|
||||
HeapTuple typtuple;
|
||||
Oid eqopr = InvalidOid;
|
||||
Oid eqfunc = InvalidOid;
|
||||
@ -409,12 +408,8 @@ examine_attribute(Relation onerel, int attnum)
|
||||
func_operator = equality_oper(attr->atttypid, true);
|
||||
if (func_operator != NULL)
|
||||
{
|
||||
oprrest = ((Form_pg_operator) GETSTRUCT(func_operator))->oprrest;
|
||||
if (oprrest == F_EQSEL)
|
||||
{
|
||||
eqopr = oprid(func_operator);
|
||||
eqfunc = oprfuncid(func_operator);
|
||||
}
|
||||
eqopr = oprid(func_operator);
|
||||
eqfunc = oprfuncid(func_operator);
|
||||
ReleaseSysCache(func_operator);
|
||||
}
|
||||
if (!OidIsValid(eqfunc))
|
||||
@ -447,9 +442,7 @@ examine_attribute(Relation onerel, int attnum)
|
||||
func_operator = ordering_oper(attr->atttypid, true);
|
||||
if (func_operator != NULL)
|
||||
{
|
||||
oprrest = ((Form_pg_operator) GETSTRUCT(func_operator))->oprrest;
|
||||
if (oprrest == F_SCALARLTSEL)
|
||||
ltopr = oprid(func_operator);
|
||||
ltopr = oprid(func_operator);
|
||||
ReleaseSysCache(func_operator);
|
||||
}
|
||||
stats->ltopr = ltopr;
|
||||
|
Reference in New Issue
Block a user