39#include "utils/fmgrprotos.h"
47#define PARALLEL_KEY_BRIN_SHARED UINT64CONST(0xB000000000000001)
48#define PARALLEL_KEY_TUPLESORT UINT64CONST(0xB000000000000002)
49#define PARALLEL_KEY_QUERY_TEXT UINT64CONST(0xB000000000000003)
50#define PARALLEL_KEY_WAL_USAGE UINT64CONST(0xB000000000000004)
51#define PARALLEL_KEY_BUFFER_USAGE UINT64CONST(0xB000000000000005)
116#define ParallelTableScanFromBrinShared(shared) \
117 (ParallelTableScanDesc) ((char *) (shared) + BUFFERALIGN(sizeof(BrinShared)))
209#define BRIN_ALL_BLOCKRANGES InvalidBlockNumber
218 bool include_partial,
double *numSummarized,
double *numExisting);
232 bool isconcurrent,
int request);
377 heapBlk = (origHeapBlk / pagesPerRange) * pagesPerRange;
381 bool need_insert =
false;
395 heapBlk == origHeapBlk &&
413 (
errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED),
414 errmsg(
"request for BRIN range summarization for index \"%s\" page %u was not recorded",
486 buf, off, origtup, origsz, newtup, newsz,
577 int64 totalpages = 0;
652 nnullkeys = (
int *) ptr;
671 for (
int keyno = 0; keyno < scan->
numberOfKeys; keyno++)
682 (
key->sk_collation ==
684 keyattno - 1)->attcollation));
696 if (consistentFn[keyattno - 1].fn_oid ==
InvalidOid)
701 Assert(nkeys[keyattno - 1] == 0);
702 Assert(nnullkeys[keyattno - 1] == 0);
713 nullkeys[keyattno - 1][nnullkeys[keyattno - 1]] =
key;
714 nnullkeys[keyattno - 1]++;
718 keys[keyattno - 1][nkeys[keyattno - 1]] =
key;
719 nkeys[keyattno - 1]++;
743 bool gottuple =
false;
802 if (nkeys[attno - 1] == 0 && nnullkeys[attno - 1] == 0)
828 nnullkeys[attno - 1]))
848 if (!nkeys[attno - 1])
851 Assert((nkeys[attno - 1] > 0) &&
878 if (consistentFn[attno - 1].fn_nargs >= 4)
901 for (keyno = 0; keyno < nkeys[attno - 1]; keyno++)
904 keys[attno - 1][keyno]->sk_collation,
929 for (pageno = heapBlk;
952 return totalpages * 10;
960 ScanKey orderbys,
int norderbys)
1013 while (thisblock >
state->bs_currRangeStart +
state->bs_pagesPerRange - 1)
1017 "brinbuildCallback: completed a range: %u--%u",
1018 state->bs_currRangeStart,
1019 state->bs_currRangeStart +
state->bs_pagesPerRange));
1025 state->bs_currRangeStart +=
state->bs_pagesPerRange;
1069 if ((thisblock < state->bs_currRangeStart) ||
1070 (thisblock >
state->bs_currRangeStart +
state->bs_pagesPerRange - 1))
1074 "brinbuildCallbackParallel: completed a range: %u--%u",
1075 state->bs_currRangeStart,
1076 state->bs_currRangeStart +
state->bs_pagesPerRange));
1089 state->bs_currRangeStart
1090 =
state->bs_pagesPerRange * (thisblock /
state->bs_pagesPerRange);
1119 elog(
ERROR,
"index \"%s\" already contains data",
1184 if (
state->bs_leader)
1191 state->bs_leader->nparticipanttuplesorts;
1216 state->bs_sortstate =
1253 state->bs_currRangeStart,
1254 state->bs_maxRangeStart);
1258 idxtuples =
state->bs_numtuples;
1390 int save_sec_context;
1392 double numSummarized = 0;
1396 (
errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
1397 errmsg(
"recovery is in progress"),
1398 errhint(
"BRIN control functions cannot be executed during recovery.")));
1402 (
errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE),
1403 errmsg(
"block number out of range: %" PRId64, heapBlk64)));
1436 save_sec_context = -1;
1437 save_nestlevel = -1;
1443 if (indexRel->
rd_rel->relkind != RELKIND_INDEX ||
1444 indexRel->
rd_rel->relam != BRIN_AM_OID)
1446 (
errcode(ERRCODE_WRONG_OBJECT_TYPE),
1447 errmsg(
"\"%s\" is not a BRIN index",
1451 if (heapRel != NULL && !
object_ownercheck(RelationRelationId, indexoid, save_userid))
1463 errmsg(
"could not open parent table of index \"%s\"",
1467 if (indexRel->
rd_index->indisvalid)
1468 brinsummarize(indexRel, heapRel, heapBlk,
true, &numSummarized, NULL);
1471 (
errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
1472 errmsg(
"index \"%s\" is not valid",
1503 (
errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
1504 errmsg(
"recovery is in progress"),
1505 errhint(
"BRIN control functions cannot be executed during recovery.")));
1509 (
errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE),
1510 errmsg(
"block number out of range: %" PRId64,
1532 if (indexRel->
rd_rel->relkind != RELKIND_INDEX ||
1533 indexRel->
rd_rel->relam != BRIN_AM_OID)
1535 (
errcode(ERRCODE_WRONG_OBJECT_TYPE),
1536 errmsg(
"\"%s\" is not a BRIN index",
1552 errmsg(
"could not open parent table of index \"%s\"",
1556 if (indexRel->
rd_index->indisvalid)
1567 (
errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
1568 errmsg(
"index \"%s\" is not valid",
1586 int totalstored = 0;
1603 for (keyno = 0; keyno < tupdesc->
natts; keyno++)
1616 totalsize = offsetof(
BrinDesc, bd_info) +
1619 bdesc =
palloc(totalsize);
1626 for (keyno = 0; keyno < tupdesc->
natts; keyno++)
1627 bdesc->
bd_info[keyno] = opcinfo[keyno];
1677 state->bs_irel = idxRel;
1678 state->bs_numtuples = 0;
1679 state->bs_reltuples = 0;
1681 state->bs_pagesPerRange = pagesPerRange;
1682 state->bs_currRangeStart = 0;
1683 state->bs_rmAccess = revmap;
1686 state->bs_leader = NULL;
1687 state->bs_worker_id = 0;
1688 state->bs_sortstate = NULL;
1690 state->bs_emptyTuple = NULL;
1691 state->bs_emptyTupleLen = 0;
1695 state->bs_emptyTuple = NULL;
1696 state->bs_emptyTupleLen = 0;
1704 lastRange = ((tablePages - 1) / pagesPerRange) * pagesPerRange;
1707 state->bs_maxRangeStart = lastRange +
state->bs_pagesPerRange;
1776 state->bs_rmAccess, &phbuf,
1777 heapBlk, phtup, phsz);
1784 if (heapBlk +
state->bs_pagesPerRange > heapNumBlks)
1798 state->bs_pagesPerRange);
1803 scanNumBlks =
state->bs_pagesPerRange;
1816 state->bs_currRangeStart = heapBlk;
1818 heapBlk, scanNumBlks,
1840 heapBlk,
state->bs_dtuple, &newsize);
1844 state->bs_rmAccess, heapBlk, phbuf, offset,
1845 phtup, phsz, newtup, newsize, samepage);
1864 elog(
ERROR,
"missing placeholder tuple");
1888 bool include_partial,
double *numSummarized,
double *numExisting)
1906 startBlk = (pageRange / pagesPerRange) * pagesPerRange;
1907 heapNumBlocks =
Min(heapNumBlocks, startBlk + pagesPerRange);
1909 if (startBlk > heapNumBlocks)
1920 for (; startBlk < heapNumBlocks; startBlk += pagesPerRange)
1932 if (!include_partial &&
1933 (startBlk + pagesPerRange > heapNumBlocks))
1958 *numSummarized += 1.0;
1963 *numExisting += 1.0;
1991 state->bs_dtuple, &size);
1993 &
state->bs_currentInsertBuf,
state->bs_currRangeStart,
1995 state->bs_numtuples++;
2012 if (
state->bs_dtuple->bt_empty_range)
2016 state->bs_dtuple, &size);
2021 state->bs_numtuples++;
2072 if (
a->bt_empty_range)
2096 a->bt_empty_range =
false;
2182 for (blkno = 0; blkno < nblocks; blkno++)
2307 for (keyno = 0; keyno < nnullkeys; keyno++)
2364 bool isconcurrent,
int request)
2367 int scantuplesortstates;
2376 bool leaderparticipates =
true;
2379#ifdef DISABLE_LEADER_PARTICIPATION
2380 leaderparticipates =
false;
2392 scantuplesortstates = leaderparticipates ? request + 1 : request;
2445 if (pcxt->
seg == NULL)
2513 brinleader->
pcxt = pcxt;
2515 if (leaderparticipates)
2534 if (leaderparticipates)
2582 int nparticipanttuplesorts;
2584 nparticipanttuplesorts =
state->bs_leader->nparticipanttuplesorts;
2600 WAIT_EVENT_PARALLEL_CREATE_INDEX_SCAN);
2605 return state->bs_reltuples;
2842 state->bs_reltuples += reltuples;
2932 heapRel, indexRel, sortmem,
false);
2959 if (
state->bs_emptyTuple == NULL)
2968 &
state->bs_emptyTupleLen);
2975 state->bs_emptyTuple->bt_blkno = blkno;
3005 while (blkno < nextRange)
3011 &
state->bs_currentInsertBuf,
3012 blkno,
state->bs_emptyTuple,
state->bs_emptyTupleLen);
3015 blkno +=
state->bs_pagesPerRange;
void aclcheck_error(AclResult aclerr, ObjectType objtype, const char *objectname)
bool object_ownercheck(Oid classid, Oid objectid, Oid roleid)
static bool validate(Port *port, const char *auth)
bool AutoVacuumRequestWork(AutoVacuumWorkItemType type, Oid relationId, BlockNumber blkno)
void InitializeParallelDSM(ParallelContext *pcxt)
void WaitForParallelWorkersToFinish(ParallelContext *pcxt)
void LaunchParallelWorkers(ParallelContext *pcxt)
void DestroyParallelContext(ParallelContext *pcxt)
ParallelContext * CreateParallelContext(const char *library_name, const char *function_name, int nworkers)
void WaitForParallelWorkersToAttach(ParallelContext *pcxt)
uint64 pgstat_get_my_query_id(void)
void pgstat_report_query_id(uint64 query_id, bool force)
void pgstat_report_activity(BackendState state, const char *cmd_str)
#define InvalidBlockNumber
static Datum values[MAXATTR]
#define PARALLEL_KEY_BUFFER_USAGE
void brininsertcleanup(Relation index, IndexInfo *indexInfo)
static double _brin_parallel_merge(BrinBuildState *state)
static void brin_vacuum_scan(Relation idxrel, BufferAccessStrategy strategy)
Datum brin_desummarize_range(PG_FUNCTION_ARGS)
void brinrescan(IndexScanDesc scan, ScanKey scankey, int nscankeys, ScanKey orderbys, int norderbys)
static void terminate_brin_buildstate(BrinBuildState *state)
#define PARALLEL_KEY_BRIN_SHARED
Datum brin_summarize_range(PG_FUNCTION_ARGS)
IndexBulkDeleteResult * brinbulkdelete(IndexVacuumInfo *info, IndexBulkDeleteResult *stats, IndexBulkDeleteCallback callback, void *callback_state)
static void form_and_spill_tuple(BrinBuildState *state)
#define BRIN_ALL_BLOCKRANGES
struct BrinShared BrinShared
Datum brin_summarize_new_values(PG_FUNCTION_ARGS)
IndexScanDesc brinbeginscan(Relation r, int nkeys, int norderbys)
bytea * brinoptions(Datum reloptions, bool validate)
int64 bringetbitmap(IndexScanDesc scan, TIDBitmap *tbm)
static void brinsummarize(Relation index, Relation heapRel, BlockNumber pageRange, bool include_partial, double *numSummarized, double *numExisting)
static void form_and_insert_tuple(BrinBuildState *state)
void brinbuildempty(Relation index)
void brin_free_desc(BrinDesc *bdesc)
struct BrinInsertState BrinInsertState
static void union_tuples(BrinDesc *bdesc, BrinMemTuple *a, BrinTuple *b)
static void _brin_parallel_scan_and_build(BrinBuildState *state, BrinShared *brinshared, Sharedsort *sharedsort, Relation heap, Relation index, int sortmem, bool progress)
static BrinBuildState * initialize_brin_buildstate(Relation idxRel, BrinRevmap *revmap, BlockNumber pagesPerRange, BlockNumber tablePages)
static void _brin_begin_parallel(BrinBuildState *buildstate, Relation heap, Relation index, bool isconcurrent, int request)
void brinGetStats(Relation index, BrinStatsData *stats)
static void _brin_leader_participate_as_worker(BrinBuildState *buildstate, Relation heap, Relation index)
static bool add_values_to_range(Relation idxRel, BrinDesc *bdesc, BrinMemTuple *dtup, const Datum *values, const bool *nulls)
static void _brin_end_parallel(BrinLeader *brinleader, BrinBuildState *state)
static Size _brin_parallel_estimate_shared(Relation heap, Snapshot snapshot)
struct BrinBuildState BrinBuildState
static void brin_fill_empty_ranges(BrinBuildState *state, BlockNumber prevRange, BlockNumber nextRange)
IndexBuildResult * brinbuild(Relation heap, Relation index, IndexInfo *indexInfo)
IndexBulkDeleteResult * brinvacuumcleanup(IndexVacuumInfo *info, IndexBulkDeleteResult *stats)
struct BrinLeader BrinLeader
struct BrinOpaque BrinOpaque
static void summarize_range(IndexInfo *indexInfo, BrinBuildState *state, Relation heapRel, BlockNumber heapBlk, BlockNumber heapNumBlks)
#define ParallelTableScanFromBrinShared(shared)
#define PARALLEL_KEY_TUPLESORT
static void brinbuildCallbackParallel(Relation index, ItemPointer tid, Datum *values, bool *isnull, bool tupleIsAlive, void *brstate)
bool brininsert(Relation idxRel, Datum *values, bool *nulls, ItemPointer heaptid, Relation heapRel, IndexUniqueCheck checkUnique, bool indexUnchanged, IndexInfo *indexInfo)
#define PARALLEL_KEY_QUERY_TEXT
Datum brinhandler(PG_FUNCTION_ARGS)
BrinDesc * brin_build_desc(Relation rel)
void _brin_parallel_build_main(dsm_segment *seg, shm_toc *toc)
static void brin_build_empty_tuple(BrinBuildState *state, BlockNumber blkno)
#define PARALLEL_KEY_WAL_USAGE
static double _brin_parallel_heapscan(BrinBuildState *state)
static BrinInsertState * initialize_brin_insertstate(Relation idxRel, IndexInfo *indexInfo)
static void brinbuildCallback(Relation index, ItemPointer tid, Datum *values, bool *isnull, bool tupleIsAlive, void *brstate)
void brinendscan(IndexScanDesc scan)
static bool check_null_keys(BrinValues *bval, ScanKey *nullkeys, int nnullkeys)
#define BrinGetPagesPerRange(relation)
#define BrinGetAutoSummarize(relation)
#define BRIN_LAST_OPTIONAL_PROCNUM
#define BRIN_PROCNUM_UNION
#define BRIN_PROCNUM_OPTIONS
#define BRIN_PROCNUM_OPCINFO
#define BRIN_PROCNUM_CONSISTENT
#define BRIN_PROCNUM_ADDVALUE
#define BRIN_CURRENT_VERSION
#define BRIN_METAPAGE_BLKNO
bool brin_doupdate(Relation idxrel, BlockNumber pagesPerRange, BrinRevmap *revmap, BlockNumber heapBlk, Buffer oldbuf, OffsetNumber oldoff, const BrinTuple *origtup, Size origsz, const BrinTuple *newtup, Size newsz, bool samepage)
void brin_page_cleanup(Relation idxrel, Buffer buf)
OffsetNumber brin_doinsert(Relation idxrel, BlockNumber pagesPerRange, BrinRevmap *revmap, Buffer *buffer, BlockNumber heapBlk, BrinTuple *tup, Size itemsz)
void brin_metapage_init(Page page, BlockNumber pagesPerRange, uint16 version)
bool brin_can_do_samepage_update(Buffer buffer, Size origsz, Size newsz)
bool brinRevmapDesummarizeRange(Relation idxrel, BlockNumber heapBlk)
void brinRevmapTerminate(BrinRevmap *revmap)
BrinRevmap * brinRevmapInitialize(Relation idxrel, BlockNumber *pagesPerRange)
BrinTuple * brinGetTupleForHeapBlock(BrinRevmap *revmap, BlockNumber heapBlk, Buffer *buf, OffsetNumber *off, Size *size, int mode)
BrinTuple * brin_copy_tuple(BrinTuple *tuple, Size len, BrinTuple *dest, Size *destsz)
BrinTuple * brin_form_tuple(BrinDesc *brdesc, BlockNumber blkno, BrinMemTuple *tuple, Size *size)
BrinMemTuple * brin_new_memtuple(BrinDesc *brdesc)
void brin_free_tuple(BrinTuple *tuple)
BrinTuple * brin_form_placeholder_tuple(BrinDesc *brdesc, BlockNumber blkno, Size *size)
BrinMemTuple * brin_memtuple_initialize(BrinMemTuple *dtuple, BrinDesc *brdesc)
BrinMemTuple * brin_deform_tuple(BrinDesc *brdesc, BrinTuple *tuple, BrinMemTuple *dMemtuple)
bool brinvalidate(Oid opclassoid)
#define SizeOfBrinCreateIdx
#define XLOG_BRIN_CREATE_INDEX
#define BufferIsInvalid(buffer)
BlockNumber BufferGetBlockNumber(Buffer buffer)
Buffer ExtendBufferedRel(BufferManagerRelation bmr, ForkNumber forkNum, BufferAccessStrategy strategy, uint32 flags)
void ReleaseBuffer(Buffer buffer)
void UnlockReleaseBuffer(Buffer buffer)
void MarkBufferDirty(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
#define RelationGetNumberOfBlocks(reln)
static Page BufferGetPage(Buffer buffer)
static bool BufferIsValid(Buffer bufnum)
Size PageGetFreeSpace(const PageData *page)
static char * PageGetContents(Page page)
static ItemId PageGetItemId(Page page, OffsetNumber offsetNumber)
static void PageSetLSN(Page page, XLogRecPtr lsn)
#define PG_USED_FOR_ASSERTS_ONLY
#define OidIsValid(objectId)
bool ConditionVariableCancelSleep(void)
void ConditionVariableInit(ConditionVariable *cv)
void ConditionVariableSleep(ConditionVariable *cv, uint32 wait_event_info)
void ConditionVariableSignal(ConditionVariable *cv)
Datum datumCopy(Datum value, bool typByVal, int typLen)
int errhint(const char *fmt,...)
int errcode(int sqlerrcode)
int errmsg(const char *fmt,...)
#define ereport(elevel,...)
#define palloc_object(type)
#define palloc_array(type, count)
#define palloc0_array(type, count)
#define palloc0_object(type)
Datum FunctionCall4Coll(FmgrInfo *flinfo, Oid collation, Datum arg1, Datum arg2, Datum arg3, Datum arg4)
Datum Int64GetDatum(int64 X)
Datum FunctionCall3Coll(FmgrInfo *flinfo, Oid collation, Datum arg1, Datum arg2, Datum arg3)
void fmgr_info_copy(FmgrInfo *dstinfo, FmgrInfo *srcinfo, MemoryContext destcxt)
#define DirectFunctionCall2(func, arg1, arg2)
#define PG_GETARG_DATUM(n)
#define PG_GETARG_INT64(n)
#define FunctionCall1(flinfo, arg1)
#define PG_RETURN_INT32(x)
#define PG_RETURN_POINTER(x)
void FreeSpaceMapVacuumRange(Relation rel, BlockNumber start, BlockNumber end)
void FreeSpaceMapVacuum(Relation rel)
void RecordPageWithFreeSpace(Relation rel, BlockNumber heapBlk, Size spaceAvail)
IndexScanDesc RelationGetIndexScan(Relation indexRelation, int nkeys, int norderbys)
bool(* IndexBulkDeleteCallback)(ItemPointer itemptr, void *state)
int NewGUCNestLevel(void)
void RestrictSearchPath(void)
void AtEOXact_GUC(bool isCommit, int nestLevel)
Assert(PointerIsAligned(start, uint64))
Oid IndexGetRelation(Oid indexId, bool missing_ok)
IndexInfo * BuildIndexInfo(Relation index)
FmgrInfo * index_getprocinfo(Relation irel, AttrNumber attnum, uint16 procnum)
void index_close(Relation relation, LOCKMODE lockmode)
Relation index_open(Oid relationId, LOCKMODE lockmode)
void InstrAccumParallelQuery(BufferUsage *bufusage, WalUsage *walusage)
void InstrEndParallelQuery(BufferUsage *bufusage, WalUsage *walusage)
void InstrStartParallelQuery(void)
if(TABLE==NULL||TABLE_index==NULL)
#define ItemIdGetLength(itemId)
static OffsetNumber ItemPointerGetOffsetNumber(const ItemPointerData *pointer)
static BlockNumber ItemPointerGetBlockNumber(const ItemPointerData *pointer)
#define AccessExclusiveLock
#define ShareUpdateExclusiveLock
void MemoryContextReset(MemoryContext context)
void pfree(void *pointer)
void * palloc0(Size size)
MemoryContext CurrentMemoryContext
void MemoryContextDelete(MemoryContext context)
#define AllocSetContextCreate
#define ALLOCSET_DEFAULT_SIZES
#define ALLOCSET_SMALL_SIZES
#define SECURITY_RESTRICTED_OPERATION
#define START_CRIT_SECTION()
#define CHECK_FOR_INTERRUPTS()
#define END_CRIT_SECTION()
void GetUserIdAndSecContext(Oid *userid, int *sec_context)
void SetUserIdAndSecContext(Oid userid, int sec_context)
#define FirstOffsetNumber
static MemoryContext MemoryContextSwitchTo(MemoryContext context)
FormData_pg_attribute * Form_pg_attribute
#define ERRCODE_UNDEFINED_TABLE
#define pgstat_count_index_scan(rel)
const char * debug_query_string
static bool DatumGetBool(Datum X)
static Datum PointerGetDatum(const void *X)
static Pointer DatumGetPointer(Datum X)
static Datum Int32GetDatum(int32 X)
static void addrange(struct cvec *cv, chr from, chr to)
#define RelationGetRelid(relation)
#define RelationGetDescr(relation)
#define RelationGetRelationName(relation)
#define RelationNeedsWAL(relation)
void * build_reloptions(Datum reloptions, bool validate, relopt_kind kind, Size relopt_struct_size, const relopt_parse_elt *relopt_elems, int num_relopt_elems)
void brincostestimate(PlannerInfo *root, IndexPath *path, double loop_count, Cost *indexStartupCost, Cost *indexTotalCost, Selectivity *indexSelectivity, double *indexCorrelation, double *indexPages)
void * shm_toc_allocate(shm_toc *toc, Size nbytes)
void shm_toc_insert(shm_toc *toc, uint64 key, void *address)
void * shm_toc_lookup(shm_toc *toc, uint64 key, bool noError)
#define shm_toc_estimate_chunk(e, sz)
#define shm_toc_estimate_keys(e, cnt)
Size add_size(Size s1, Size s2)
Size mul_size(Size s1, Size s2)
Snapshot GetTransactionSnapshot(void)
void UnregisterSnapshot(Snapshot snapshot)
Snapshot RegisterSnapshot(Snapshot snapshot)
#define IsMVCCSnapshot(snapshot)
#define SpinLockInit(lock)
#define SpinLockRelease(lock)
#define SpinLockAcquire(lock)
void relation_close(Relation relation, LOCKMODE lockmode)
BlockNumber bs_maxRangeStart
BlockNumber bs_pagesPerRange
Buffer bs_currentInsertBuf
Tuplesortstate * bs_sortstate
BlockNumber bs_currRangeStart
BrinTuple * bs_emptyTuple
BrinOpcInfo * bd_info[FLEXIBLE_ARRAY_MEMBER]
BrinRevmap * bis_rmAccess
BlockNumber bis_pages_per_range
int nparticipanttuplesorts
BufferUsage * bufferusage
BrinValues bt_columns[FLEXIBLE_ARRAY_MEMBER]
BlockNumber lastRevmapPage
BlockNumber pagesPerRange
BlockNumber bo_pagesPerRange
TypeCacheEntry * oi_typcache[FLEXIBLE_ARRAY_MEMBER]
BlockNumber pagesPerRange
ConditionVariable workersdonecv
BlockNumber revmapNumPages
BlockNumber pagesPerRange
ambuildphasename_function ambuildphasename
ambuildempty_function ambuildempty
amvacuumcleanup_function amvacuumcleanup
amoptions_function amoptions
amestimateparallelscan_function amestimateparallelscan
amrestrpos_function amrestrpos
aminsert_function aminsert
amendscan_function amendscan
amtranslate_strategy_function amtranslatestrategy
amparallelrescan_function amparallelrescan
bool amconsistentordering
amtranslate_cmptype_function amtranslatecmptype
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
bool amconsistentequality
struct ScanKeyData * keyData
struct IndexScanInstrumentation * instrument
BufferAccessStrategy strategy
shm_toc_estimator estimator
BlockNumber pagesPerRange
void table_close(Relation relation, LOCKMODE lockmode)
Relation table_open(Oid relationId, LOCKMODE lockmode)
TableScanDesc table_beginscan_parallel(Relation relation, ParallelTableScanDesc pscan)
Size table_parallelscan_estimate(Relation rel, Snapshot snapshot)
void table_parallelscan_initialize(Relation rel, ParallelTableScanDesc pscan, Snapshot snapshot)
static double table_index_build_range_scan(Relation table_rel, Relation index_rel, struct IndexInfo *index_info, bool allow_sync, bool anyvisible, bool progress, BlockNumber start_blockno, BlockNumber numblocks, IndexBuildCallback callback, void *callback_state, TableScanDesc scan)
static double table_index_build_scan(Relation table_rel, Relation index_rel, struct IndexInfo *index_info, bool allow_sync, bool progress, IndexBuildCallback callback, void *callback_state, TableScanDesc scan)
static void callback(struct sockaddr *addr, struct sockaddr *mask, void *unused)
void tbm_add_page(TIDBitmap *tbm, BlockNumber pageno)
static FormData_pg_attribute * TupleDescAttr(TupleDesc tupdesc, int i)
void tuplesort_performsort(Tuplesortstate *state)
void tuplesort_initialize_shared(Sharedsort *shared, int nWorkers, dsm_segment *seg)
Size tuplesort_estimate_shared(int nWorkers)
void tuplesort_end(Tuplesortstate *state)
void tuplesort_attach_shared(Sharedsort *shared, dsm_segment *seg)
struct SortCoordinateData * SortCoordinate
Tuplesortstate * tuplesort_begin_index_brin(int workMem, SortCoordinate coordinate, int sortopt)
BrinTuple * tuplesort_getbrintuple(Tuplesortstate *state, Size *len, bool forward)
void tuplesort_putbrintuple(Tuplesortstate *state, BrinTuple *tuple, Size size)
#define VACUUM_OPTION_PARALLEL_CLEANUP
void ExitParallelMode(void)
void EnterParallelMode(void)
bool RecoveryInProgress(void)
XLogRecPtr XLogInsert(RmgrId rmid, uint8 info)
void XLogRegisterData(const void *data, uint32 len)
XLogRecPtr log_newpage_buffer(Buffer buffer, bool page_std)
void XLogRegisterBuffer(uint8 block_id, Buffer buffer, uint8 flags)
void XLogBeginInsert(void)