diff options
author | Tom Lane | 2003-11-09 21:30:38 +0000 |
---|---|---|
committer | Tom Lane | 2003-11-09 21:30:38 +0000 |
commit | c1d62bfd00f4d1ea0647e12947ca1de9fea39b33 (patch) | |
tree | 1afdccb5267627182cab94b347730657107ad6eb /src/backend/utils/cache/catcache.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/catcache.c')
-rw-r--r-- | src/backend/utils/cache/catcache.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/backend/utils/cache/catcache.c b/src/backend/utils/cache/catcache.c index f8363265de9..640629c3a04 100644 --- a/src/backend/utils/cache/catcache.c +++ b/src/backend/utils/cache/catcache.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/utils/cache/catcache.c,v 1.108 2003/08/04 02:40:06 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/utils/cache/catcache.c,v 1.109 2003/11/09 21:30:37 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -937,6 +937,7 @@ CatalogCacheInitializeCache(CatCache *cache) for (i = 0; i < cache->cc_nkeys; ++i) { Oid keytype; + RegProcedure eqfunc; CatalogCacheInitializeCache_DEBUG2; @@ -951,7 +952,7 @@ CatalogCacheInitializeCache(CatCache *cache) GetCCHashEqFuncs(keytype, &cache->cc_hashfunc[i], - &cache->cc_skey[i].sk_procedure); + &eqfunc); cache->cc_isname[i] = (keytype == NAMEOID); @@ -959,13 +960,17 @@ CatalogCacheInitializeCache(CatCache *cache) * Do equality-function lookup (we assume this won't need a * catalog lookup for any supported type) */ - fmgr_info_cxt(cache->cc_skey[i].sk_procedure, + fmgr_info_cxt(eqfunc, &cache->cc_skey[i].sk_func, CacheMemoryContext); /* Initialize sk_attno suitably for HeapKeyTest() and heap scans */ cache->cc_skey[i].sk_attno = cache->cc_key[i]; + /* Fill in sk_strategy and sk_argtype correctly as well */ + cache->cc_skey[i].sk_strategy = BTEqualStrategyNumber; + cache->cc_skey[i].sk_argtype = keytype; + CACHE4_elog(DEBUG2, "CatalogCacheInit %s %d %p", cache->cc_relname, i, |