PostgreSQL Source Code
git master
|
#include "access/htup.h"
#include "access/skey.h"
#include "lib/ilist.h"
#include "utils/relcache.h"
Go to the source code of this file.
Data Structures | |
struct | catcache |
struct | catctup |
struct | catclist |
struct | catcacheheader |
Macros | |
#define | CATCACHE_MAXKEYS 4 |
#define | CT_MAGIC 0x57261502 |
#define | CL_MAGIC 0x52765103 |
Typedefs | |
typedef uint32(* | CCHashFN) (Datum datum) |
typedef bool(* | CCFastEqualFN) (Datum a, Datum b) |
typedef struct catcache | CatCache |
typedef struct catctup | CatCTup |
typedef struct catclist | CatCList |
typedef struct catcacheheader | CatCacheHeader |
Variables | |
PGDLLIMPORT MemoryContext | CacheMemoryContext |
#define CATCACHE_MAXKEYS 4 |
Definition at line 35 of file catcache.h.
Referenced by SearchCatCacheInternal(), SearchCatCacheList(), and SearchCatCacheMiss().
#define CL_MAGIC 0x52765103 |
Definition at line 160 of file catcache.h.
Referenced by ReleaseCatCacheList(), and SearchCatCacheList().
#define CT_MAGIC 0x57261502 |
Definition at line 89 of file catcache.h.
Referenced by CatalogCacheCreateEntry(), PrintCatCacheLeakWarning(), and ReleaseCatCache().
typedef struct catcacheheader CatCacheHeader |
Definition at line 42 of file catcache.h.
Definition at line 39 of file catcache.h.
void CatalogCacheFlushCatalog | ( | Oid | catId | ) |
Definition at line 719 of file catcache.c.
References CACHE_elog, CallSyscacheCallbacks(), catcache::cc_reloid, catcacheheader::ch_caches, slist_iter::cur, DEBUG2, catcache::id, ResetCatalogCache(), slist_container, and slist_foreach.
Referenced by LocalExecuteInvalidationMessage().
Definition at line 552 of file catcache.c.
References Assert, catctup::c_list, CACHE_elog, CatCacheRemoveCList(), CatCacheRemoveCTup(), catcache::cc_bucket, catcache::cc_lists, catcache::cc_nbuckets, dlist_mutable_iter::cur, catctup::dead, catclist::dead, DEBUG2, dlist_container, dlist_foreach_modify, HASH_INDEX, catctup::hash_value, catctup::refcount, and catclist::refcount.
Referenced by SysCacheInvalidate().
void CreateCacheMemoryContext | ( | void | ) |
Definition at line 620 of file catcache.c.
References ALLOCSET_DEFAULT_SIZES, AllocSetContextCreate, CacheMemoryContext, and TopMemoryContext.
Referenced by assign_record_type_typmod(), BuildEventTriggerCache(), init_ts_config_cache(), InitCatCache(), InitializeAttoptCache(), InitializeRelfilenodeMap(), InitializeTableSpaceCache(), lookup_ts_dictionary_cache(), lookup_ts_parser_cache(), lookup_type_cache(), LookupOpclassInfo(), RelationBuildLocalRelation(), and RelationCacheInitialize().
Definition at line 1472 of file catcache.c.
References CatalogCacheComputeHashValue(), CatalogCacheInitializeCache(), catcache::cc_nkeys, and catcache::cc_tupdesc.
Referenced by GetSysCacheHashValue().
CatCache* InitCatCache | ( | int | id, |
Oid | reloid, | ||
Oid | indexoid, | ||
int | nkeys, | ||
const int * | key, | ||
int | nbuckets | ||
) |
Definition at line 763 of file catcache.c.
References Assert, CACHELINEALIGN, CacheMemoryContext, catcache::cc_bucket, catcache::cc_indexoid, catcache::cc_keyno, catcache::cc_nbuckets, catcache::cc_next, catcache::cc_nkeys, catcache::cc_ntup, catcache::cc_relisshared, catcache::cc_relname, catcache::cc_reloid, catcache::cc_tupdesc, catcacheheader::ch_caches, catcacheheader::ch_ntup, CreateCacheMemoryContext(), i, catcache::id, InitCatCache_DEBUG2, MemoryContextSwitchTo(), on_proc_exit(), palloc(), palloc0(), PG_CACHE_LINE_SIZE, slist_init(), and slist_push_head().
Referenced by InitCatalogCache().
Definition at line 1032 of file catcache.c.
References AccessShareLock, AMNAME, AMOID, Assert, CatalogCacheInitializeCache(), catcache::cc_indexoid, catcache::cc_reloid, catcache::cc_tupdesc, catcache::id, index_close(), index_open(), LockRelationOid(), RelationData::rd_index, and UnlockRelationOid().
Referenced by InitCatalogCachePhase2(), and SysCacheGetAttr().
void PrepareToInvalidateCacheTuple | ( | Relation | relation, |
HeapTuple | tuple, | ||
HeapTuple | newtuple, | ||
void(*)(int, uint32, Oid) | function | ||
) |
Definition at line 2007 of file catcache.c.
References Assert, CACHE_elog, CatalogCacheComputeTupleHashValue(), CatalogCacheInitializeCache(), catcache::cc_nkeys, catcache::cc_relisshared, catcache::cc_reloid, catcache::cc_tupdesc, catcacheheader::ch_caches, slist_iter::cur, DEBUG2, HeapTupleIsValid, catcache::id, MyDatabaseId, PointerIsValid, RelationGetRelid, RelationIsValid, slist_container, and slist_foreach.
Referenced by CacheInvalidateHeapTuple().
void PrintCatCacheLeakWarning | ( | HeapTuple | tuple | ) |
Definition at line 2071 of file catcache.c.
References Assert, catcache::cc_relname, catctup::ct_magic, CT_MAGIC, elog, catcache::id, ItemPointerGetBlockNumber, ItemPointerGetOffsetNumber, catctup::my_cache, offsetof, catctup::refcount, and WARNING.
Referenced by ResourceOwnerReleaseInternal().
void PrintCatCacheListLeakWarning | ( | CatCList * | list | ) |
Definition at line 2087 of file catcache.c.
References catcache::cc_relname, elog, catcache::id, catclist::my_cache, catclist::refcount, and WARNING.
Referenced by ResourceOwnerReleaseInternal().
void ReleaseCatCache | ( | HeapTuple | tuple | ) |
Definition at line 1440 of file catcache.c.
References Assert, catctup::c_list, CatCacheRemoveCTup(), catctup::ct_magic, CT_MAGIC, CurrentResourceOwner, catctup::dead, catctup::my_cache, offsetof, catctup::refcount, catclist::refcount, ResourceOwnerForgetCatCacheRef(), and catctup::tuple.
Referenced by ReleaseSysCache(), and ResourceOwnerReleaseInternal().
void ReleaseCatCacheList | ( | CatCList * | list | ) |
Definition at line 1782 of file catcache.c.
References Assert, CatCacheRemoveCList(), catclist::cl_magic, CL_MAGIC, CurrentResourceOwner, catclist::dead, catclist::my_cache, catclist::refcount, and ResourceOwnerForgetCatCacheListRef().
Referenced by AddEnumLabel(), blvalidate(), brinvalidate(), btvalidate(), ginvalidate(), gistvalidate(), hashvalidate(), opclass_for_family_datatype(), RenameEnumLabel(), ResourceOwnerReleaseInternal(), sepgsql_relation_drop(), spgvalidate(), and transformFrameOffset().
void ResetCatalogCaches | ( | void | ) |
Definition at line 689 of file catcache.c.
References CACHE_elog, catcacheheader::ch_caches, slist_iter::cur, DEBUG2, ResetCatalogCache(), slist_container, and slist_foreach.
Referenced by InvalidateSystemCaches().
Definition at line 1147 of file catcache.c.
References catcache::cc_nkeys, and SearchCatCacheInternal().
Referenced by SearchSysCache().
Definition at line 1164 of file catcache.c.
References SearchCatCacheInternal().
Referenced by SearchSysCache1().
Definition at line 1172 of file catcache.c.
References SearchCatCacheInternal().
Referenced by SearchSysCache2().
Definition at line 1180 of file catcache.c.
References SearchCatCacheInternal().
Referenced by SearchSysCache3().
Definition at line 1188 of file catcache.c.
References SearchCatCacheInternal().
Referenced by SearchSysCache4().
Definition at line 1506 of file catcache.c.
References AccessShareLock, Assert, catctup::c_list, catclist::cache_elem, CACHE_elog, CacheMemoryContext, CatalogCacheCompareTuple(), CatalogCacheComputeHashValue(), CatalogCacheComputeTupleHashValue(), CatalogCacheCreateEntry(), CatalogCacheInitializeCache(), CATCACHE_MAXKEYS, CatCacheCopyKeys(), CatCacheRemoveCTup(), catcache::cc_bucket, catcache::cc_indexoid, catcache::cc_keyno, catcache::cc_lists, catcache::cc_nbuckets, catcache::cc_nkeys, catcache::cc_relname, catcache::cc_reloid, catcache::cc_skey, catcache::cc_tupdesc, catclist::cl_magic, CL_MAGIC, dlist_iter::cur, CurrentResourceOwner, catctup::dead, catclist::dead, DEBUG2, dlist_container, dlist_foreach, dlist_move_head(), dlist_push_head(), HASH_INDEX, catctup::hash_value, catclist::hash_value, HeapTupleIsValid, i, IndexScanOK(), SysScanDescData::irel, ItemPointerEquals(), catclist::keys, lappend(), lfirst, list_length(), catclist::members, MemoryContextSwitchTo(), catclist::my_cache, catclist::n_members, catctup::negative, NIL, catclist::nkeys, offsetof, catclist::ordered, palloc(), PG_CATCH, PG_END_TRY, PG_RE_THROW, PG_TRY, catctup::refcount, catclist::refcount, ResourceOwnerEnlargeCatCacheListRefs(), ResourceOwnerRememberCatCacheListRef(), ScanKeyData::sk_argument, systable_beginscan(), systable_endscan(), systable_getnext(), HeapTupleData::t_self, table_close(), table_open(), and catctup::tuple.
Referenced by SearchSysCacheList().
PGDLLIMPORT MemoryContext CacheMemoryContext |