mirror of
https://github.com/postgres/postgres.git
synced 2025-06-13 07:41:39 +03:00
Restructure operator classes to allow improved handling of cross-data-type
cases. Operator classes now exist within "operator families". While most families are equivalent to a single class, related classes can be grouped into one family to represent the fact that they are semantically compatible. Cross-type operators are now naturally adjunct parts of a family, without having to wedge them into a particular opclass as we had done originally. This commit restructures the catalogs and cleans up enough of the fallout so that everything still works at least as well as before, but most of the work needed to actually improve the planner's behavior will come later. Also, there are not yet CREATE/DROP/ALTER OPERATOR FAMILY commands; the only way to create a new family right now is to allow CREATE OPERATOR CLASS to make one by default. I owe some more documentation work, too. But that can all be done in smaller pieces once this infrastructure is in place.
This commit is contained in:
@ -8,7 +8,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $PostgreSQL: pgsql/src/backend/executor/execQual.c,v 1.200 2006/12/21 16:05:13 petere Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/executor/execQual.c,v 1.201 2006/12/23 00:43:09 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -3700,21 +3700,28 @@ ExecInitExpr(Expr *node, PlanState *parent)
|
||||
outlist = lappend(outlist, estate);
|
||||
}
|
||||
rstate->rargs = outlist;
|
||||
Assert(list_length(rcexpr->opclasses) == nopers);
|
||||
Assert(list_length(rcexpr->opfamilies) == nopers);
|
||||
rstate->funcs = (FmgrInfo *) palloc(nopers * sizeof(FmgrInfo));
|
||||
i = 0;
|
||||
forboth(l, rcexpr->opnos, l2, rcexpr->opclasses)
|
||||
forboth(l, rcexpr->opnos, l2, rcexpr->opfamilies)
|
||||
{
|
||||
Oid opno = lfirst_oid(l);
|
||||
Oid opclass = lfirst_oid(l2);
|
||||
Oid opfamily = lfirst_oid(l2);
|
||||
int strategy;
|
||||
Oid subtype;
|
||||
Oid lefttype;
|
||||
Oid righttype;
|
||||
bool recheck;
|
||||
Oid proc;
|
||||
|
||||
get_op_opclass_properties(opno, opclass,
|
||||
&strategy, &subtype, &recheck);
|
||||
proc = get_opclass_proc(opclass, subtype, BTORDER_PROC);
|
||||
get_op_opfamily_properties(opno, opfamily,
|
||||
&strategy,
|
||||
&lefttype,
|
||||
&righttype,
|
||||
&recheck);
|
||||
proc = get_opfamily_proc(opfamily,
|
||||
lefttype,
|
||||
righttype,
|
||||
BTORDER_PROC);
|
||||
|
||||
/*
|
||||
* If we enforced permissions checks on index support
|
||||
|
Reference in New Issue
Block a user