Sparse index
An index with entries for only some rows: it takes less space and writes faster, but a page must be scanned on lookup.
Example
With 1 entry every 100 rows, 1 million rows need only 10,000 entries.
Test yourself: Sparse index
Dense and sparse indexes
What advantage does a sparse index have over a dense one?
With 1 entry every 100 rows, the index has 100 times fewer entries to update.
Dense and sparse indexes
You have little memory and a sorted table of 10 million rows. Which index do you use?
The sparse one has 100,000 entries instead of 10 million: it fits in the memory available. Since the table is sorted, after reaching the page you scan at most 100 rows.
Dense and sparse indexes
Why does a sparse index need sorted data?
If the page starts at 500 and the next at 600, 557 is in the first.
0/3
â–¶ Play