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/utils/cache/catcache.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'src/backend/utils/cache/catcache.c') diff --git a/src/backend/utils/cache/catcache.c b/src/backend/utils/cache/catcache.c index f8363265de..640629c3a0 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, -- cgit v1.2.1