diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2003-11-09 21:30:38 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2003-11-09 21:30:38 +0000 |
commit | c1d62bfd00f4d1ea0647e12947ca1de9fea39b33 (patch) | |
tree | 1afdccb5267627182cab94b347730657107ad6eb /src/backend/access/rtree/rtscan.c | |
parent | 723825afebb6de7212fa18882bcc78212d5c1743 (diff) |
Add operator strategy and comparison-value datatype fields to ScanKey.
Remove the 'strategy map' code, which was a large amount of mechanism
that no longer had any use except reverse-mapping from procedure OID to
strategy number. Passing the strategy number to the index AM in the
first place is simpler and faster.
This is a preliminary step in planned support for cross-datatype index
operations. I'm committing it now since the ScanKeyEntryInitialize()
API change touches quite a lot of files, and I want to commit those
changes before the tree drifts under me.
Diffstat (limited to 'src/backend/access/rtree/rtscan.c')
-rw-r--r-- | src/backend/access/rtree/rtscan.c | 26 |
1 files changed, 17 insertions, 9 deletions
diff --git a/src/backend/access/rtree/rtscan.c b/src/backend/access/rtree/rtscan.c index f3329448d93..263fff4bf26 100644 --- a/src/backend/access/rtree/rtscan.c +++ b/src/backend/access/rtree/rtscan.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/access/rtree/Attic/rtscan.c,v 1.47 2003/08/04 02:39:57 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/access/rtree/Attic/rtscan.c,v 1.48 2003/11/09 21:30:35 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -17,7 +17,7 @@ #include "access/genam.h" #include "access/rtree.h" - +#include "utils/lsyscache.h" /* routines defined and used here */ @@ -71,7 +71,6 @@ rtrescan(PG_FUNCTION_ARGS) IndexScanDesc s = (IndexScanDesc) PG_GETARG_POINTER(0); ScanKey key = (ScanKey) PG_GETARG_POINTER(1); RTreeScanOpaque p; - RegProcedure internal_proc; int i; /* @@ -116,14 +115,23 @@ rtrescan(PG_FUNCTION_ARGS) */ for (i = 0; i < s->numberOfKeys; i++) { - internal_proc = RTMapOperator(s->indexRelation, - s->keyData[i].sk_attno, - s->keyData[i].sk_procedure); + AttrNumber attno = s->keyData[i].sk_attno; + Oid opclass; + StrategyNumber int_strategy; + Oid int_oper; + RegProcedure int_proc; + + opclass = s->indexRelation->rd_index->indclass[attno-1]; + int_strategy = RTMapToInternalOperator(s->keyData[i].sk_strategy); + int_oper = get_opclass_member(opclass, int_strategy); + int_proc = get_opcode(int_oper); ScanKeyEntryInitialize(&(p->s_internalKey[i]), s->keyData[i].sk_flags, - s->keyData[i].sk_attno, - internal_proc, - s->keyData[i].sk_argument); + attno, + int_strategy, + int_proc, + s->keyData[i].sk_argument, + s->keyData[i].sk_argtype); } } |