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.
#define CL_MAGIC 0x52765103 |
Definition at line 160 of file catcache.h.
#define CT_MAGIC 0x57261502 |
Definition at line 89 of file catcache.h.
typedef struct catcacheheader CatCacheHeader |
Definition at line 39 of file catcache.h.
void CatalogCacheFlushCatalog | ( | Oid | catId | ) |
Definition at line 713 of file catcache.c.
References CACHE_elog, CacheHdr, 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 546 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 614 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(), InitializeRelfilenumberMap(), InitializeTableSpaceCache(), lookup_ts_dictionary_cache(), lookup_ts_parser_cache(), lookup_type_cache(), LookupOpclassInfo(), RelationBuildLocalRelation(), and RelationCacheInitialize().
Definition at line 1467 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 757 of file catcache.c.
References Assert(), CacheHdr, 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, sort-test::key, MCXT_ALLOC_ZERO, MemoryContextSwitchTo(), on_proc_exit(), palloc(), palloc0(), palloc_aligned(), PG_CACHE_LINE_SIZE, slist_init(), and slist_push_head().
Referenced by InitCatalogCache().
Definition at line 1025 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 2000 of file catcache.c.
References Assert(), CACHE_elog, CacheHdr, 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 2064 of file catcache.c.
References Assert(), catcache::cc_relname, catctup::ct_magic, CT_MAGIC, elog(), catcache::id, ItemPointerGetBlockNumber(), ItemPointerGetOffsetNumber(), catctup::my_cache, catctup::refcount, HeapTupleData::t_self, and WARNING.
Referenced by ResourceOwnerReleaseInternal().
void PrintCatCacheListLeakWarning | ( | CatCList * | list | ) |
Definition at line 2080 of file catcache.c.
References elog(), sort-test::list, and WARNING.
Referenced by ResourceOwnerReleaseInternal().
void ReleaseCatCache | ( | HeapTuple | tuple | ) |
Definition at line 1435 of file catcache.c.
References Assert(), catctup::c_list, CatCacheRemoveCTup(), catctup::ct_magic, CT_MAGIC, CurrentResourceOwner, catctup::dead, catctup::my_cache, catctup::refcount, catclist::refcount, ResourceOwnerForgetCatCacheRef(), and catctup::tuple.
Referenced by ReleaseSysCache(), and ResourceOwnerReleaseInternal().
void ReleaseCatCacheList | ( | CatCList * | list | ) |
Definition at line 1776 of file catcache.c.
References Assert(), CatCacheRemoveCList(), CL_MAGIC, CurrentResourceOwner, sort-test::list, 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 683 of file catcache.c.
References CACHE_elog, CacheHdr, catcacheheader::ch_caches, slist_iter::cur, DEBUG2, ResetCatalogCache(), slist_container, and slist_foreach.
Referenced by InvalidateSystemCachesExtended().
Definition at line 1142 of file catcache.c.
References catcache::cc_nkeys, and SearchCatCacheInternal().
Referenced by SearchSysCache().
Definition at line 1159 of file catcache.c.
References SearchCatCacheInternal().
Referenced by SearchSysCache1().
Definition at line 1167 of file catcache.c.
References SearchCatCacheInternal().
Referenced by SearchSysCache2().
Definition at line 1175 of file catcache.c.
References SearchCatCacheInternal().
Referenced by SearchSysCache3().
Definition at line 1183 of file catcache.c.
References SearchCatCacheInternal().
Referenced by SearchSysCache4().
Definition at line 1501 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, 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().
|
extern |