algorithm - Space complexity of a B-tree index in a database -


a traditional b-tree implementation has o(n) space complexity [1].

so assume in database (regardless of implementation, consider general case), have table of 10gb data, index size 1gb, can assume if database grown 100gb, index size 10gb?

you cannot "regardless of implementation."

if index pure b-tree, theoretically should linear in number , size of keys being indexed fudge factor fill rates. however, unlikely pure b-tree. first, might b+tree or other variant. b+tree add small logarithmic term size computation. increase unlikely material. more importantly, implementations not implement theoretical b-tree operations maintain fill rate. example, deletion might implemented merely leaving open slot used later insert. on large number of operations , bit of bad luck, efficiency of index representation can degrade index might larger. if index on 10gb tightly packed , 100gb after year of operations, might larger expect.

in direct answer question - no not think assumption safe. more because index might change size on time due non-linearity in underlying data structure.


Comments

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

android - send complex objects as post php java -

charts - What graph/dashboard product is facebook using in Dashboard: PUE & WUE -