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 162 of file catcache.h.
#define CT_MAGIC 0x57261502 |
Definition at line 91 of file catcache.h.
typedef struct catcacheheader CatCacheHeader |
Definition at line 39 of file catcache.h.
void CatalogCacheFlushCatalog | ( | Oid | catId | ) |
Definition at line 834 of file catcache.c.
References CatCInProgress::cache, 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 625 of file catcache.c.
References Assert, catctup::c_list, CatCInProgress::cache, CACHE_elog, catcache_in_progress_stack, CatCacheRemoveCList(), CatCacheRemoveCTup(), catcache::cc_bucket, catcache::cc_lbucket, catcache::cc_nbuckets, catcache::cc_nlbuckets, dlist_mutable_iter::cur, catctup::dead, catclist::dead, DEBUG2, dlist_container, dlist_foreach_modify, HASH_INDEX, catctup::hash_value, i, CatCInProgress::next, catctup::refcount, and catclist::refcount.
Referenced by SysCacheInvalidate().
void CreateCacheMemoryContext | ( | void | ) |
Definition at line 708 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 1662 of file catcache.c.
References CatCInProgress::cache, 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 878 of file catcache.c.
References Assert, AttributeNumberIsValid, CacheHdr, CacheMemoryContext, catcache::cc_bucket, catcache::cc_indexoid, catcache::cc_keyno, catcache::cc_lbucket, catcache::cc_nbuckets, catcache::cc_next, catcache::cc_nkeys, catcache::cc_nlbuckets, catcache::cc_nlist, 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().
void InitCatCachePhase2 | ( | CatCache * | cache, |
bool | touch_index | ||
) |
Definition at line 1195 of file catcache.c.
References AccessShareLock, Assert, CatCInProgress::cache, 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, void *) | function, | ||
void * | context | ||
) |
Definition at line 2354 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, function, HeapTupleIsValid, catcache::id, MyDatabaseId, PointerIsValid, RelationGetRelid, RelationIsValid, slist_container, and slist_foreach.
Referenced by CacheInvalidateHeapTupleCommon().
void ReleaseCatCache | ( | HeapTuple | tuple | ) |
Definition at line 1623 of file catcache.c.
References CurrentResourceOwner, and ReleaseCatCacheWithOwner().
Referenced by ReleaseSysCache().
void ReleaseCatCacheList | ( | CatCList * | list | ) |
Definition at line 2071 of file catcache.c.
References CurrentResourceOwner, sort-test::list, and ReleaseCatCacheListWithOwner().
Referenced by AddEnumLabel(), blvalidate(), brinvalidate(), btvalidate(), ginvalidate(), gistvalidate(), hashvalidate(), opclass_for_family_datatype(), RenameEnumLabel(), sepgsql_relation_drop(), spgvalidate(), and transformFrameOffset().
void ResetCatalogCaches | ( | void | ) |
void ResetCatalogCachesExt | ( | bool | debug_discard | ) |
Definition at line 804 of file catcache.c.
References CatCInProgress::cache, CACHE_elog, CacheHdr, catcacheheader::ch_caches, slist_iter::cur, DEBUG2, ResetCatalogCache(), slist_container, and slist_foreach.
Referenced by InvalidateSystemCachesExtended(), and ResetCatalogCaches().
Definition at line 1312 of file catcache.c.
References CatCInProgress::cache, catcache::cc_nkeys, and SearchCatCacheInternal().
Referenced by SearchSysCache().
Definition at line 1329 of file catcache.c.
References CatCInProgress::cache, and SearchCatCacheInternal().
Referenced by SearchSysCache1().
Definition at line 1337 of file catcache.c.
References CatCInProgress::cache, and SearchCatCacheInternal().
Referenced by SearchSysCache2().
Definition at line 1345 of file catcache.c.
References CatCInProgress::cache, and SearchCatCacheInternal().
Referenced by SearchSysCache3().
Definition at line 1353 of file catcache.c.
References CatCInProgress::cache, and SearchCatCacheInternal().
Referenced by SearchSysCache4().
Definition at line 1696 of file catcache.c.
References AccessShareLock, Assert, catctup::c_list, CatCInProgress::cache, catclist::cache_elem, CACHE_elog, CacheMemoryContext, CatalogCacheCompareTuple(), CatalogCacheComputeHashValue(), CatalogCacheComputeTupleHashValue(), CatalogCacheCreateEntry(), CatalogCacheInitializeCache(), catcache_in_progress_stack, CATCACHE_MAXKEYS, CatCacheCopyKeys(), CatCacheRemoveCTup(), catcache::cc_bucket, catcache::cc_indexoid, catcache::cc_keyno, catcache::cc_lbucket, catcache::cc_nbuckets, catcache::cc_nkeys, catcache::cc_nlbuckets, catcache::cc_nlist, catcache::cc_relname, catcache::cc_reloid, catcache::cc_skey, catcache::cc_tupdesc, catclist::cl_magic, CL_MAGIC, dlist_iter::cur, CurrentResourceOwner, CatCInProgress::dead, catctup::dead, catclist::dead, DEBUG2, dlist_container, dlist_foreach, dlist_move_head(), dlist_push_head(), HASH_INDEX, CatCInProgress::hash_value, catctup::hash_value, catclist::hash_value, HeapTupleIsValid, i, IndexScanOK(), INJECTION_POINT, SysScanDescData::irel, ItemPointerEquals(), catclist::keys, lappend(), lfirst, CatCInProgress::list, list_length(), catclist::members, MemoryContextAllocZero(), MemoryContextSwitchTo(), catclist::my_cache, catclist::n_members, catctup::negative, CatCInProgress::next, NIL, catclist::nkeys, catclist::ordered, palloc(), PG_CATCH, PG_END_TRY, PG_RE_THROW, PG_TRY, catctup::refcount, catclist::refcount, RehashCatCacheLists(), ResourceOwnerEnlarge(), ResourceOwnerRememberCatCacheListRef(), ScanKeyData::sk_argument, systable_beginscan(), systable_endscan(), systable_getnext(), HeapTupleData::t_self, table_close(), table_open(), catctup::tuple, and unlikely.
Referenced by SearchSysCacheList().
|
extern |