PostgreSQL Source Code
git master
|
#include "postgres.h"
#include <limits.h>
#include "access/xact.h"
#include "common/hashfn.h"
#include "port/pg_bitutils.h"
#include "storage/shmem.h"
#include "storage/spin.h"
#include "utils/dynahash.h"
#include "utils/memutils.h"
Go to the source code of this file.
Data Structures | |
struct | FreeListData |
struct | HASHHDR |
struct | HTAB |
Macros | |
#define | DEF_SEGSIZE 256 |
#define | DEF_SEGSIZE_SHIFT 8 /* must be log2(DEF_SEGSIZE) */ |
#define | DEF_DIRSIZE 256 |
#define | NUM_FREELISTS 32 |
#define | IS_PARTITIONED(hctl) ((hctl)->num_partitions != 0) |
#define | FREELIST_IDX(hctl, hashcode) (IS_PARTITIONED(hctl) ? (hashcode) % NUM_FREELISTS : 0) |
#define | ELEMENTKEY(helem) (((char *)(helem)) + MAXALIGN(sizeof(HASHELEMENT))) |
#define | ELEMENT_FROM_KEY(key) ((HASHELEMENT *) (((char *) (key)) - MAXALIGN(sizeof(HASHELEMENT)))) |
#define | MOD(x, y) ((x) & ((y)-1)) |
#define | MAX_SEQ_SCANS 100 |
Typedefs | |
typedef HASHELEMENT * | HASHBUCKET |
typedef HASHBUCKET * | HASHSEGMENT |
Functions | |
static void * | DynaHashAlloc (Size size) |
static HASHSEGMENT | seg_alloc (HTAB *hashp) |
static bool | element_alloc (HTAB *hashp, int nelem, int freelist_idx) |
static bool | dir_realloc (HTAB *hashp) |
static bool | expand_table (HTAB *hashp) |
static HASHBUCKET | get_hash_entry (HTAB *hashp, int freelist_idx) |
static void | hdefault (HTAB *hashp) |
static int | choose_nelem_alloc (Size entrysize) |
static bool | init_htab (HTAB *hashp, long nelem) |
static void | hash_corrupted (HTAB *hashp) pg_attribute_noreturn() |
static uint32 | hash_initial_lookup (HTAB *hashp, uint32 hashvalue, HASHBUCKET **bucketptr) |
static long | next_pow2_long (long num) |
static int | next_pow2_int (long num) |
static void | register_seq_scan (HTAB *hashp) |
static void | deregister_seq_scan (HTAB *hashp) |
static bool | has_seq_scans (HTAB *hashp) |
static int | string_compare (const char *key1, const char *key2, Size keysize) |
HTAB * | hash_create (const char *tabname, long nelem, const HASHCTL *info, int flags) |
Size | hash_estimate_size (long num_entries, Size entrysize) |
long | hash_select_dirsize (long num_entries) |
Size | hash_get_shared_size (HASHCTL *info, int flags) |
void | hash_destroy (HTAB *hashp) |
void | hash_stats (const char *where, HTAB *hashp) |
uint32 | get_hash_value (HTAB *hashp, const void *keyPtr) |
static uint32 | calc_bucket (HASHHDR *hctl, uint32 hash_val) |
void * | hash_search (HTAB *hashp, const void *keyPtr, HASHACTION action, bool *foundPtr) |
void * | hash_search_with_hash_value (HTAB *hashp, const void *keyPtr, uint32 hashvalue, HASHACTION action, bool *foundPtr) |
bool | hash_update_hash_key (HTAB *hashp, void *existingEntry, const void *newKeyPtr) |
long | hash_get_num_entries (HTAB *hashp) |
void | hash_seq_init (HASH_SEQ_STATUS *status, HTAB *hashp) |
void | hash_seq_init_with_hash_value (HASH_SEQ_STATUS *status, HTAB *hashp, uint32 hashvalue) |
void * | hash_seq_search (HASH_SEQ_STATUS *status) |
void | hash_seq_term (HASH_SEQ_STATUS *status) |
void | hash_freeze (HTAB *hashp) |
int | my_log2 (long num) |
void | AtEOXact_HashTables (bool isCommit) |
void | AtEOSubXact_HashTables (bool isCommit, int nestDepth) |
Variables | |
static MemoryContext | CurrentDynaHashCxt = NULL |
static HTAB * | seq_scan_tables [MAX_SEQ_SCANS] |
static int | seq_scan_level [MAX_SEQ_SCANS] |
static int | num_seq_scans = 0 |
#define DEF_DIRSIZE 256 |
Definition at line 125 of file dynahash.c.
#define DEF_SEGSIZE 256 |
Definition at line 123 of file dynahash.c.
#define DEF_SEGSIZE_SHIFT 8 /* must be log2(DEF_SEGSIZE) */ |
Definition at line 124 of file dynahash.c.
#define ELEMENT_FROM_KEY | ( | key | ) | ((HASHELEMENT *) (((char *) (key)) - MAXALIGN(sizeof(HASHELEMENT)))) |
Definition at line 249 of file dynahash.c.
#define ELEMENTKEY | ( | helem | ) | (((char *)(helem)) + MAXALIGN(sizeof(HASHELEMENT))) |
Definition at line 244 of file dynahash.c.
#define FREELIST_IDX | ( | hctl, | |
hashcode | |||
) | (IS_PARTITIONED(hctl) ? (hashcode) % NUM_FREELISTS : 0) |
Definition at line 212 of file dynahash.c.
#define IS_PARTITIONED | ( | hctl | ) | ((hctl)->num_partitions != 0) |
Definition at line 210 of file dynahash.c.
#define MAX_SEQ_SCANS 100 |
Definition at line 1856 of file dynahash.c.
#define NUM_FREELISTS 32 |
Definition at line 128 of file dynahash.c.
typedef HASHELEMENT* HASHBUCKET |
Definition at line 131 of file dynahash.c.
typedef HASHBUCKET* HASHSEGMENT |
Definition at line 134 of file dynahash.c.
void AtEOSubXact_HashTables | ( | bool | isCommit, |
int | nestDepth | ||
) |
Definition at line 1938 of file dynahash.c.
References elog, i, num_seq_scans, seq_scan_level, seq_scan_tables, and WARNING.
Referenced by AbortSubTransaction(), and CommitSubTransaction().
void AtEOXact_HashTables | ( | bool | isCommit | ) |
Definition at line 1912 of file dynahash.c.
References elog, i, num_seq_scans, seq_scan_tables, and WARNING.
Referenced by AbortTransaction(), BackgroundWriterMain(), CheckpointerMain(), CommitTransaction(), pgarch_archiveXlog(), PrepareTransaction(), WalSummarizerMain(), and WalWriterMain().
Definition at line 918 of file dynahash.c.
References HASHHDR::high_mask, HASHHDR::low_mask, and HASHHDR::max_bucket.
Referenced by expand_table(), and hash_initial_lookup().
|
static |
Definition at line 656 of file dynahash.c.
References MAXALIGN.
Referenced by hash_estimate_size(), and init_htab().
|
static |
Definition at line 1877 of file dynahash.c.
References elog, ERROR, i, num_seq_scans, seq_scan_level, seq_scan_tables, and HTAB::tabname.
Referenced by hash_seq_term().
|
static |
Definition at line 1648 of file dynahash.c.
References HTAB::alloc, Assert, CurrentDynaHashCxt, HTAB::dir, HASHHDR::dsize, DynaHashAlloc(), HTAB::hctl, HTAB::hcxt, HASHHDR::max_dsize, MemSet, NO_MAX_DSIZE, and pfree().
Referenced by expand_table().
|
static |
Definition at line 291 of file dynahash.c.
References Assert, CurrentDynaHashCxt, MCXT_ALLOC_NO_OOM, MemoryContextAllocExtended(), MemoryContextIsValid, and size.
Referenced by dir_realloc(), hash_create(), and hash_destroy().
|
static |
Definition at line 1706 of file dynahash.c.
References HTAB::alloc, CurrentDynaHashCxt, HASHHDR::entrysize, FreeListData::freeList, HASHHDR::freeList, HTAB::hctl, HTAB::hcxt, i, IS_PARTITIONED, HTAB::isfixed, HASHELEMENT::link, MAXALIGN, FreeListData::mutex, SpinLockAcquire, and SpinLockRelease.
Referenced by get_hash_entry(), and hash_create().
|
static |
Definition at line 1551 of file dynahash.c.
References Assert, calc_bucket(), HTAB::dir, dir_realloc(), HASHHDR::dsize, HASHELEMENT::hashvalue, HTAB::hctl, HASHHDR::high_mask, IS_PARTITIONED, HASHELEMENT::link, HASHHDR::low_mask, HASHHDR::max_bucket, MOD, HASHHDR::nsegs, seg_alloc(), HTAB::sshift, and HTAB::ssize.
Referenced by hash_search_with_hash_value().
|
static |
Definition at line 1256 of file dynahash.c.
References element_alloc(), FreeListData::freeList, HASHHDR::freeList, HTAB::hctl, IS_PARTITIONED, HASHELEMENT::link, FreeListData::mutex, HASHHDR::nelem_alloc, FreeListData::nentries, NUM_FREELISTS, SpinLockAcquire, and SpinLockRelease.
Referenced by hash_search_with_hash_value().
Definition at line 911 of file dynahash.c.
References HTAB::hash, and HTAB::keysize.
Referenced by BufTableHashCode(), LockTagHashCode(), and lookup_type_cache().
|
static |
Definition at line 1898 of file dynahash.c.
References i, num_seq_scans, and seq_scan_tables.
Referenced by hash_freeze(), and hash_search_with_hash_value().
|
static |
Definition at line 1780 of file dynahash.c.
References elog, FATAL, HTAB::isshared, PANIC, and HTAB::tabname.
Referenced by hash_initial_lookup().
Definition at line 352 of file dynahash.c.
References HTAB::alloc, HASHCTL::alloc, ALLOCSET_DEFAULT_SIZES, AllocSetContextCreate, Assert, CurrentDynaHashCxt, HTAB::dir, HASHHDR::dsize, HASHCTL::dsize, DynaHashAlloc(), element_alloc(), elog, HASHHDR::entrysize, HASHCTL::entrysize, ereport, errcode(), errmsg(), ERROR, HTAB::frozen, HTAB::hash, HASHCTL::hash, HASH_ALLOC, HASH_ATTACH, HASH_BLOBS, HASH_COMPARE, HASH_CONTEXT, HASH_DIRSIZE, HASH_ELEM, HASH_FIXED_SIZE, HASH_FUNCTION, HASH_KEYCOPY, HASH_PARTITION, HASH_SEGMENT, HASH_SHARED_MEM, HASH_STRINGS, HTAB::hctl, HASHCTL::hctl, HTAB::hcxt, HASHCTL::hcxt, hdefault(), i, init_htab(), IS_PARTITIONED, HTAB::isfixed, HTAB::isshared, HTAB::keycopy, HASHCTL::keycopy, HASHHDR::keysize, HTAB::keysize, HASHCTL::keysize, HTAB::match, HASHCTL::match, HASHHDR::max_dsize, HASHCTL::max_dsize, MemoryContextSetIdentifier(), MemSet, my_log2(), next_pow2_int(), NUM_FREELISTS, HASHHDR::num_partitions, HASHCTL::num_partitions, HASHHDR::sshift, HTAB::sshift, HASHHDR::ssize, HTAB::ssize, HASHCTL::ssize, string_compare(), string_hash(), strlcpy(), HTAB::tabname, tag_hash(), TopMemoryContext, and uint32_hash().
Referenced by _hash_finish_split(), _PG_init(), AddEventToPendingNotifies(), AddPendingSync(), assign_record_type_typmod(), begin_heap_rewrite(), build_colinfo_names_hash(), build_guc_variables(), build_join_rel_hash(), BuildEventTriggerCache(), CheckForSessionAndXactLocks(), CompactCheckpointerRequestQueue(), compute_array_stats(), compute_tsvector_stats(), create_seq_hashtable(), createConnHash(), CreateLocalPredicateLockHash(), CreatePartitionDirectory(), do_autovacuum(), EnablePortalManager(), ExecInitModifyTable(), ExecuteTruncateGuts(), find_all_inheritors(), find_oper_cache_entry(), find_rendezvous_variable(), get_json_object_as_hash(), GetComboCommandId(), GetConnection(), gistInitBuildBuffers(), gistInitParentMap(), init_missing_cache(), init_procedure_caches(), init_rel_sync_cache(), init_timezone_hashtable(), init_ts_config_cache(), init_uncommitted_enum_types(), init_uncommitted_enum_values(), InitBufferManagerAccess(), InitializeAttoptCache(), InitializeRelfilenumberMap(), InitializeShippableCache(), InitializeTableSpaceCache(), InitLocalBuffers(), InitLockManagerAccess(), InitQueryHashTable(), InitRecoveryTransactionEnvironment(), InitSync(), json_unique_check_init(), load_categories_hash(), log_invalid_page(), logical_begin_heap_rewrite(), logicalrep_partmap_init(), logicalrep_relmap_init(), lookup_proof_cache(), lookup_ts_dictionary_cache(), lookup_ts_parser_cache(), lookup_type_cache(), LookupOpclassInfo(), pa_allocate_worker(), pg_get_backend_memory_contexts(), plpgsql_estate_setup(), plpgsql_HashTableInit(), PLy_add_exceptions(), populate_recordset_object_start(), process_syncing_tables_for_apply(), rebuild_database_list(), record_C_func(), RegisterExtensibleNodeEntry(), RelationCacheInitialize(), ReorderBufferAllocate(), ReorderBufferBuildTupleCidHash(), ReorderBufferToastInitHash(), ResetUnloggedRelationsInDbspaceDir(), ri_InitHashTables(), select_perl_context(), SerializePendingSyncs(), set_rtable_names(), ShmemInitHash(), smgropen(), transformGraph(), and XLogPrefetcherAllocate().
void hash_destroy | ( | HTAB * | hashp | ) |
Definition at line 865 of file dynahash.c.
References HTAB::alloc, Assert, DynaHashAlloc(), hash_stats(), HTAB::hcxt, and MemoryContextDelete().
Referenced by _hash_finish_split(), CheckForSessionAndXactLocks(), CompactCheckpointerRequestQueue(), destroy_colinfo_names_hash(), ExecuteTruncateGuts(), find_all_inheritors(), get_json_object_as_hash(), pg_get_backend_memory_contexts(), pgoutput_shutdown(), populate_recordset_object_end(), PostPrepare_PredicateLocks(), process_syncing_tables_for_apply(), ReleasePredicateLocksLocal(), ReorderBufferReturnTXN(), ReorderBufferToastReset(), ReorderBufferTruncateTXN(), ResetSequenceCaches(), ResetUnloggedRelationsInDbspaceDir(), SerializePendingSyncs(), set_rtable_names(), ShutdownRecoveryTransactionEnvironment(), XLogCheckInvalidPages(), and XLogPrefetcherFree().
Definition at line 783 of file dynahash.c.
References add_size(), choose_nelem_alloc(), DEF_DIRSIZE, DEF_SEGSIZE, MAXALIGN, mul_size(), next_pow2_long(), and size.
Referenced by BufTableShmemSize(), CalculateShmemSize(), LockManagerShmemSize(), pgss_memsize(), PredicateLockShmemSize(), and WaitEventCustomShmemSize().
void hash_freeze | ( | HTAB * | hashp | ) |
Definition at line 1534 of file dynahash.c.
References elog, ERROR, HTAB::frozen, has_seq_scans(), HTAB::isshared, and HTAB::tabname.
long hash_get_num_entries | ( | HTAB * | hashp | ) |
Definition at line 1341 of file dynahash.c.
References HASHHDR::freeList, HTAB::hctl, i, IS_PARTITIONED, FreeListData::nentries, and NUM_FREELISTS.
Referenced by build_guc_variables(), compute_array_stats(), compute_tsvector_stats(), entry_alloc(), entry_dealloc(), entry_reset(), EstimatePendingSyncsSpace(), EstimateUncommittedEnumsSpace(), get_crosstab_tuplestore(), get_explain_guc_options(), get_guc_variables(), GetLockStatusData(), GetPredicateLockStatusData(), GetRunningTransactionLocks(), GetWaitEventCustomNames(), hash_stats(), pgss_shmem_shutdown(), ResetUnloggedRelationsInDbspaceDir(), SerializePendingSyncs(), transformGraph(), and XLogHaveInvalidPages().
Definition at line 854 of file dynahash.c.
References Assert, HASHCTL::dsize, HASH_DIRSIZE, and HASHCTL::max_dsize.
Referenced by ShmemInitHash().
|
inlinestatic |
Definition at line 1756 of file dynahash.c.
References calc_bucket(), HTAB::dir, hash_corrupted(), HTAB::hctl, MOD, HTAB::sshift, and HTAB::ssize.
Referenced by hash_search_with_hash_value(), hash_seq_init_with_hash_value(), and hash_update_hash_key().
void* hash_search | ( | HTAB * | hashp, |
const void * | keyPtr, | ||
HASHACTION | action, | ||
bool * | foundPtr | ||
) |
Definition at line 955 of file dynahash.c.
References generate_unaccent_rules::action, HTAB::hash, hash_search_with_hash_value(), and HTAB::keysize.
Referenced by _hash_finish_split(), _hash_splitbucket(), add_guc_variable(), add_join_rel(), add_to_names_hash(), AddEnumLabel(), AddEventToPendingNotifies(), AddPendingSync(), ApplyLogicalMappingFile(), assign_record_type_typmod(), AsyncExistsPendingNotify(), AtEOSubXact_RelationCache(), AtEOXact_RelationCache(), build_guc_variables(), build_join_rel_hash(), BuildEventTriggerCache(), CheckAndPromotePredicateLockRequest(), CheckForSerializableConflictOut(), CheckForSessionAndXactLocks(), colname_is_unique(), CompactCheckpointerRequestQueue(), compile_plperl_function(), compile_pltcl_function(), compute_array_stats(), compute_tsvector_stats(), createNewConnection(), define_custom_variable(), delete_rel_type_cache_if_needed(), deleteConnection(), do_autovacuum(), DropAllPredicateLocksFromTable(), DropAllPreparedStatements(), DropPreparedStatement(), DropRelationAllLocalBuffers(), DropRelationLocalBuffers(), entry_alloc(), entry_dealloc(), entry_reset(), EnumTypeUncommitted(), EnumUncommitted(), EnumValuesCreate(), EventCacheLookup(), ExecInitModifyTable(), ExecLookupResultRelByOid(), ExecuteTruncateGuts(), ExtendBufferedRelLocal(), FetchPreparedStatement(), finalize_in_progress_typentries(), find_all_inheritors(), find_join_rel(), find_oper_cache_entry(), find_option(), find_rendezvous_variable(), forget_invalid_pages(), forget_invalid_pages_db(), ForgetPrivateRefCountEntry(), get_attribute_options(), get_cast_hashentry(), get_rel_sync_entry(), get_tablespace(), GetComboCommandId(), GetConnection(), getConnectionByName(), GetExtensibleNodeEntry(), GetLocalVictimBuffer(), getmissingattr(), GetPrivateRefCountEntry(), getState(), GetWaitEventCustomIdentifier(), gistGetNodeBuffer(), gistGetParent(), gistMemorizeParent(), gistRelocateBuildBuffersOnSplit(), hash_object_field_end(), init_sequence(), insert_rel_type_cache_if_needed(), InvalidateAttoptCacheCallback(), InvalidateOprCacheCallBack(), InvalidateShippableCacheCallback(), InvalidateTableSpaceCacheCallback(), is_shippable(), JsObjectGetField(), json_unique_check_key(), LocalBufferAlloc(), LockAcquireExtended(), LockHasWaiters(), LockHeldByMe(), LockRelease(), log_invalid_page(), logical_rewrite_log_mapping(), logicalrep_partition_open(), logicalrep_rel_open(), logicalrep_relmap_update(), lookup_C_func(), lookup_proof_cache(), lookup_ts_config_cache(), lookup_ts_dictionary_cache(), lookup_ts_parser_cache(), lookup_type_cache(), LookupOpclassInfo(), make_oper_cache_entry(), MarkGUCPrefixReserved(), pa_allocate_worker(), pa_find_worker(), pa_free_worker(), PartitionDirectoryLookup(), pg_get_backend_memory_contexts(), pg_tzset(), pgss_store(), plperl_spi_exec_prepared(), plperl_spi_freeplan(), plperl_spi_prepare(), plperl_spi_query_prepared(), plpgsql_HashTableDelete(), plpgsql_HashTableInsert(), plpgsql_HashTableLookup(), pltcl_fetch_interp(), PLy_commit(), PLy_generate_spi_exceptions(), PLy_procedure_get(), PLy_rollback(), PLy_spi_subtransaction_abort(), populate_recordset_object_field_end(), predicatelock_twophase_recover(), PredicateLockExists(), PredicateLockShmemInit(), PredicateLockTwoPhaseFinish(), PrefetchLocalBuffer(), process_syncing_tables_for_apply(), ProcessSyncRequests(), prune_element_hashtable(), prune_lexemes_hashtable(), PutMemoryContextsStatsTupleStore(), rebuild_database_list(), record_C_func(), RegisterExtensibleNodeEntry(), RegisterPredicateLockingXid(), rel_sync_cache_relation_cb(), RelationPreTruncate(), ReleaseOneSerializableXact(), RelFileLocatorSkippingWAL(), RelfilenumberMapInvalidateCallback(), RelidByRelfilenumber(), RememberSyncRequest(), RemoveLocalLock(), ReorderBufferBuildTupleCidHash(), ReorderBufferCleanupTXN(), ReorderBufferToastAppendChunk(), ReorderBufferToastReplace(), ReorderBufferTXNByXid(), ReservePrivateRefCountEntry(), ResetUnloggedRelationsInDbspaceDir(), ResolveCminCmaxDuringDecoding(), RestoreUncommittedEnums(), rewrite_heap_dead_tuple(), rewrite_heap_tuple(), ri_FetchPreparedPlan(), ri_HashCompareOp(), ri_HashPreparedPlan(), ri_LoadConstraintInfo(), select_perl_context(), SerializePendingSyncs(), set_rtable_names(), ShmemInitStruct(), smgrdestroy(), smgrDoPendingSyncs(), smgropen(), smgrreleaserellocator(), StandbyAcquireAccessExclusiveLock(), StandbyReleaseAllLocks(), StandbyReleaseLocks(), StandbyReleaseOldLocks(), StandbyReleaseXidEntryLocks(), StorePreparedStatement(), table_recheck_autovac(), TypeCacheRelCallback(), WaitEventCustomNew(), XLogPrefetcherAddFilter(), XLogPrefetcherCompleteFilters(), and XLogPrefetcherIsFiltered().
void* hash_search_with_hash_value | ( | HTAB * | hashp, |
const void * | keyPtr, | ||
uint32 | hashvalue, | ||
HASHACTION | action, | ||
bool * | foundPtr | ||
) |
Definition at line 968 of file dynahash.c.
References generate_unaccent_rules::action, Assert, ELEMENTKEY, elog, ereport, errcode(), errmsg(), ERROR, expand_table(), FreeListData::freeList, HASHHDR::freeList, FREELIST_IDX, HTAB::frozen, get_hash_entry(), has_seq_scans(), HASH_ENTER, HASH_ENTER_NULL, HASH_FIND, hash_initial_lookup(), HASH_REMOVE, HASHELEMENT::hashvalue, HTAB::hctl, IS_PARTITIONED, HTAB::isshared, HTAB::keycopy, HTAB::keysize, HASHELEMENT::link, HTAB::match, HASHHDR::max_bucket, FreeListData::mutex, FreeListData::nentries, SpinLockAcquire, SpinLockRelease, and HTAB::tabname.
Referenced by BufTableDelete(), BufTableInsert(), BufTableLookup(), CheckTargetForConflictsIn(), CleanUpLock(), ClearOldPredicateLocks(), CreatePredicateLock(), DecrementParentLocks(), DeleteChildTargetLocks(), DeleteLockTarget(), DropAllPredicateLocksFromTable(), FastPathGetRelationLockEntry(), GetLockConflicts(), hash_search(), lock_twophase_recover(), LockAcquireExtended(), LockRefindAndRelease(), LockRelease(), LockWaiterCount(), PageIsPredicateLocked(), PredicateLockAcquire(), ReleaseOneSerializableXact(), RemoveScratchTarget(), RemoveTargetIfNoLongerUsed(), RestoreScratchTarget(), SetupLockInTable(), and TransferPredicateLocksToNewTarget().
long hash_select_dirsize | ( | long | num_entries | ) |
Definition at line 830 of file dynahash.c.
References DEF_DIRSIZE, DEF_SEGSIZE, and next_pow2_long().
Referenced by ShmemInitHash().
void hash_seq_init | ( | HASH_SEQ_STATUS * | status, |
HTAB * | hashp | ||
) |
Definition at line 1385 of file dynahash.c.
References HASH_SEQ_STATUS::curBucket, HASH_SEQ_STATUS::curEntry, HTAB::frozen, HASH_SEQ_STATUS::hasHashvalue, HASH_SEQ_STATUS::hashp, and register_seq_scan().
Referenced by AtAbort_Portals(), AtCleanup_Portals(), AtEOSubXact_RelationCache(), AtEOXact_RelationCache(), AtPrepare_Locks(), AtSubAbort_Portals(), AtSubCleanup_Portals(), AtSubCommit_Portals(), BeginReportingGUCOptions(), CheckForBufferLeaks(), CheckForSessionAndXactLocks(), CheckTableForSerializableConflictIn(), cleanup_rel_sync_cache(), compute_array_stats(), compute_tsvector_stats(), dblink_get_connections(), DestroyPartitionDirectory(), disconnect_cached_connections(), DropAllPredicateLocksFromTable(), DropAllPreparedStatements(), end_heap_rewrite(), entry_dealloc(), entry_reset(), ExecuteTruncateGuts(), forget_invalid_pages(), forget_invalid_pages_db(), ForgetPortalSnapshots(), gc_qtexts(), get_guc_variables(), GetLockStatusData(), GetPredicateLockStatusData(), GetRunningTransactionLocks(), GetWaitEventCustomNames(), hash_seq_init_with_hash_value(), HoldPinnedPortals(), InitializeGUCOptions(), InvalidateAttoptCacheCallback(), InvalidateOprCacheCallBack(), InvalidateOprProofCacheCallBack(), InvalidateShippableCacheCallback(), InvalidateTableSpaceCacheCallback(), InvalidateTSCacheCallBack(), LockReassignCurrentOwner(), LockReleaseAll(), LockReleaseCurrentOwner(), LockReleaseSession(), logical_end_heap_rewrite(), logical_heap_rewrite_flush_mappings(), logicalrep_partmap_invalidate_cb(), logicalrep_partmap_reset_relmap(), logicalrep_relmap_invalidate_cb(), MarkGUCPrefixReserved(), packGraph(), pg_cursor(), pg_get_shmem_allocations(), pg_prepared_statement(), pg_stat_statements_internal(), pgfdw_inval_callback(), pgfdw_subxact_callback(), pgfdw_xact_callback(), pgss_shmem_shutdown(), plperl_fini(), PortalErrorCleanup(), PortalHashTableDeleteAll(), postgres_fdw_get_connections_internal(), PostPrepare_Locks(), PreCommit_Portals(), ProcessConfigFileInternal(), ProcessSyncRequests(), prune_element_hashtable(), prune_lexemes_hashtable(), rebuild_database_list(), rel_sync_cache_publication_cb(), rel_sync_cache_relation_cb(), RelationCacheInitializePhase3(), RelationCacheInvalidate(), RelfilenumberMapInvalidateCallback(), RememberSyncRequest(), ReorderBufferToastReset(), selectColorTrigrams(), SerializePendingSyncs(), SerializeUncommittedEnums(), smgrDoPendingSyncs(), smgrreleaseall(), StandbyReleaseAllLocks(), StandbyReleaseOldLocks(), ThereAreNoReadyPortals(), TypeCacheOpcCallback(), TypeCacheRelCallback(), TypeCacheTypCallback(), write_relcache_init_file(), and XLogCheckInvalidPages().
void hash_seq_init_with_hash_value | ( | HASH_SEQ_STATUS * | status, |
HTAB * | hashp, | ||
uint32 | hashvalue | ||
) |
Definition at line 1405 of file dynahash.c.
References HASH_SEQ_STATUS::curBucket, HASH_SEQ_STATUS::curEntry, hash_initial_lookup(), hash_seq_init(), HASH_SEQ_STATUS::hasHashvalue, and HASH_SEQ_STATUS::hashvalue.
Referenced by InvalidateAttoptCacheCallback(), and TypeCacheTypCallback().
void* hash_seq_search | ( | HASH_SEQ_STATUS * | status | ) |
Definition at line 1420 of file dynahash.c.
References HASH_SEQ_STATUS::curBucket, HASH_SEQ_STATUS::curEntry, HTAB::dir, ELEMENTKEY, hash_seq_term(), HASH_SEQ_STATUS::hasHashvalue, HASH_SEQ_STATUS::hashp, HASHELEMENT::hashvalue, HASH_SEQ_STATUS::hashvalue, HTAB::hctl, HASHELEMENT::link, HASHHDR::max_bucket, MOD, HTAB::sshift, and HTAB::ssize.
Referenced by AtAbort_Portals(), AtCleanup_Portals(), AtEOSubXact_RelationCache(), AtEOXact_RelationCache(), AtPrepare_Locks(), AtSubAbort_Portals(), AtSubCleanup_Portals(), AtSubCommit_Portals(), BeginReportingGUCOptions(), CheckForBufferLeaks(), CheckForSessionAndXactLocks(), CheckTableForSerializableConflictIn(), cleanup_rel_sync_cache(), compute_array_stats(), compute_tsvector_stats(), dblink_get_connections(), DestroyPartitionDirectory(), disconnect_cached_connections(), DropAllPredicateLocksFromTable(), DropAllPreparedStatements(), end_heap_rewrite(), entry_dealloc(), entry_reset(), ExecuteTruncateGuts(), forget_invalid_pages(), forget_invalid_pages_db(), ForgetPortalSnapshots(), gc_qtexts(), get_guc_variables(), GetLockStatusData(), GetPredicateLockStatusData(), GetRunningTransactionLocks(), GetWaitEventCustomNames(), HoldPinnedPortals(), InitializeGUCOptions(), InvalidateAttoptCacheCallback(), InvalidateOprCacheCallBack(), InvalidateOprProofCacheCallBack(), InvalidateShippableCacheCallback(), InvalidateTableSpaceCacheCallback(), InvalidateTSCacheCallBack(), LockReassignCurrentOwner(), LockReleaseAll(), LockReleaseCurrentOwner(), LockReleaseSession(), logical_end_heap_rewrite(), logical_heap_rewrite_flush_mappings(), logicalrep_partmap_invalidate_cb(), logicalrep_partmap_reset_relmap(), logicalrep_relmap_invalidate_cb(), MarkGUCPrefixReserved(), packGraph(), pg_cursor(), pg_get_shmem_allocations(), pg_prepared_statement(), pg_stat_statements_internal(), pgfdw_inval_callback(), pgfdw_subxact_callback(), pgfdw_xact_callback(), pgss_shmem_shutdown(), plperl_fini(), PortalErrorCleanup(), PortalHashTableDeleteAll(), postgres_fdw_get_connections_internal(), PostPrepare_Locks(), PreCommit_Portals(), ProcessConfigFileInternal(), ProcessSyncRequests(), prune_element_hashtable(), prune_lexemes_hashtable(), rebuild_database_list(), rel_sync_cache_publication_cb(), rel_sync_cache_relation_cb(), RelationCacheInitializePhase3(), RelationCacheInvalidate(), RelfilenumberMapInvalidateCallback(), RememberSyncRequest(), ReorderBufferToastReset(), selectColorTrigrams(), SerializePendingSyncs(), SerializeUncommittedEnums(), smgrDoPendingSyncs(), smgrreleaseall(), StandbyReleaseAllLocks(), StandbyReleaseOldLocks(), ThereAreNoReadyPortals(), TypeCacheOpcCallback(), TypeCacheRelCallback(), TypeCacheTypCallback(), write_relcache_init_file(), and XLogCheckInvalidPages().
void hash_seq_term | ( | HASH_SEQ_STATUS * | status | ) |
Definition at line 1514 of file dynahash.c.
References deregister_seq_scan(), HTAB::frozen, and HASH_SEQ_STATUS::hashp.
Referenced by gc_qtexts(), hash_seq_search(), logicalrep_partmap_invalidate_cb(), logicalrep_relmap_invalidate_cb(), pgss_shmem_shutdown(), PortalHashTableDeleteAll(), PreCommit_Portals(), and RelationCacheInitializePhase3().
void hash_stats | ( | const char * | where, |
HTAB * | hashp | ||
) |
Definition at line 884 of file dynahash.c.
References fprintf, hash_get_num_entries(), HTAB::hctl, HASHHDR::keysize, HASHHDR::max_bucket, and HASHHDR::nsegs.
Referenced by hash_destroy().
bool hash_update_hash_key | ( | HTAB * | hashp, |
void * | existingEntry, | ||
const void * | newKeyPtr | ||
) |
Definition at line 1145 of file dynahash.c.
References ELEMENT_FROM_KEY, ELEMENTKEY, elog, ERROR, HTAB::frozen, HTAB::hash, hash_initial_lookup(), HASHELEMENT::hashvalue, HTAB::keycopy, HTAB::keysize, HASHELEMENT::link, HTAB::match, and HTAB::tabname.
Referenced by PostPrepare_Locks().
|
static |
Definition at line 629 of file dynahash.c.
References DEF_DIRSIZE, DEF_SEGSIZE, DEF_SEGSIZE_SHIFT, HASHHDR::dsize, HTAB::hctl, HASHHDR::max_dsize, MemSet, NO_MAX_DSIZE, HASHHDR::nsegs, HASHHDR::num_partitions, HASHHDR::sshift, and HASHHDR::ssize.
Referenced by hash_create().
|
static |
Definition at line 689 of file dynahash.c.
References HTAB::alloc, choose_nelem_alloc(), CurrentDynaHashCxt, HTAB::dir, HASHHDR::dsize, HASHHDR::entrysize, fprintf, HASHHDR::freeList, HTAB::hctl, HTAB::hcxt, HASHHDR::high_mask, i, IS_PARTITIONED, HASHHDR::low_mask, HASHHDR::max_bucket, FreeListData::mutex, HASHHDR::nelem_alloc, next_pow2_int(), HASHHDR::nsegs, NUM_FREELISTS, seg_alloc(), SpinLockInit, HASHHDR::sshift, and HASHHDR::ssize.
Referenced by hash_create().
int my_log2 | ( | long | num | ) |
Definition at line 1794 of file dynahash.c.
References pg_ceil_log2_32(), and pg_ceil_log2_64().
Referenced by ExecHashTableCreate(), ExecParallelHashTableSetCurrentBatch(), hash_choose_num_partitions(), hash_create(), MultiExecParallelHash(), next_pow2_int(), next_pow2_long(), and subxact_info_read().
|
static |
Definition at line 1820 of file dynahash.c.
References my_log2().
Referenced by hash_create(), and init_htab().
|
static |
Definition at line 1812 of file dynahash.c.
References my_log2().
Referenced by hash_estimate_size(), and hash_select_dirsize().
|
static |
Definition at line 1865 of file dynahash.c.
References elog, ERROR, GetCurrentTransactionNestLevel(), MAX_SEQ_SCANS, num_seq_scans, seq_scan_level, seq_scan_tables, and HTAB::tabname.
Referenced by hash_seq_init().
|
static |
Definition at line 1687 of file dynahash.c.
References HTAB::alloc, CurrentDynaHashCxt, HTAB::hcxt, MemSet, and HTAB::ssize.
Referenced by expand_table(), and init_htab().
|
static |
Definition at line 307 of file dynahash.c.
Referenced by hash_create().
|
static |
Definition at line 288 of file dynahash.c.
Referenced by dir_realloc(), DynaHashAlloc(), element_alloc(), hash_create(), init_htab(), and seg_alloc().
|
static |
Definition at line 1860 of file dynahash.c.
Referenced by AtEOSubXact_HashTables(), AtEOXact_HashTables(), deregister_seq_scan(), has_seq_scans(), and register_seq_scan().
|
static |
Definition at line 1859 of file dynahash.c.
Referenced by AtEOSubXact_HashTables(), deregister_seq_scan(), and register_seq_scan().
|
static |
Definition at line 1858 of file dynahash.c.
Referenced by AtEOSubXact_HashTables(), AtEOXact_HashTables(), deregister_seq_scan(), has_seq_scans(), and register_seq_scan().