ZhangJiaQiao / 2019-DBMS-Project

This is the programmin project of DBMS course in 2019

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

询问叶节点分裂的时机

ctlchild opened this issue · comments

TEST(FPTreeTest, BulkLoadingTwoLeaf) {
PAllocator* pa = PAllocator::getAllocator();
FPTree* tree1 = new FPTree(2);
for (int i = 1; i <= LEAF_DEGREE * 2; i++) {
tree1->insert(i, i * 100);
}
EXPECT_EQ(pa->getFreeNum(), LEAF_GROUP_AMOUNT - 2);
delete tree1;
ifstream f1(file1);
EXPECT_EQ(f1.is_open(), true);
f1.close();
f1.clear();
PAllocator::getAllocator()->~PAllocator();
FPTree* tree2 = new FPTree(1);
EXPECT_EQ(tree2->find(1), 100);
removeFile();
}

我想问一下,LeafNode 应该在 kv 数>= 2d 还是 2d-1 还是其他情况下分裂?
按照这个 test,LeafNode 已经有一次分裂。