Week 5 – CST– 363 Introduction to Database Systems

The web site "Use the Index Luke" has a page on "slow indexes."   

https://use-the-index-luke.com/sql/anatomy/slow-indexesLinks to an external site. 

If indexes are supposed to speed up performance of query, what does the author mean by a slow index? 

What the author refers to as slow indexes is not that indexes are slow but that there are situations that cause indexes to perform slower. He mentions two ingredients that cause indexes to perform a slow lookup.

The first is the leaf node chain. The database must read the next leaf node to search for matching entries after it has found the node it was looking for. The author points out that an index lookup must perform a tree traversal and follow the leaf chain as well.
The second ingredient he mentions is accessing the table after finding a matching node. There is an additional table access for each hit and a single node can contain hundreds of hits.

The article points out that there is a myth that says slow indexes are broken or unbalanced and must be rebuilt. The author states that only the tree traversal has upper bounds and the other two steps, following the leaf node chain and fetching the table data, might need to access many blocks and that is what causes a slow index look up.

Comments

Popular posts from this blog