下面罗列了openGauss数据库中有关B+树操作的主要函数,并且对其进行一一分析。
BTSpool *_bt_spoolinit(Relation index, bool isunique, bool isdead, void *meminfo)
Datum btbuild(PG_FUNCTION_ARGS)
static inline double tableam_index_build_scan(Relation heapRelation, Relation indexRelation, IndexInfo* indexInfo, bool allow_sync, IndexBuildCallback callback, void* callback_state)
double IndexBuildHeapScan(Relation heapRelation, Relation indexRelation, IndexInfo* indexInfo, bool allow_sync,IndexBuildCallback callback, void* callback_state)
static void btbuildCallback(Relation index, HeapTuple htup, Datum *values, const bool *isnull, bool tupleIsAlive,void *state);
void _bt_spool(BTSpool *btspool, ItemPointer self, Datum *values, const bool *isnull)
void tuplesort_putindextuplevalues(Tuplesortstate* state, Relation rel, ItemPointer self, Datum* values, const bool* isnull)
static void puttuple_common(Tuplesortstate* state, SortTuple* tuple)
void _bt_leafbuild(BTSpool *btspool, BTSpo

这篇博客深入剖析了开放Gauss数据库中B+树的构建过程,包括BTSpool初始化、btree索引建立函数btbuild的执行流程、IndexBuildHeapScan扫描堆表获取元组、btbuildCallback处理索引元组以及tuplesort_putindextuplevalues等关键步骤。文章详细阐述了如何从heap表中读取元组,构建索引结构,以及在内存和磁盘间的管理策略。
最低0.47元/天 解锁文章
4102

被折叠的 条评论
为什么被折叠?



