PostgreSQL Source Code
git master
|
Go to the source code of this file.
Data Structures | |
struct | BrinOpcInfo |
struct | BrinDesc |
Macros | |
#define | SizeofBrinOpcInfo(ncols) (offsetof(BrinOpcInfo, oi_typcache) + sizeof(TypeCacheEntry *) * ncols) |
#define | BRIN_PROCNUM_OPCINFO 1 |
#define | BRIN_PROCNUM_ADDVALUE 2 |
#define | BRIN_PROCNUM_CONSISTENT 3 |
#define | BRIN_PROCNUM_UNION 4 |
#define | BRIN_MANDATORY_NPROCS 4 |
#define | BRIN_PROCNUM_OPTIONS 5 /* optional */ |
#define | BRIN_FIRST_OPTIONAL_PROCNUM 11 |
#define | BRIN_LAST_OPTIONAL_PROCNUM 15 |
#define | BRIN_elog(args) ((void) 0) |
Typedefs | |
typedef struct BrinOpcInfo | BrinOpcInfo |
typedef struct BrinDesc | BrinDesc |
Functions | |
BrinDesc * | brin_build_desc (Relation rel) |
void | brin_free_desc (BrinDesc *bdesc) |
IndexBuildResult * | brinbuild (Relation heap, Relation index, struct IndexInfo *indexInfo) |
void | brinbuildempty (Relation index) |
bool | brininsert (Relation idxRel, Datum *values, bool *nulls, ItemPointer heaptid, Relation heapRel, IndexUniqueCheck checkUnique, bool indexUnchanged, struct IndexInfo *indexInfo) |
IndexScanDesc | brinbeginscan (Relation r, int nkeys, int norderbys) |
int64 | bringetbitmap (IndexScanDesc scan, TIDBitmap *tbm) |
void | brinrescan (IndexScanDesc scan, ScanKey scankey, int nscankeys, ScanKey orderbys, int norderbys) |
void | brinendscan (IndexScanDesc scan) |
IndexBulkDeleteResult * | brinbulkdelete (IndexVacuumInfo *info, IndexBulkDeleteResult *stats, IndexBulkDeleteCallback callback, void *callback_state) |
IndexBulkDeleteResult * | brinvacuumcleanup (IndexVacuumInfo *info, IndexBulkDeleteResult *stats) |
bytea * | brinoptions (Datum reloptions, bool validate) |
bool | brinvalidate (Oid opclassoid) |
#define BRIN_elog | ( | args | ) | ((void) 0) |
Definition at line 85 of file brin_internal.h.
#define BRIN_FIRST_OPTIONAL_PROCNUM 11 |
Definition at line 77 of file brin_internal.h.
#define BRIN_LAST_OPTIONAL_PROCNUM 15 |
Definition at line 78 of file brin_internal.h.
#define BRIN_MANDATORY_NPROCS 4 |
Definition at line 74 of file brin_internal.h.
#define BRIN_PROCNUM_ADDVALUE 2 |
Definition at line 71 of file brin_internal.h.
#define BRIN_PROCNUM_CONSISTENT 3 |
Definition at line 72 of file brin_internal.h.
#define BRIN_PROCNUM_OPCINFO 1 |
Definition at line 70 of file brin_internal.h.
#define BRIN_PROCNUM_OPTIONS 5 /* optional */ |
Definition at line 75 of file brin_internal.h.
#define BRIN_PROCNUM_UNION 4 |
Definition at line 73 of file brin_internal.h.
#define SizeofBrinOpcInfo | ( | ncols | ) | (offsetof(BrinOpcInfo, oi_typcache) + sizeof(TypeCacheEntry *) * ncols) |
Definition at line 41 of file brin_internal.h.
typedef struct BrinOpcInfo BrinOpcInfo |
Definition at line 1203 of file brin.c.
References ALLOCSET_SMALL_SIZES, AllocSetContextCreate, BrinDesc::bd_context, BrinDesc::bd_disktdesc, BrinDesc::bd_index, BrinDesc::bd_info, BrinDesc::bd_totalstored, BrinDesc::bd_tupdesc, BRIN_PROCNUM_OPCINFO, CurrentMemoryContext, DatumGetPointer(), FunctionCall1, index_getprocinfo(), MemoryContextSwitchTo(), TupleDescData::natts, BrinOpcInfo::oi_nstored, palloc(), palloc_array, pfree(), RelationGetDescr, and TupleDescAttr.
Referenced by brin_page_items(), brinbeginscan(), brininsert(), and initialize_brin_buildstate().
void brin_free_desc | ( | BrinDesc * | bdesc | ) |
Definition at line 1258 of file brin.c.
References Assert(), BrinDesc::bd_context, BrinDesc::bd_tupdesc, MemoryContextDelete(), and TupleDescData::tdrefcount.
Referenced by brin_page_items(), brinendscan(), and terminate_brin_buildstate().
IndexScanDesc brinbeginscan | ( | Relation | r, |
int | nkeys, | ||
int | norderbys | ||
) |
Definition at line 327 of file brin.c.
References BrinOpaque::bo_bdesc, BrinOpaque::bo_pagesPerRange, BrinOpaque::bo_rmAccess, brin_build_desc(), brinRevmapInitialize(), IndexScanDescData::opaque, palloc_object, and RelationGetIndexScan().
Referenced by brinhandler().
IndexBuildResult* brinbuild | ( | Relation | heap, |
Relation | index, | ||
struct IndexInfo * | indexInfo | ||
) |
Definition at line 827 of file brin.c.
References Assert(), BMR_REL, BRIN_CURRENT_VERSION, BRIN_METAPAGE_BLKNO, brin_metapage_init(), brinbuildCallback(), BrinGetPagesPerRange, brinRevmapInitialize(), brinRevmapTerminate(), BufferGetBlockNumber(), BufferGetPage(), EB_LOCK_FIRST, EB_SKIP_EXTENSION_LOCK, elog(), ERROR, ExtendBufferedRel(), form_and_insert_tuple(), IndexBuildResult::heap_tuples, IndexBuildResult::index_tuples, initialize_brin_buildstate(), MAIN_FORKNUM, MarkBufferDirty(), PageSetLSN(), xl_brin_createidx::pagesPerRange, palloc_object, REGBUF_STANDARD, REGBUF_WILL_INIT, RelationGetNumberOfBlocks, RelationGetRelationName, RelationNeedsWAL, SizeOfBrinCreateIdx, table_index_build_scan(), terminate_brin_buildstate(), UnlockReleaseBuffer(), xl_brin_createidx::version, XLOG_BRIN_CREATE_INDEX, XLogBeginInsert(), XLogInsert(), XLogRegisterBuffer(), and XLogRegisterData().
Referenced by brinhandler().
void brinbuildempty | ( | Relation | index | ) |
Definition at line 911 of file brin.c.
References BMR_REL, BRIN_CURRENT_VERSION, brin_metapage_init(), BrinGetPagesPerRange, BufferGetPage(), EB_LOCK_FIRST, EB_SKIP_EXTENSION_LOCK, END_CRIT_SECTION, ExtendBufferedRel(), INIT_FORKNUM, log_newpage_buffer(), MarkBufferDirty(), START_CRIT_SECTION, and UnlockReleaseBuffer().
Referenced by brinhandler().
IndexBulkDeleteResult* brinbulkdelete | ( | IndexVacuumInfo * | info, |
IndexBulkDeleteResult * | stats, | ||
IndexBulkDeleteCallback | callback, | ||
void * | callback_state | ||
) |
Definition at line 940 of file brin.c.
References palloc0_object.
Referenced by brinhandler().
void brinendscan | ( | IndexScanDesc | scan | ) |
Definition at line 765 of file brin.c.
References BrinOpaque::bo_bdesc, BrinOpaque::bo_rmAccess, brin_free_desc(), brinRevmapTerminate(), IndexScanDescData::opaque, and pfree().
Referenced by brinhandler().
int64 bringetbitmap | ( | IndexScanDesc | scan, |
TIDBitmap * | tbm | ||
) |
Definition at line 355 of file brin.c.
References AccessShareLock, addrange(), ALLOCSET_DEFAULT_SIZES, AllocSetContextCreate, Assert(), BrinDesc::bd_info, BrinDesc::bd_tupdesc, BrinOpaque::bo_bdesc, BrinOpaque::bo_pagesPerRange, BrinOpaque::bo_rmAccess, brin_copy_tuple(), brin_deform_tuple(), brin_new_memtuple(), BRIN_PROCNUM_CONSISTENT, brinGetTupleForHeapBlock(), BrinMemTuple::bt_columns, BrinMemTuple::bt_empty_range, BrinMemTuple::bt_placeholder, buf, BUFFER_LOCK_SHARE, BUFFER_LOCK_UNLOCK, BrinValues::bv_allnulls, CHECK_FOR_INTERRUPTS, check_null_keys(), CurrentMemoryContext, DatumGetBool(), fmgr_info_copy(), FunctionCall3Coll(), FunctionCall4Coll(), i, index_getprocinfo(), IndexGetRelation(), IndexScanDescData::indexRelation, Int32GetDatum(), InvalidBuffer, InvalidOid, sort-test::key, IndexScanDescData::keyData, len, LockBuffer(), MAXALIGN, MemoryContextDelete(), MemoryContextResetAndDeleteChildren, MemoryContextSwitchTo(), Min, TupleDescData::natts, IndexScanDescData::numberOfKeys, BrinOpcInfo::oi_regular_nulls, IndexScanDescData::opaque, palloc(), palloc0_array, PG_USED_FOR_ASSERTS_ONLY, pgstat_count_index_scan, PointerGetDatum(), RelationGetNumberOfBlocks, RelationGetRelid, ReleaseBuffer(), ScanKeyData::sk_collation, SK_ISNULL, table_close(), table_open(), tbm_add_page(), and TupleDescAttr.
Referenced by brinhandler().
bool brininsert | ( | Relation | idxRel, |
Datum * | values, | ||
bool * | nulls, | ||
ItemPointer | heaptid, | ||
Relation | heapRel, | ||
IndexUniqueCheck | checkUnique, | ||
bool | indexUnchanged, | ||
struct IndexInfo * | indexInfo | ||
) |
Definition at line 156 of file brin.c.
References add_values_to_range(), ALLOCSET_DEFAULT_SIZES, AllocSetContextCreate, AutoVacuumRequestWork(), AVW_BRINSummarizeRange, brin_build_desc(), brin_can_do_samepage_update(), brin_copy_tuple(), brin_deform_tuple(), brin_doupdate(), brin_form_tuple(), BrinGetAutoSummarize, brinGetTupleForHeapBlock(), brinRevmapInitialize(), brinRevmapTerminate(), buf, BUFFER_LOCK_SHARE, BUFFER_LOCK_UNLOCK, BufferGetPage(), BufferIsValid(), CHECK_FOR_INTERRUPTS, CurrentMemoryContext, ereport, errcode(), errmsg(), FirstOffsetNumber, IndexInfo::ii_AmCache, IndexInfo::ii_Context, InvalidBuffer, ItemIdGetLength, ItemPointerGetBlockNumber(), ItemPointerGetOffsetNumber(), LockBuffer(), LOG, MemoryContextDelete(), MemoryContextResetAndDeleteChildren, MemoryContextSwitchTo(), PageGetItemId(), RelationGetRelationName, RelationGetRelid, ReleaseBuffer(), and values.
Referenced by brinhandler().
Definition at line 985 of file brin.c.
References build_reloptions(), lengthof, RELOPT_KIND_BRIN, RELOPT_TYPE_BOOL, and RELOPT_TYPE_INT.
Referenced by brinhandler().
void brinrescan | ( | IndexScanDesc | scan, |
ScanKey | scankey, | ||
int | nscankeys, | ||
ScanKey | orderbys, | ||
int | norderbys | ||
) |
Definition at line 745 of file brin.c.
References IndexScanDescData::keyData, and IndexScanDescData::numberOfKeys.
Referenced by brinhandler().
IndexBulkDeleteResult* brinvacuumcleanup | ( | IndexVacuumInfo * | info, |
IndexBulkDeleteResult * | stats | ||
) |
Definition at line 955 of file brin.c.
References AccessShareLock, IndexVacuumInfo::analyze_only, BRIN_ALL_BLOCKRANGES, brin_vacuum_scan(), brinsummarize(), IndexVacuumInfo::index, IndexGetRelation(), IndexBulkDeleteResult::num_index_tuples, IndexBulkDeleteResult::num_pages, palloc0_object, RelationGetNumberOfBlocks, RelationGetRelid, IndexVacuumInfo::strategy, table_close(), and table_open().
Referenced by brinhandler().
Definition at line 37 of file brin_validate.c.
References AMOPSTRATEGY, AMPROCNUM, BRIN_FIRST_OPTIONAL_PROCNUM, BRIN_LAST_OPTIONAL_PROCNUM, BRIN_MANDATORY_NPROCS, BRIN_PROCNUM_ADDVALUE, BRIN_PROCNUM_CONSISTENT, BRIN_PROCNUM_OPCINFO, BRIN_PROCNUM_OPTIONS, BRIN_PROCNUM_UNION, check_amop_signature(), check_amoptsproc_signature(), check_amproc_signature(), CLAOID, elog(), ereport, errcode(), errmsg(), ERROR, format_operator(), format_procedure(), format_type_be(), OpFamilyOpFuncGroup::functionset, GETSTRUCT, HeapTupleIsValid, i, identify_opfamily_groups(), INFO, OpFamilyOpFuncGroup::lefttype, lfirst, catclist::members, catclist::n_members, NameStr, ObjectIdGetDatum(), OidIsValid, OpFamilyOpFuncGroup::operatorset, OPFAMILYOID, ReleaseCatCacheList(), ReleaseSysCache(), OpFamilyOpFuncGroup::righttype, SearchSysCache1(), SearchSysCacheList1, and catctup::tuple.
Referenced by brinhandler().