From c1d62bfd00f4d1ea0647e12947ca1de9fea39b33 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Sun, 9 Nov 2003 21:30:38 +0000 Subject: 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. --- src/backend/access/gist/gistget.c | 22 ++++++---------------- 1 file changed, 6 insertions(+), 16 deletions(-) (limited to 'src/backend/access/gist/gistget.c') diff --git a/src/backend/access/gist/gistget.c b/src/backend/access/gist/gistget.c index bfa557bb9c..24168c9926 100644 --- a/src/backend/access/gist/gistget.c +++ b/src/backend/access/gist/gistget.c @@ -8,7 +8,7 @@ * Portions Copyright (c) 1994, Regents of the University of California * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/access/gist/gistget.c,v 1.36 2003/08/04 02:39:57 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/access/gist/gistget.c,v 1.37 2003/11/09 21:30:35 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -249,26 +249,16 @@ gistindex_keytest(IndexTuple tuple, IndexTupleSize(tuple) - sizeof(IndexTupleData), FALSE, isNull); - if (key[0].sk_flags & SK_COMMUTE) - { - test = FunctionCall3(&key[0].sk_func, - key[0].sk_argument, - PointerGetDatum(&de), - ObjectIdGetDatum(key[0].sk_procedure)); - } - else - { - test = FunctionCall3(&key[0].sk_func, - PointerGetDatum(&de), - key[0].sk_argument, - ObjectIdGetDatum(key[0].sk_procedure)); - } + test = FunctionCall3(&key[0].sk_func, + PointerGetDatum(&de), + key[0].sk_argument, + Int32GetDatum(key[0].sk_strategy)); if (de.key != datum && !isAttByVal(giststate, key[0].sk_attno - 1)) if (DatumGetPointer(de.key) != NULL) pfree(DatumGetPointer(de.key)); - if (DatumGetBool(test) == !!(key[0].sk_flags & SK_NEGATE)) + if (!DatumGetBool(test)) return false; scanKeySize--; -- cgit v1.2.1