PostgreSQL Source Code
git master
|
#include "postgres.h"
#include "access/brin.h"
#include "access/brin_page.h"
#include "access/brin_pageops.h"
#include "access/brin_xlog.h"
#include "access/relation.h"
#include "access/reloptions.h"
#include "access/relscan.h"
#include "access/table.h"
#include "access/tableam.h"
#include "access/xloginsert.h"
#include "catalog/index.h"
#include "catalog/pg_am.h"
#include "commands/vacuum.h"
#include "miscadmin.h"
#include "pgstat.h"
#include "postmaster/autovacuum.h"
#include "storage/bufmgr.h"
#include "storage/freespace.h"
#include "tcop/tcopprot.h"
#include "utils/acl.h"
#include "utils/datum.h"
#include "utils/fmgrprotos.h"
#include "utils/guc.h"
#include "utils/index_selfuncs.h"
#include "utils/memutils.h"
#include "utils/rel.h"
#include "utils/tuplesort.h"
Go to the source code of this file.
Data Structures | |
struct | BrinShared |
struct | BrinLeader |
struct | BrinBuildState |
struct | BrinInsertState |
struct | BrinOpaque |
Macros | |
#define | PARALLEL_KEY_BRIN_SHARED UINT64CONST(0xB000000000000001) |
#define | PARALLEL_KEY_TUPLESORT UINT64CONST(0xB000000000000002) |
#define | PARALLEL_KEY_QUERY_TEXT UINT64CONST(0xB000000000000003) |
#define | PARALLEL_KEY_WAL_USAGE UINT64CONST(0xB000000000000004) |
#define | PARALLEL_KEY_BUFFER_USAGE UINT64CONST(0xB000000000000005) |
#define | ParallelTableScanFromBrinShared(shared) (ParallelTableScanDesc) ((char *) (shared) + BUFFERALIGN(sizeof(BrinShared))) |
#define | BRIN_ALL_BLOCKRANGES InvalidBlockNumber |
Typedefs | |
typedef struct BrinShared | BrinShared |
typedef struct BrinLeader | BrinLeader |
typedef struct BrinBuildState | BrinBuildState |
typedef struct BrinInsertState | BrinInsertState |
typedef struct BrinOpaque | BrinOpaque |
#define BRIN_ALL_BLOCKRANGES InvalidBlockNumber |
#define PARALLEL_KEY_BRIN_SHARED UINT64CONST(0xB000000000000001) |
#define PARALLEL_KEY_BUFFER_USAGE UINT64CONST(0xB000000000000005) |
#define PARALLEL_KEY_QUERY_TEXT UINT64CONST(0xB000000000000003) |
#define PARALLEL_KEY_TUPLESORT UINT64CONST(0xB000000000000002) |
#define PARALLEL_KEY_WAL_USAGE UINT64CONST(0xB000000000000004) |
#define ParallelTableScanFromBrinShared | ( | shared | ) | (ParallelTableScanDesc) ((char *) (shared) + BUFFERALIGN(sizeof(BrinShared))) |
typedef struct BrinBuildState BrinBuildState |
typedef struct BrinInsertState BrinInsertState |
typedef struct BrinLeader BrinLeader |
typedef struct BrinOpaque BrinOpaque |
typedef struct BrinShared BrinShared |
|
static |
Definition at line 2355 of file brin.c.
References _brin_end_parallel(), _brin_leader_participate_as_worker(), _brin_parallel_estimate_shared(), Assert, BrinLeader::brinshared, BrinBuildState::bs_leader, BrinBuildState::bs_pagesPerRange, BrinLeader::bufferusage, ConditionVariableInit(), CreateParallelContext(), debug_query_string, DestroyParallelContext(), EnterParallelMode(), ParallelContext::estimator, ExitParallelMode(), GetTransactionSnapshot(), BrinShared::heaprelid, BrinShared::indexrelid, BrinShared::indtuples, InitializeParallelDSM(), BrinShared::isconcurrent, IsMVCCSnapshot, LaunchParallelWorkers(), mul_size(), BrinShared::mutex, BrinShared::nparticipantsdone, BrinLeader::nparticipanttuplesorts, ParallelContext::nworkers, ParallelContext::nworkers_launched, BrinShared::pagesPerRange, palloc0(), PARALLEL_KEY_BRIN_SHARED, PARALLEL_KEY_BUFFER_USAGE, PARALLEL_KEY_QUERY_TEXT, PARALLEL_KEY_TUPLESORT, PARALLEL_KEY_WAL_USAGE, ParallelTableScanFromBrinShared, BrinLeader::pcxt, pgstat_get_my_query_id(), BrinShared::queryid, RegisterSnapshot(), RelationGetRelid, BrinShared::reltuples, BrinShared::scantuplesortstates, ParallelContext::seg, BrinLeader::sharedsort, shm_toc_allocate(), shm_toc_estimate_chunk, shm_toc_estimate_keys, shm_toc_insert(), BrinLeader::snapshot, SnapshotAny, SpinLockInit, table_parallelscan_initialize(), ParallelContext::toc, tuplesort_estimate_shared(), tuplesort_initialize_shared(), UnregisterSnapshot(), WaitForParallelWorkersToAttach(), BrinLeader::walusage, and BrinShared::workersdonecv.
Referenced by brinbuild().
|
static |
Definition at line 2540 of file brin.c.
References BrinLeader::bufferusage, DestroyParallelContext(), ExitParallelMode(), i, InstrAccumParallelQuery(), IsMVCCSnapshot, ParallelContext::nworkers_launched, BrinLeader::pcxt, BrinLeader::snapshot, UnregisterSnapshot(), WaitForParallelWorkersToFinish(), and BrinLeader::walusage.
Referenced by _brin_begin_parallel(), and brinbuild().
|
static |
Definition at line 2770 of file brin.c.
References _brin_parallel_scan_and_build(), BrinLeader::brinshared, BrinBuildState::bs_leader, maintenance_work_mem, BrinLeader::nparticipanttuplesorts, and BrinLeader::sharedsort.
Referenced by _brin_begin_parallel().
void _brin_parallel_build_main | ( | dsm_segment * | seg, |
shm_toc * | toc | ||
) |
Definition at line 2855 of file brin.c.
References _brin_parallel_scan_and_build(), AccessExclusiveLock, Assert, debug_query_string, BrinShared::heaprelid, index_close(), index_open(), BrinShared::indexrelid, initialize_brin_buildstate(), InstrEndParallelQuery(), InstrStartParallelQuery(), InvalidBlockNumber, BrinShared::isconcurrent, maintenance_work_mem, MyProc, BrinShared::pagesPerRange, PARALLEL_KEY_BRIN_SHARED, PARALLEL_KEY_BUFFER_USAGE, PARALLEL_KEY_QUERY_TEXT, PARALLEL_KEY_TUPLESORT, PARALLEL_KEY_WAL_USAGE, ParallelWorkerNumber, pgstat_report_activity(), pgstat_report_query_id(), PROC_IN_SAFE_IC, BrinShared::queryid, RowExclusiveLock, BrinShared::scantuplesortstates, ShareLock, ShareUpdateExclusiveLock, shm_toc_lookup(), STATE_RUNNING, PGPROC::statusFlags, table_close(), table_open(), and tuplesort_attach_shared().
Definition at line 2759 of file brin.c.
References add_size(), BUFFERALIGN, and table_parallelscan_estimate().
Referenced by _brin_begin_parallel().
|
static |
Definition at line 2571 of file brin.c.
References ConditionVariableCancelSleep(), ConditionVariableSleep(), BrinShared::indtuples, BrinShared::mutex, BrinShared::nparticipantsdone, BrinShared::reltuples, SpinLockAcquire, SpinLockRelease, and BrinShared::workersdonecv.
Referenced by _brin_parallel_merge().
|
static |
Definition at line 2612 of file brin.c.
References _brin_parallel_heapscan(), ALLOCSET_DEFAULT_SIZES, AllocSetContextCreate, Assert, brin_deform_tuple(), brin_doinsert(), brin_fill_empty_ranges(), brin_form_tuple(), brin_new_memtuple(), BrinMemTuple::bt_blkno, BrinTuple::bt_blkno, CurrentMemoryContext, InvalidBlockNumber, len, MemoryContextDelete(), MemoryContextReset(), MemoryContextSwitchTo(), pfree(), tuplesort_end(), tuplesort_getbrintuple(), tuplesort_performsort(), and union_tuples().
Referenced by brinbuild().
|
static |
Definition at line 2798 of file brin.c.
References brinbuildCallbackParallel(), BuildIndexInfo(), ConditionVariableSignal(), form_and_spill_tuple(), IndexInfo::ii_Concurrent, BrinShared::indtuples, BrinShared::isconcurrent, SortCoordinateData::isWorker, BrinShared::mutex, SortCoordinateData::nParticipants, BrinShared::nparticipantsdone, palloc0(), ParallelTableScanFromBrinShared, BrinShared::reltuples, SortCoordinateData::sharedsort, SpinLockAcquire, SpinLockRelease, table_beginscan_parallel(), table_index_build_scan(), tuplesort_begin_index_brin(), tuplesort_end(), TUPLESORT_NONE, tuplesort_performsort(), and BrinShared::workersdonecv.
Referenced by _brin_leader_participate_as_worker(), and _brin_parallel_build_main().
|
static |
Definition at line 2197 of file brin.c.
References Assert, BrinDesc::bd_info, BrinDesc::bd_tupdesc, BRIN_PROCNUM_ADDVALUE, BrinMemTuple::bt_columns, BrinMemTuple::bt_empty_range, BrinValues::bv_allnulls, BrinValues::bv_hasnulls, DatumGetBool(), FunctionCall4Coll(), index_getprocinfo(), TupleDescData::natts, BrinOpcInfo::oi_regular_nulls, PointerGetDatum(), RelationData::rd_indcollation, and values.
Referenced by brinbuildCallback(), brinbuildCallbackParallel(), and brininsert().
Definition at line 1573 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(), initialize_brin_buildstate(), and initialize_brin_insertstate().
|
static |
Definition at line 2948 of file brin.c.
References brin_form_tuple(), brin_new_memtuple(), and MemoryContextSwitchTo().
Referenced by brin_fill_empty_ranges().
Datum brin_desummarize_range | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1483 of file brin.c.
References aclcheck_error(), ACLCHECK_NOT_OWNER, brinRevmapDesummarizeRange(), DEBUG1, ereport, errcode(), ERRCODE_UNDEFINED_TABLE, errhint(), errmsg(), ERROR, GetUserId(), index_open(), IndexGetRelation(), MaxBlockNumber, OBJECT_INDEX, object_ownercheck(), OidIsValid, PG_GETARG_INT64, PG_GETARG_OID, PG_RETURN_VOID, RelationData::rd_index, RelationData::rd_rel, RecoveryInProgress(), relation_close(), RelationGetRelationName, ShareUpdateExclusiveLock, and table_open().
|
static |
Definition at line 2985 of file brin.c.
References brin_build_empty_tuple(), brin_doinsert(), and InvalidBlockNumber.
Referenced by _brin_parallel_merge(), and brinbuild().
void brin_free_desc | ( | BrinDesc * | bdesc | ) |
Definition at line 1628 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().
Datum brin_summarize_new_values | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1357 of file brin.c.
References BRIN_ALL_BLOCKRANGES, brin_summarize_range(), DirectFunctionCall2, Int64GetDatum(), and PG_GETARG_DATUM.
Datum brin_summarize_range | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1372 of file brin.c.
References aclcheck_error(), ACLCHECK_NOT_OWNER, AtEOXact_GUC(), BRIN_ALL_BLOCKRANGES, brinsummarize(), DEBUG1, ereport, errcode(), ERRCODE_UNDEFINED_TABLE, errhint(), errmsg(), ERROR, GetUserIdAndSecContext(), index_open(), IndexGetRelation(), InvalidOid, NewGUCNestLevel(), OBJECT_INDEX, object_ownercheck(), OidIsValid, PG_GETARG_INT64, PG_GETARG_OID, PG_RETURN_INT32, RelationData::rd_index, RelationData::rd_rel, RecoveryInProgress(), relation_close(), RelationGetRelationName, RestrictSearchPath(), SECURITY_RESTRICTED_OPERATION, SetUserIdAndSecContext(), ShareUpdateExclusiveLock, and table_open().
Referenced by brin_summarize_new_values(), and perform_work_item().
|
static |
Definition at line 2164 of file brin.c.
References brin_page_cleanup(), buf, CHECK_FOR_INTERRUPTS, FreeSpaceMapVacuum(), MAIN_FORKNUM, RBM_NORMAL, ReadBufferExtended(), RelationGetNumberOfBlocks, and ReleaseBuffer().
Referenced by brinvacuumcleanup().
IndexScanDesc brinbeginscan | ( | Relation | r, |
int | nkeys, | ||
int | norderbys | ||
) |
Definition at line 532 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, | ||
IndexInfo * | indexInfo | ||
) |
Definition at line 1096 of file brin.c.
References _brin_begin_parallel(), _brin_end_parallel(), _brin_parallel_merge(), Assert, BMR_REL, BRIN_CURRENT_VERSION, brin_fill_empty_ranges(), 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, IndexInfo::ii_Concurrent, IndexInfo::ii_ParallelWorkers, IndexBuildResult::index_tuples, initialize_brin_buildstate(), SortCoordinateData::isWorker, MAIN_FORKNUM, maintenance_work_mem, MarkBufferDirty(), SortCoordinateData::nParticipants, PageSetLSN(), xl_brin_createidx::pagesPerRange, palloc0(), palloc_object, REGBUF_STANDARD, REGBUF_WILL_INIT, RelationGetNumberOfBlocks, RelationGetRelationName, RelationNeedsWAL, SortCoordinateData::sharedsort, SizeOfBrinCreateIdx, table_index_build_scan(), terminate_brin_buildstate(), tuplesort_begin_index_brin(), TUPLESORT_NONE, UnlockReleaseBuffer(), xl_brin_createidx::version, XLOG_BRIN_CREATE_INDEX, XLogBeginInsert(), XLogInsert(), XLogRegisterBuffer(), and XLogRegisterData().
Referenced by brinhandler().
|
static |
Definition at line 986 of file brin.c.
References add_values_to_range(), BRIN_elog, brin_memtuple_initialize(), DEBUG2, form_and_insert_tuple(), ItemPointerGetBlockNumber(), and values.
Referenced by brinbuild(), and summarize_range().
|
static |
Definition at line 1037 of file brin.c.
References add_values_to_range(), BRIN_elog, brin_memtuple_initialize(), DEBUG2, form_and_spill_tuple(), ItemPointerGetBlockNumber(), and values.
Referenced by _brin_parallel_scan_and_build().
void brinbuildempty | ( | Relation | index | ) |
Definition at line 1265 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 1294 of file brin.c.
References palloc0_object.
Referenced by brinhandler().
void brinendscan | ( | IndexScanDesc | scan | ) |
Definition at line 969 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 560 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(), MemoryContextReset(), 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(), size, ScanKeyData::sk_collation, SK_ISNULL, table_close(), table_open(), tbm_add_page(), and TupleDescAttr.
Referenced by brinhandler().
void brinGetStats | ( | Relation | index, |
BrinStatsData * | stats | ||
) |
Definition at line 1640 of file brin.c.
References BRIN_METAPAGE_BLKNO, BUFFER_LOCK_SHARE, BufferGetPage(), BrinMetaPageData::lastRevmapPage, LockBuffer(), PageGetContents(), BrinStatsData::pagesPerRange, BrinMetaPageData::pagesPerRange, ReadBuffer(), BrinStatsData::revmapNumPages, and UnlockReleaseBuffer().
Referenced by brincostestimate().
Datum brinhandler | ( | PG_FUNCTION_ARGS | ) |
Definition at line 250 of file brin.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::amsummarizing, IndexAmRoutine::amsupport, IndexAmRoutine::amusemaintenanceworkmem, IndexAmRoutine::amvacuumcleanup, IndexAmRoutine::amvalidate, BRIN_LAST_OPTIONAL_PROCNUM, BRIN_PROCNUM_OPTIONS, brinbeginscan(), brinbuild(), brinbuildempty(), brinbulkdelete(), brincostestimate(), brinendscan(), bringetbitmap(), brininsert(), brininsertcleanup(), brinoptions(), brinrescan(), brinvacuumcleanup(), brinvalidate(), InvalidOid, makeNode, PG_RETURN_POINTER, and VACUUM_OPTION_PARALLEL_CLEANUP.
bool brininsert | ( | Relation | idxRel, |
Datum * | values, | ||
bool * | nulls, | ||
ItemPointer | heaptid, | ||
Relation | heapRel, | ||
IndexUniqueCheck | checkUnique, | ||
bool | indexUnchanged, | ||
IndexInfo * | indexInfo | ||
) |
Definition at line 339 of file brin.c.
References add_values_to_range(), ALLOCSET_DEFAULT_SIZES, AllocSetContextCreate, AutoVacuumRequestWork(), AVW_BRINSummarizeRange, BrinInsertState::bis_desc, BrinInsertState::bis_pages_per_range, BrinInsertState::bis_rmAccess, brin_can_do_samepage_update(), brin_copy_tuple(), brin_deform_tuple(), brin_doupdate(), brin_form_tuple(), BrinGetAutoSummarize, brinGetTupleForHeapBlock(), buf, BUFFER_LOCK_SHARE, BUFFER_LOCK_UNLOCK, BufferGetPage(), BufferIsValid(), CHECK_FOR_INTERRUPTS, CurrentMemoryContext, ereport, errcode(), errmsg(), FirstOffsetNumber, IndexInfo::ii_AmCache, initialize_brin_insertstate(), InvalidBuffer, ItemIdGetLength, ItemPointerGetBlockNumber(), ItemPointerGetOffsetNumber(), LockBuffer(), LOG, MemoryContextDelete(), MemoryContextReset(), MemoryContextSwitchTo(), PageGetItemId(), RelationGetRelationName, RelationGetRelid, ReleaseBuffer(), and values.
Referenced by brinhandler().
Definition at line 507 of file brin.c.
References BrinInsertState::bis_desc, BrinInsertState::bis_rmAccess, brinRevmapTerminate(), if(), and IndexInfo::ii_AmCache.
Referenced by brinhandler().
Definition at line 1339 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 950 of file brin.c.
References IndexScanDescData::keyData, and IndexScanDescData::numberOfKeys.
Referenced by brinhandler().
|
static |
Definition at line 1879 of file brin.c.
References Assert, BRIN_ALL_BLOCKRANGES, brin_memtuple_initialize(), brinGetTupleForHeapBlock(), brinRevmapInitialize(), brinRevmapTerminate(), buf, BUFFER_LOCK_SHARE, BUFFER_LOCK_UNLOCK, BufferIsValid(), BuildIndexInfo(), CHECK_FOR_INTERRUPTS, initialize_brin_buildstate(), InvalidBlockNumber, InvalidBuffer, LockBuffer(), Min, pfree(), RelationGetNumberOfBlocks, ReleaseBuffer(), summarize_range(), and terminate_brin_buildstate().
Referenced by brin_summarize_range(), and brinvacuumcleanup().
IndexBulkDeleteResult* brinvacuumcleanup | ( | IndexVacuumInfo * | info, |
IndexBulkDeleteResult * | stats | ||
) |
Definition at line 1309 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().
|
static |
Definition at line 2291 of file brin.c.
References Assert, BrinValues::bv_allnulls, BrinValues::bv_attno, BrinValues::bv_hasnulls, sort-test::key, SK_ISNULL, SK_SEARCHNOTNULL, and SK_SEARCHNULL.
Referenced by bringetbitmap().
|
static |
Definition at line 1977 of file brin.c.
References brin_doinsert(), brin_form_tuple(), pfree(), and size.
Referenced by brinbuild(), and brinbuildCallback().
|
static |
Definition at line 1998 of file brin.c.
References brin_form_tuple(), pfree(), size, and tuplesort_putbrintuple().
Referenced by _brin_parallel_scan_and_build(), and brinbuildCallbackParallel().
|
static |
Definition at line 1661 of file brin.c.
References brin_build_desc(), brin_new_memtuple(), CurrentMemoryContext, InvalidBuffer, and palloc_object.
Referenced by _brin_parallel_build_main(), brinbuild(), and brinsummarize().
|
static |
Definition at line 310 of file brin.c.
References BrinInsertState::bis_desc, BrinInsertState::bis_pages_per_range, BrinInsertState::bis_rmAccess, brin_build_desc(), brinRevmapInitialize(), IndexInfo::ii_AmCache, IndexInfo::ii_Context, MemoryContextSwitchTo(), and palloc0().
Referenced by brininsert().
|
static |
Definition at line 1753 of file brin.c.
References Assert, brin_can_do_samepage_update(), brin_copy_tuple(), brin_doinsert(), brin_doupdate(), brin_form_placeholder_tuple(), brin_form_tuple(), brin_free_tuple(), brinbuildCallback(), brinGetTupleForHeapBlock(), BUFFER_LOCK_SHARE, BUFFER_LOCK_UNLOCK, CHECK_FOR_INTERRUPTS, elog, ERROR, InvalidBuffer, LockBuffer(), Min, RelationGetNumberOfBlocks, ReleaseBuffer(), table_index_build_range_scan(), and union_tuples().
Referenced by brinsummarize().
|
static |
Definition at line 1708 of file brin.c.
References brin_free_desc(), BufferGetBlockNumber(), BufferGetPage(), BufferIsInvalid, FreeSpaceMapVacuumRange(), PageGetFreeSpace(), pfree(), RecordPageWithFreeSpace(), and ReleaseBuffer().
Referenced by brinbuild(), and brinsummarize().
|
static |
Definition at line 2023 of file brin.c.
References a, ALLOCSET_DEFAULT_SIZES, AllocSetContextCreate, b, BrinDesc::bd_index, BrinDesc::bd_info, BrinDesc::bd_tupdesc, brin_deform_tuple(), BRIN_PROCNUM_UNION, BrinMemTuple::bt_columns, BrinMemTuple::bt_empty_range, BrinValues::bv_allnulls, BrinValues::bv_hasnulls, BrinValues::bv_values, CurrentMemoryContext, datumCopy(), FunctionCall3Coll(), i, index_getprocinfo(), MemoryContextDelete(), MemoryContextSwitchTo(), TupleDescData::natts, BrinOpcInfo::oi_nstored, BrinOpcInfo::oi_regular_nulls, BrinOpcInfo::oi_typcache, PointerGetDatum(), RelationData::rd_indcollation, TypeCacheEntry::typbyval, and TypeCacheEntry::typlen.
Referenced by _brin_parallel_merge(), and summarize_range().