Databases are usually so huge that they need to be stored in external memory, for example, on a giant disk. As a result, the bottleneck in most database applications is the number of times that we have to do with moving memory from disk to main memory.
B-trees and their variants are specially designed to minimize the number of read and write blocks needed to complete each of their operations. Mathematically, the number of memory transfers needed for each operation of the B-tree is O (log n / log B), where B is the block size. Compare this to a skiplist that requires O (log n) memory wait while waiting. Since B is usually measured in megabytes, the B log can be in the region of 15-25, so the B-tree can be much faster. Even when the database is in main memory, the effect of the hierarchy of memory (L1 and L2 caches, etc.) can be so pronounced that the B-tree variants in practice are still faster than many other data structures. This Google blog post provides some information about this.
Although each operation on the B-tree usually requires more CPU work than the corresponding operations in other data structures, the fact that they require so few memory transfers usually makes them significantly faster in practice than other data structures. Therefore, it would be impractical to use a list of skins in the database.
There is another reason B-trees are good: they are worst-case effective. Although deterministic skip lists exist, most scriptwriter implementations are randomized and provide expected guarantees of their behavior. This may not be acceptable in a database, since many use cases in databases require the worst effective behavior.
Hope this helps!
templatetypedef
source share