diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2006-12-23 00:43:13 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2006-12-23 00:43:13 +0000 |
commit | a78fcfb5124379532ce35f3076679f04bd987d60 (patch) | |
tree | 345204410d4f015a9d20ff55ecc38de3d371c459 /src/backend/executor/nodeIndexscan.c | |
parent | d31ccb6c3e73901c44865bfce3f5dd20774f7a89 (diff) | |
download | postgresql-a78fcfb5124379532ce35f3076679f04bd987d60.tar.gz postgresql-a78fcfb5124379532ce35f3076679f04bd987d60.zip |
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.
Diffstat (limited to 'src/backend/executor/nodeIndexscan.c')
-rw-r--r-- | src/backend/executor/nodeIndexscan.c | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/src/backend/executor/nodeIndexscan.c b/src/backend/executor/nodeIndexscan.c index 9773f2341ec..4371fc1a280 100644 --- a/src/backend/executor/nodeIndexscan.c +++ b/src/backend/executor/nodeIndexscan.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/executor/nodeIndexscan.c,v 1.117 2006/10/04 00:29:52 momjian Exp $ + * $PostgreSQL: pgsql/src/backend/executor/nodeIndexscan.c,v 1.118 2006/12/23 00:43:09 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -797,9 +797,10 @@ ExecIndexBuildScanKeys(PlanState *planstate, Relation index, int flags = SK_ROW_MEMBER; Datum scanvalue; Oid opno; - Oid opclass; + Oid opfamily; int op_strategy; - Oid op_subtype; + Oid op_lefttype; + Oid op_righttype; bool op_recheck; /* @@ -857,15 +858,21 @@ ExecIndexBuildScanKeys(PlanState *planstate, Relation index, if (index->rd_rel->relam != BTREE_AM_OID || varattno < 1 || varattno > index->rd_index->indnatts) elog(ERROR, "bogus RowCompare index qualification"); - opclass = index->rd_indclass->values[varattno - 1]; + opfamily = index->rd_opfamily[varattno - 1]; - get_op_opclass_properties(opno, opclass, - &op_strategy, &op_subtype, &op_recheck); + get_op_opfamily_properties(opno, opfamily, + &op_strategy, + &op_lefttype, + &op_righttype, + &op_recheck); if (op_strategy != rc->rctype) elog(ERROR, "RowCompare index qualification contains wrong operator"); - opfuncid = get_opclass_proc(opclass, op_subtype, BTORDER_PROC); + opfuncid = get_opfamily_proc(opfamily, + op_lefttype, + op_righttype, + BTORDER_PROC); /* * initialize the subsidiary scan key's fields appropriately @@ -874,7 +881,7 @@ ExecIndexBuildScanKeys(PlanState *planstate, Relation index, flags, varattno, /* attribute number */ op_strategy, /* op's strategy */ - op_subtype, /* strategy subtype */ + op_righttype, /* strategy subtype */ opfuncid, /* reg proc to use */ scanvalue); /* constant */ extra_scan_keys++; |