Range queries using B trees and B+-trees
<p>I am writing a program to retrieve the number of objects within a given range and I am using the B-tree data structure to implement my solution as the number of objects cannot fit in RAM. I came across several articles saying that B+ trees are far superior than B trees for range queries and are used by all major database implementations. I was unable to understand why B+ trees are superior than B trees as all the data are stored on the leaf and it will take h (height of tree) disk accesses to retrieve the node and perform the range query while in the B tree the interval may be located on parent nodes and the disk accesses would be thus minimized. Furthermore, if I have a query such as return # of objects of a particular key then I may be able to locate the key before descending all the way down to the leaves as in B+ trees. Why then do they say that B+-trees are efficient than B-trees for range queries? If I have to write a program to perform range queries shouldn't B trees be the right data structure? Thanks in advance for your replies!  </p>