简体   繁体   English

计算B +树叶子节点的阻塞因子

[英]Calculating the Blocking Factor for a B+ Tree leaf node

I have records of 5000 records stored in B+ tree, 4 byte id, an 8 byte location, 8 byte error signals and 8 bytes for a time. 我在B +树中存储了5000条记录的记录,4个字节的ID,8个字节的位置,8个字节的错误信号和8个字节的时间。 Locations are collected every minute. 每分钟都会收集位置。 Assume that disk blocks are 8K and with 64-bit addresses. 假设磁盘块是8K且具有64位地址。 Further assume that B+tree vertices have 64-bit addresses. 进一步假设B + tree顶点具有64位地址。 We cluster on (time,id) and build a dense index on (time + id). 我们在(time,id)上聚类,并在(time + id)上建立密集索引。 Assume we have been tracking 10000 people for 100 days. 假设我们已经跟踪了10000人100天。

I am trying to calculate the blocking factor for a B+ tree leaf node with forward and backward pointer to sequential blocks, but I am not sure if it is correct as shown below? 我正在尝试使用向前和向后指向顺序块的指针来计算B +树叶节点的阻塞因子,但是我不确定它是否正确,如下所示?

R = 4 + 8 + 8 + 8 = 28 
B = 8K = 8*1024 = 8192 
BF = B/R = 8192/28 = 292

Also, I am not sure how to calculate the order of an internal B+tree node 另外,我不确定如何计算内部B + tree节点的顺序

Your calculation is correct, assuming that the leaf nodes store the data, except that you should subtract space for the left and right pointers from the block size before dividing. 您的计算是正确的,假定叶节点存储了数据,除了在划分之前应从块大小中减去左右指针的空间。 The calculation for an interior node is the same except that they don't need all the data bytes, only whichever part of the data forms the key, and a downward pointer for each. 内部节点的计算是相同的,除了它们不需要所有数据字节(仅数据的任何一部分构成键),以及每个字节的向下指针。

I'm not crazy about the term 'blocking factor' here. 我对“阻塞因素”一词并不感到疯狂。 It is 'order' in both cases. 在两种情况下都是“顺序”。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM