Learning Journal Week 5


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? 


 When the author talks about a "slow index," they’re not saying the index is broken or built wrong. What they really mean is that even if a query uses an index, the performance can still be pretty lousy. That’s because looking up an index isn’t just a quick trip through a tree structure. Once the matching entries pop up in the index, the database often has to follow a bunch of leaf nodes if there are a lot of matches. Plus, for each of those matches, the database needs to grab the corresponding row from the table. These rows can be all over the place in storage, which means the database has to deal with a bunch of slow, random I/O operations. This extra effort—especially when an index matches hundreds or even thousands of entries—can slow down a query, even if it’s using an index. The author points out that a lot of folks think that slow performance means there’s something wrong with the index, but that’s not the case. The real problem is about how many matches there are and the hassle of getting to the table data. So, a "slow index" doesn’t mean it’s a bad index; it’s more about how the query and data are set up.

Comments

Popular posts from this blog

Journal week 6

Journal Entry Week 2

CST334 Operating Systems Week 1