Learn CS Visual

Full Scan vs Index Search

An index keeps values sorted ahead of time, which makes search faster. Without an index, a full scan compares from the start until it finds the target, so more rows mean more comparisons. An index search narrows the search range by half each time, so its comparison count grows far more slowly as the table gets larger.

With the search id set to 17, how many comparisons do the full scan and index search each take?