MCPcopy Create free account
hub / github.com/apache/cloudberry / RelationCacheInitialize

Function RelationCacheInitialize

src/backend/utils/cache/relcache.c:4084–4117  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4082#define INITRELCACHESIZE 400
4083
4084void
4085RelationCacheInitialize(void)
4086{
4087 HASHCTL ctl;
4088 int allocsize;
4089
4090 /*
4091 * make sure cache memory context exists
4092 */
4093 if (!CacheMemoryContext)
4094 CreateCacheMemoryContext();
4095
4096 /*
4097 * create hashtable that indexes the relcache
4098 */
4099 ctl.keysize = sizeof(Oid);
4100 ctl.entrysize = sizeof(RelIdCacheEnt);
4101 RelationIdCache = hash_create("Relcache by OID", INITRELCACHESIZE,
4102 &ctl, HASH_ELEM | HASH_BLOBS);
4103
4104 /*
4105 * reserve enough in_progress_list slots for many cases
4106 */
4107 allocsize = 4;
4108 in_progress_list =
4109 MemoryContextAlloc(CacheMemoryContext,
4110 allocsize * sizeof(*in_progress_list));
4111 in_progress_list_maxlen = allocsize;
4112
4113 /*
4114 * relation mapper needs to be initialized too
4115 */
4116 RelationMapInitialize();
4117}
4118
4119/*
4120 * RelationCacheInitializePhase2

Callers 2

InitPostgresFunction · 0.85

Calls 4

CreateCacheMemoryContextFunction · 0.85
hash_createFunction · 0.85
MemoryContextAllocFunction · 0.85
RelationMapInitializeFunction · 0.85

Tested by

no test coverage detected