华为openGauss数据库源码解析——B+树操作(2)

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

下面罗列了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
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

allwellright

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值