PostgreSQL Source Code
git master
|
#include "postgres.h"
#include "access/amapi.h"
#include "access/generic_xlog.h"
#include "access/reloptions.h"
#include "bloom.h"
#include "catalog/index.h"
#include "commands/vacuum.h"
#include "miscadmin.h"
#include "storage/bufmgr.h"
#include "storage/freespace.h"
#include "storage/indexfsm.h"
#include "storage/lmgr.h"
#include "utils/memutils.h"
Go to the source code of this file.
Macros | |
#define | GETWORD(x, i) ( *( (BloomSignatureWord *)(x) + ( (i) / SIGNWORDBITS ) ) ) |
#define | CLRBIT(x, i) GETWORD(x,i) &= ~( 0x01 << ( (i) % SIGNWORDBITS ) ) |
#define | SETBIT(x, i) GETWORD(x,i) |= ( 0x01 << ( (i) % SIGNWORDBITS ) ) |
#define | GETBIT(x, i) ( (GETWORD(x,i) >> ( (i) % SIGNWORDBITS )) & 0x01 ) |
Functions | |
PG_FUNCTION_INFO_V1 (blhandler) | |
static int32 | myRand (void) |
static void | mySrand (uint32 seed) |
void | _PG_init (void) |
static BloomOptions * | makeDefaultBloomOptions (void) |
Datum | blhandler (PG_FUNCTION_ARGS) |
void | initBloomState (BloomState *state, Relation index) |
void | signValue (BloomState *state, BloomSignatureWord *sign, Datum value, int attno) |
BloomTuple * | BloomFormTuple (BloomState *state, ItemPointer iptr, Datum *values, bool *isnull) |
bool | BloomPageAddItem (BloomState *state, Page page, BloomTuple *tuple) |
Buffer | BloomNewBuffer (Relation index) |
void | BloomInitPage (Page page, uint16 flags) |
void | BloomFillMetapage (Relation index, Page metaPage) |
void | BloomInitMetapage (Relation index, ForkNumber forknum) |
bytea * | bloptions (Datum reloptions, bool validate) |
Variables | |
static relopt_kind | bl_relopt_kind |
static relopt_parse_elt | bl_relopt_tab [INDEX_MAX_KEYS+1] |
static int32 | next |
#define GETWORD | ( | x, | |
i | |||
) | ( *( (BloomSignatureWord *)(x) + ( (i) / SIGNWORDBITS ) ) ) |
void _PG_init | ( | void | ) |
Definition at line 52 of file blutils.c.
References AccessExclusiveLock, add_int_reloption(), add_reloption_kind(), bl_relopt_kind, bl_relopt_tab, buf, DEFAULT_BLOOM_BITS, DEFAULT_BLOOM_LENGTH, i, INDEX_MAX_KEYS, MAX_BLOOM_BITS, MAX_BLOOM_LENGTH, MemoryContextStrdup(), relopt_parse_elt::offset, relopt_parse_elt::optname, relopt_parse_elt::opttype, RELOPT_TYPE_INT, snprintf, and TopMemoryContext.
Datum blhandler | ( | PG_FUNCTION_ARGS | ) |
Definition at line 106 of file blutils.c.
References IndexAmRoutine::amadjustmembers, IndexAmRoutine::ambeginscan, IndexAmRoutine::ambuild, IndexAmRoutine::ambuildempty, IndexAmRoutine::ambuildphasename, IndexAmRoutine::ambulkdelete, IndexAmRoutine::amcanbackward, IndexAmRoutine::amcanbuildparallel, IndexAmRoutine::amcaninclude, IndexAmRoutine::amcanmulticol, IndexAmRoutine::amcanorder, IndexAmRoutine::amcanorderbyop, IndexAmRoutine::amcanparallel, IndexAmRoutine::amcanreturn, IndexAmRoutine::amcanunique, IndexAmRoutine::amclusterable, IndexAmRoutine::amcostestimate, IndexAmRoutine::amendscan, IndexAmRoutine::amestimateparallelscan, IndexAmRoutine::amgetbitmap, IndexAmRoutine::amgettreeheight, IndexAmRoutine::amgettuple, IndexAmRoutine::aminitparallelscan, IndexAmRoutine::aminsert, IndexAmRoutine::aminsertcleanup, IndexAmRoutine::amkeytype, IndexAmRoutine::ammarkpos, IndexAmRoutine::amoptionalkey, IndexAmRoutine::amoptions, IndexAmRoutine::amoptsprocnum, IndexAmRoutine::amparallelrescan, IndexAmRoutine::amparallelvacuumoptions, IndexAmRoutine::ampredlocks, IndexAmRoutine::amproperty, IndexAmRoutine::amrescan, IndexAmRoutine::amrestrpos, IndexAmRoutine::amsearcharray, IndexAmRoutine::amsearchnulls, IndexAmRoutine::amstorage, IndexAmRoutine::amstrategies, IndexAmRoutine::amsupport, IndexAmRoutine::amusemaintenanceworkmem, IndexAmRoutine::amvacuumcleanup, IndexAmRoutine::amvalidate, blbeginscan(), blbuild(), blbuildempty(), blbulkdelete(), blcostestimate(), blendscan(), blgetbitmap(), blinsert(), BLOOM_NPROC, BLOOM_NSTRATEGIES, BLOOM_OPTIONS_PROC, bloptions(), blrescan(), blvacuumcleanup(), blvalidate(), InvalidOid, makeNode, PG_RETURN_POINTER, VACUUM_OPTION_PARALLEL_BULKDEL, and VACUUM_OPTION_PARALLEL_CLEANUP.
Definition at line 417 of file blutils.c.
References Assert, BLOOM_MAGICK_NUMBER, BLOOM_META, BloomInitPage(), BloomPageGetMeta, if(), BloomMetaPageData::magickNumber, makeDefaultBloomOptions(), BloomMetaPageData::opts, and opts.
Referenced by BloomInitMetapage().
BloomTuple* BloomFormTuple | ( | BloomState * | state, |
ItemPointer | iptr, | ||
Datum * | values, | ||
bool * | isnull | ||
) |
Definition at line 296 of file blutils.c.
References i, palloc0(), res, signValue(), and values.
Referenced by blinsert(), and bloomBuildCallback().
void BloomInitMetapage | ( | Relation | index, |
ForkNumber | forknum | ||
) |
Definition at line 449 of file blutils.c.
References Assert, BLOOM_METAPAGE_BLKNO, BloomFillMetapage(), BUFFER_LOCK_EXCLUSIVE, BufferGetBlockNumber(), GENERIC_XLOG_FULL_IMAGE, GenericXLogFinish(), GenericXLogRegisterBuffer(), GenericXLogStart(), LockBuffer(), P_NEW, RBM_NORMAL, ReadBufferExtended(), and UnlockReleaseBuffer().
Referenced by blbuild(), and blbuildempty().
Definition at line 402 of file blutils.c.
References BloomPageOpaqueData::bloom_page_id, BLOOM_PAGE_ID, BloomPageGetOpaque, BloomPageOpaqueData::flags, and PageInit().
Referenced by blinsert(), BloomFillMetapage(), and initCachedPage().
Definition at line 356 of file blutils.c.
References BloomPageIsDeleted, BMR_REL, BUFFER_LOCK_UNLOCK, BufferGetPage(), ConditionalLockBuffer(), EB_LOCK_FIRST, ExtendBufferedRel(), GetFreeIndexPage(), InvalidBlockNumber, LockBuffer(), MAIN_FORKNUM, PageIsNew(), ReadBuffer(), and ReleaseBuffer().
Referenced by blinsert(), and flushCachedPage().
bool BloomPageAddItem | ( | BloomState * | state, |
Page | page, | ||
BloomTuple * | tuple | ||
) |
Definition at line 321 of file blutils.c.
References Assert, BloomPageGetFreeSpace, BloomPageGetOpaque, BloomPageGetTuple, BloomPageIsDeleted, BloomPageOpaqueData::maxoff, and PageIsNew().
Referenced by blinsert(), and bloomBuildCallback().
Definition at line 478 of file blutils.c.
References bl_relopt_kind, bl_relopt_tab, BloomOptions::bloomLength, build_reloptions(), lengthof, and SIGNWORDBITS.
Referenced by blhandler().
void initBloomState | ( | BloomState * | state, |
Relation | index | ||
) |
Definition at line 164 of file blutils.c.
References BLOOM_HASH_PROC, BLOOM_MAGICK_NUMBER, BLOOM_METAPAGE_BLKNO, BloomPageGetMeta, BloomPageIsMeta, BLOOMTUPLEHDRSZ, BUFFER_LOCK_SHARE, BufferGetPage(), CurrentMemoryContext, elog, ERROR, fmgr_info_copy(), i, index_getprocinfo(), LockBuffer(), BloomMetaPageData::magickNumber, MemoryContextAlloc(), BloomMetaPageData::opts, opts, ReadBuffer(), and UnlockReleaseBuffer().
Referenced by blbeginscan(), blbuild(), blbulkdelete(), and blinsert().
|
static |
Definition at line 87 of file blutils.c.
References DEFAULT_BLOOM_BITS, DEFAULT_BLOOM_LENGTH, i, INDEX_MAX_KEYS, opts, palloc0(), SET_VARSIZE, and SIGNWORDBITS.
Referenced by BloomFillMetapage().
|
static |
|
static |
PG_FUNCTION_INFO_V1 | ( | blhandler | ) |
void signValue | ( | BloomState * | state, |
BloomSignatureWord * | sign, | ||
Datum | value, | ||
int | attno | ||
) |
Definition at line 263 of file blutils.c.
References DatumGetInt32(), FunctionCall1Coll(), j, myRand(), mySrand(), SETBIT, sign, SIGNWORDBITS, and value.
Referenced by blgetbitmap(), and BloomFormTuple().
|
static |
Definition at line 38 of file blutils.c.
Referenced by _PG_init(), and bloptions().
|
static |
Definition at line 41 of file blutils.c.
Referenced by _PG_init(), and bloptions().
|
static |
Definition at line 222 of file blutils.c.
Referenced by _pglstat64(), _pgstat64(), addItemsToLeaf(), AllocSetDelete(), AllocSetReset(), appendBoolResult(), astreamer_gzip_decompressor_new(), astreamer_lz4_compressor_new(), astreamer_lz4_decompressor_new(), astreamer_recovery_injector_new(), astreamer_tar_archiver_new(), astreamer_tar_parser_new(), astreamer_tar_terminator_new(), astreamer_verify_content_new(), astreamer_zstd_compressor_new(), astreamer_zstd_decompressor_new(), AtEOSubXact_SPI(), AtSubAbort_Snapshot(), bbsink_gzip_new(), bbsink_lz4_new(), bbsink_progress_new(), bbsink_server_new(), bbsink_throttle_new(), bbsink_zstd_new(), CallSubXactCallbacks(), CallXactCallbacks(), deallocate_one(), delete_item_from_bucket(), delete_key_from_bucket(), descriptor_deallocate_all(), do_setval(), doLog(), dsa_trim(), ecpg_register_prepared_stmt(), ecpg_sqlda_align_add_size(), ECPGconnect(), encrypt_init(), encrypt_process(), entry_purge_tuples(), ExecHashTableDetachBatch(), ExecParallelHashNextTuple(), executeKeyValueMethod(), executeNextItem(), executeNumericItemMethod(), extract_jsp_path_expr_nodes(), find_struct(), find_struct_member(), find_variable(), flattenJsonPathParseItem(), FreePageManagerGetInternal(), FreePagePopSpanLeader(), get_nextfield(), get_source_line(), get_typedef(), getNextFlagFromString(), GinDataLeafPageGetItems(), heap_lock_updated_tuple_rec(), infer_arbiter_indexes(), intset_iterate_next(), IssuePendingWritebacks(), LagTrackerRead(), lrq_alloc(), make_new_segment(), merge_children(), myRand(), mySrand(), nextval_internal(), pg_event_trigger_dropped_objects(), pgstat_flush_pending_entries(), pkt_stream_flush(), pkt_stream_process(), plpgsql_destroy_econtext(), plpgsql_subxact_cb(), PostPrepare_smgr(), pqTraceOutputNchar(), prepare_common(), pushf_create(), ReadMultiXactIdRange(), rebin_segment(), RelationPreserveStorage(), ReorderBufferIterTXNNext(), replace_auto_config_value(), ResourceOwnerReleaseInternal(), setCompoundAffixFlagValue(), setval3_oid(), setval_oid(), simple_oid_list_destroy(), simple_ptr_list_destroy(), simple_string_list_destroy(), smgrDoPendingDeletes(), SPI_freetuptable(), StandbyReleaseXidEntryLocks(), unicode_normalize(), unlink_segment(), and unlink_span().