30 #define GETWORD(x,i) ( *( (BloomSignatureWord *)(x) + ( (i) / SIGNWORDBITS ) ) ) 31 #define CLRBIT(x,i) GETWORD(x,i) &= ~( 0x01 << ( (i) % SIGNWORDBITS ) ) 32 #define SETBIT(x,i) GETWORD(x,i) |= ( 0x01 << ( (i) % SIGNWORDBITS ) ) 33 #define GETBIT(x,i) ( (GETWORD(x,i) >> ( (i) % SIGNWORDBITS )) & 0x01 ) 61 "Length of signature in bits",
64 bl_relopt_tab[0].
optname =
"length";
71 snprintf(buf,
sizeof(buf),
"col%d", i + 1);
73 "Number of bits generated for each index column",
192 elog(
ERROR,
"Relation is not a bloom index");
196 elog(
ERROR,
"Relation is not a bloom index");
240 x = 16807 * lo - 2836 * hi;
301 for (i = 0; i < state->
nColumns; i++)
415 opaque->
flags = flags;
444 metadata->
opts = *opts;
497 return (
bytea *) rdopts;
ambeginscan_function ambeginscan
uint8 amparallelvacuumoptions
#define PG_RETURN_POINTER(x)
#define BLOOM_METAPAGE_BLKNO
#define BUFFER_LOCK_UNLOCK
#define BloomPageIsDeleted(page)
ambulkdelete_function ambulkdelete
IndexBuildResult * blbuild(Relation heap, Relation index, IndexInfo *indexInfo)
FmgrInfo * index_getprocinfo(Relation irel, AttrNumber attnum, uint16 procnum)
amgettuple_function amgettuple
amproperty_function amproperty
static BloomOptions * makeDefaultBloomOptions(void)
#define RELATION_IS_LOCAL(relation)
#define BloomPageIsMeta(page)
FmgrInfo hashFn[INDEX_MAX_KEYS]
amparallelrescan_function amparallelrescan
#define DEFAULT_BLOOM_BITS
void ReleaseBuffer(Buffer buffer)
aminsert_function aminsert
#define BUFFER_LOCK_EXCLUSIVE
PG_FUNCTION_INFO_V1(blhandler)
void add_int_reloption(bits32 kinds, const char *name, const char *desc, int default_val, int min_val, int max_val, LOCKMODE lockmode)
int bitSize[INDEX_MAX_KEYS]
Oid collations[INDEX_MAX_KEYS]
void blcostestimate(PlannerInfo *root, IndexPath *path, double loop_count, Cost *indexStartupCost, Cost *indexTotalCost, Selectivity *indexSelectivity, double *indexCorrelation, double *indexPages)
Page GenericXLogRegisterBuffer(GenericXLogState *state, Buffer buffer, int flags)
amvalidate_function amvalidate
IndexBulkDeleteResult * blvacuumcleanup(IndexVacuumInfo *info, IndexBulkDeleteResult *stats)
void * build_reloptions(Datum reloptions, bool validate, relopt_kind kind, Size relopt_struct_size, const relopt_parse_elt *relopt_elems, int num_relopt_elems)
#define DEFAULT_BLOOM_LENGTH
Buffer BloomNewBuffer(Relation index)
bool blvalidate(Oid opclassoid)
bool blinsert(Relation index, Datum *values, bool *isnull, ItemPointer ht_ctid, Relation heapRel, IndexUniqueCheck checkUnique, bool indexUnchanged, IndexInfo *indexInfo)
void blendscan(IndexScanDesc scan)
uint16 BloomSignatureWord
amgetbitmap_function amgetbitmap
void UnlockReleaseBuffer(Buffer buffer)
#define BloomPageGetOpaque(page)
static relopt_kind bl_relopt_kind
amoptions_function amoptions
void initBloomState(BloomState *state, Relation index)
static relopt_parse_elt bl_relopt_tab[INDEX_MAX_KEYS+1]
void fmgr_info_copy(FmgrInfo *dstinfo, FmgrInfo *srcinfo, MemoryContext destcxt)
amcostestimate_function amcostestimate
#define BloomPageGetFreeSpace(state, page)
IndexBulkDeleteResult * blbulkdelete(IndexVacuumInfo *info, IndexBulkDeleteResult *stats, IndexBulkDeleteCallback callback, void *callback_state)
amvacuumcleanup_function amvacuumcleanup
amendscan_function amendscan
void BloomFillMetapage(Relation index, Page metaPage)
MemoryContext CurrentMemoryContext
#define BloomPageGetTuple(state, page, offset)
int64 blgetbitmap(IndexScanDesc scan, TIDBitmap *tbm)
#define BufferGetPage(buffer)
#define BloomPageGetMeta(page)
amrescan_function amrescan
bool ConditionalLockBuffer(Buffer buffer)
MemoryContext TopMemoryContext
#define BLOOM_NSTRATEGIES
void LockRelationForExtension(Relation relation, LOCKMODE lockmode)
void * palloc0(Size size)
void UnlockRelationForExtension(Relation relation, LOCKMODE lockmode)
void blrescan(IndexScanDesc scan, ScanKey scankey, int nscankeys, ScanKey orderbys, int norderbys)
void signValue(BloomState *state, BloomSignatureWord *sign, Datum value, int attno)
Datum FunctionCall1Coll(FmgrInfo *flinfo, Oid collation, Datum arg1)
void LockBuffer(Buffer buffer, int mode)
void BloomInitMetapage(Relation index)
bool amusemaintenanceworkmem
BlockNumber GetFreeIndexPage(Relation rel)
PageHeaderData * PageHeader
amadjustmembers_function amadjustmembers
#define Assert(condition)
BloomTuple * BloomFormTuple(BloomState *state, ItemPointer iptr, Datum *values, bool *isnull)
static int32 myRand(void)
#define BLOOM_OPTIONS_PROC
XLogRecPtr GenericXLogFinish(GenericXLogState *state)
Buffer ReadBuffer(Relation reln, BlockNumber blockNum)
static void mySrand(uint32 seed)
#define InvalidBlockNumber
ammarkpos_function ammarkpos
ambuildphasename_function ambuildphasename
#define VACUUM_OPTION_PARALLEL_BULKDEL
amestimateparallelscan_function amestimateparallelscan
BloomSignatureWord sign[FLEXIBLE_ARRAY_MEMBER]
void blbuildempty(Relation index)
relopt_kind add_reloption_kind(void)
static Datum values[MAXATTR]
#define AccessExclusiveLock
void BloomInitPage(Page page, uint16 flags)
BlockNumber BufferGetBlockNumber(Buffer buffer)
IndexScanDesc blbeginscan(Relation r, int nkeys, int norderbys)
char * MemoryContextStrdup(MemoryContext context, const char *string)
void * MemoryContextAlloc(MemoryContext context, Size size)
ambuildempty_function ambuildempty
MemoryContext rd_indexcxt
bytea * bloptions(Datum reloptions, bool validate)
#define BUFFER_LOCK_SHARE
bool BloomPageAddItem(BloomState *state, Page page, BloomTuple *tuple)
Datum blhandler(PG_FUNCTION_ARGS)
#define SET_VARSIZE(PTR, len)
struct BloomMetaPageData BloomMetaPageData
#define BLOOM_MAGICK_NUMBER
#define VACUUM_OPTION_PARALLEL_CLEANUP
amcanreturn_function amcanreturn
#define GENERIC_XLOG_FULL_IMAGE
#define offsetof(type, field)
GenericXLogState * GenericXLogStart(Relation relation)
aminitparallelscan_function aminitparallelscan
amrestrpos_function amrestrpos
void PageInit(Page page, Size pageSize, Size specialSize)