Calculating the Blocking Factor for a B+ Tree leaf node

1.5k views Asked by At

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. Locations are collected every minute. Assume that disk blocks are 8K and with 64-bit addresses. Further assume that B+tree vertices have 64-bit addresses. We cluster on (time,id) and build a dense index on (time + id). Assume we have been tracking 10000 people for 100 days.

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?

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

1

There are 1 answers

8
user207421 On

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.