*/
#ifdef CACHEDEBUG
-#define CACHE1_elog(a,b) elog(a,b)
-#define CACHE2_elog(a,b,c) elog(a,b,c)
-#define CACHE3_elog(a,b,c,d) elog(a,b,c,d)
-#define CACHE4_elog(a,b,c,d,e) elog(a,b,c,d,e)
-#define CACHE5_elog(a,b,c,d,e,f) elog(a,b,c,d,e,f)
-#define CACHE6_elog(a,b,c,d,e,f,g) elog(a,b,c,d,e,f,g)
+#define CACHE_elog(...) elog(__VA_ARGS__)
#else
-#define CACHE1_elog(a,b)
-#define CACHE2_elog(a,b,c)
-#define CACHE3_elog(a,b,c,d)
-#define CACHE4_elog(a,b,c,d,e)
-#define CACHE5_elog(a,b,c,d,e,f)
-#define CACHE6_elog(a,b,c,d,e,f,g)
+#define CACHE_elog(...)
#endif
/* Cache management header --- pointer is NULL until created */
uint32 oneHash;
CCHashFN *cc_hashfunc = cache->cc_hashfunc;
- CACHE4_elog(DEBUG2, "CatalogCacheComputeHashValue %s %d %p",
- cache->cc_relname,
- nkeys,
- cache);
+ CACHE_elog(DEBUG2, "CatalogCacheComputeHashValue %s %d %p",
+ cache->cc_relname, nkeys, cache);
switch (nkeys)
{
Index hashIndex;
dlist_mutable_iter iter;
- CACHE1_elog(DEBUG2, "CatCacheInvalidate: called");
+ CACHE_elog(DEBUG2, "CatCacheInvalidate: called");
/*
* We don't bother to check whether the cache has finished initialization
}
else
CatCacheRemoveCTup(cache, ct);
- CACHE1_elog(DEBUG2, "CatCacheInvalidate: invalidated");
+ CACHE_elog(DEBUG2, "CatCacheInvalidate: invalidated");
#ifdef CATCACHE_STATS
cache->cc_invals++;
#endif
{
slist_iter iter;
- CACHE1_elog(DEBUG2, "ResetCatalogCaches called");
+ CACHE_elog(DEBUG2, "ResetCatalogCaches called");
slist_foreach(iter, &CacheHdr->ch_caches)
{
ResetCatalogCache(cache);
}
- CACHE1_elog(DEBUG2, "end of ResetCatalogCaches call");
+ CACHE_elog(DEBUG2, "end of ResetCatalogCaches call");
}
/*
{
slist_iter iter;
- CACHE2_elog(DEBUG2, "CatalogCacheFlushCatalog called for %u", catId);
+ CACHE_elog(DEBUG2, "CatalogCacheFlushCatalog called for %u", catId);
slist_foreach(iter, &CacheHdr->ch_caches)
{
}
}
- CACHE1_elog(DEBUG2, "end of CatalogCacheFlushCatalog call");
+ CACHE_elog(DEBUG2, "end of CatalogCacheFlushCatalog call");
}
/*
table_close(relation, AccessShareLock);
- CACHE3_elog(DEBUG2, "CatalogCacheInitializeCache: %s, %d keys",
- cache->cc_relname, cache->cc_nkeys);
+ CACHE_elog(DEBUG2, "CatalogCacheInitializeCache: %s, %d keys",
+ cache->cc_relname, cache->cc_nkeys);
/*
* initialize cache's key information
/* If a catcache key requires a collation, it must be C collation */
cache->cc_skey[i].sk_collation = C_COLLATION_OID;
- CACHE4_elog(DEBUG2, "CatalogCacheInitializeCache %s %d %p",
- cache->cc_relname,
- i,
- cache);
+ CACHE_elog(DEBUG2, "CatalogCacheInitializeCache %s %d %p",
+ cache->cc_relname, i, cache);
}
/*
ct->refcount++;
ResourceOwnerRememberCatCacheRef(CurrentResourceOwner, &ct->tuple);
- CACHE3_elog(DEBUG2, "SearchCatCache(%s): found in bucket %d",
- cache->cc_relname, hashIndex);
+ CACHE_elog(DEBUG2, "SearchCatCache(%s): found in bucket %d",
+ cache->cc_relname, hashIndex);
#ifdef CATCACHE_STATS
cache->cc_hits++;
}
else
{
- CACHE3_elog(DEBUG2, "SearchCatCache(%s): found neg entry in bucket %d",
- cache->cc_relname, hashIndex);
+ CACHE_elog(DEBUG2, "SearchCatCache(%s): found neg entry in bucket %d",
+ cache->cc_relname, hashIndex);
#ifdef CATCACHE_STATS
cache->cc_neg_hits++;
hashValue, hashIndex,
true);
- CACHE4_elog(DEBUG2, "SearchCatCache(%s): Contains %d/%d tuples",
- cache->cc_relname, cache->cc_ntup, CacheHdr->ch_ntup);
- CACHE3_elog(DEBUG2, "SearchCatCache(%s): put neg entry in bucket %d",
- cache->cc_relname, hashIndex);
+ CACHE_elog(DEBUG2, "SearchCatCache(%s): Contains %d/%d tuples",
+ cache->cc_relname, cache->cc_ntup, CacheHdr->ch_ntup);
+ CACHE_elog(DEBUG2, "SearchCatCache(%s): put neg entry in bucket %d",
+ cache->cc_relname, hashIndex);
/*
* We are not returning the negative entry to the caller, so leave its
return NULL;
}
- CACHE4_elog(DEBUG2, "SearchCatCache(%s): Contains %d/%d tuples",
- cache->cc_relname, cache->cc_ntup, CacheHdr->ch_ntup);
- CACHE3_elog(DEBUG2, "SearchCatCache(%s): put in bucket %d",
- cache->cc_relname, hashIndex);
+ CACHE_elog(DEBUG2, "SearchCatCache(%s): Contains %d/%d tuples",
+ cache->cc_relname, cache->cc_ntup, CacheHdr->ch_ntup);
+ CACHE_elog(DEBUG2, "SearchCatCache(%s): put in bucket %d",
+ cache->cc_relname, hashIndex);
#ifdef CATCACHE_STATS
cache->cc_newloads++;
cl->refcount++;
ResourceOwnerRememberCatCacheListRef(CurrentResourceOwner, cl);
- CACHE2_elog(DEBUG2, "SearchCatCacheList(%s): found list",
- cache->cc_relname);
+ CACHE_elog(DEBUG2, "SearchCatCacheList(%s): found list",
+ cache->cc_relname);
#ifdef CATCACHE_STATS
cache->cc_lhits++;
cl->refcount++;
ResourceOwnerRememberCatCacheListRef(CurrentResourceOwner, cl);
- CACHE3_elog(DEBUG2, "SearchCatCacheList(%s): made list of %d members",
- cache->cc_relname, nmembers);
+ CACHE_elog(DEBUG2, "SearchCatCacheList(%s): made list of %d members",
+ cache->cc_relname, nmembers);
return cl;
}
slist_iter iter;
Oid reloid;
- CACHE1_elog(DEBUG2, "PrepareToInvalidateCacheTuple: called");
+ CACHE_elog(DEBUG2, "PrepareToInvalidateCacheTuple: called");
/*
* sanity checks