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