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/utils/cache/lsyscache.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/utils/cache/lsyscache.c')
-rw-r--r-- | src/backend/utils/cache/lsyscache.c | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/src/backend/utils/cache/lsyscache.c b/src/backend/utils/cache/lsyscache.c index 992be3ca4e3..bed4fcdbce6 100644 --- a/src/backend/utils/cache/lsyscache.c +++ b/src/backend/utils/cache/lsyscache.c @@ -7,7 +7,7 @@ * Portions Copyright (c) 1994, Regents of the University of California * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/utils/cache/lsyscache.c,v 1.108 2003/10/04 18:22:59 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/utils/cache/lsyscache.c,v 1.109 2003/11/09 21:30:37 tgl Exp $ * * NOTES * Eventually, the index information should go through here, too. @@ -53,21 +53,20 @@ op_in_opclass(Oid opno, Oid opclass) } /* - * op_requires_recheck + * get_op_opclass_properties * - * Return t if operator 'opno' requires a recheck when used as a - * member of opclass 'opclass' (ie, this opclass is lossy for this - * operator). + * Get the operator's strategy number and recheck (lossy) flag + * within the specified opclass. * * Caller should already have verified that opno is a member of opclass, * therefore we raise an error if the tuple is not found. */ -bool -op_requires_recheck(Oid opno, Oid opclass) +void +get_op_opclass_properties(Oid opno, Oid opclass, + int *strategy, bool *recheck) { HeapTuple tp; Form_pg_amop amop_tup; - bool result; tp = SearchSysCache(AMOPOPID, ObjectIdGetDatum(opno), @@ -77,10 +76,9 @@ op_requires_recheck(Oid opno, Oid opclass) elog(ERROR, "operator %u is not a member of opclass %u", opno, opclass); amop_tup = (Form_pg_amop) GETSTRUCT(tp); - - result = amop_tup->amopreqcheck; + *strategy = amop_tup->amopstrategy; + *recheck = amop_tup->amopreqcheck; ReleaseSysCache(tp); - return result; } /* |