openGauss源码#索引之IndexInsert
作者:
upup果 | 来源:发表于
2020-12-12 09:13 被阅读0次
索引的插入
Index::IndexInsert(Sentinel& outputSentinel, const Key key, uint32_t pid, RC& rc)
- 创建一个新的sentinel并初始化
- 若是主键索引,设置其标志位
- 在一个while循环中执行插入.调用IndexInsertImpl(key, sentinel, inserted, pid):调用MassTree的insert,即先查找key,如果找到就插入失败并返回存在的sentinel,如果不存在就讲sentinel保存到key的值,返回null.插入成功就跳出循环,否则判断counter的数量.决定是否跳出循环
- sentinel成功插入则将其赋值给outputSentinel,并返回true,否则就从线程池释放,返回false
本文标题:openGauss源码#索引之IndexInsert
本文链接:https://www.haomeiwen.com/subject/liwrgktx.html
网友评论