May 2018
Intermediate to advanced
576 pages
30h 25m
English
The most common problem is selecting too much data.
A typical point of confusion comes from data that has a few very common values among a larger group. Requesting data for the very common values costs more because we need to bring back more rows. As we bring back more rows the cost of using the index increases. So it is possible that we won't use the index for the very common values, whereas we would use the index for the less common values. To use an index effectively, make sure you're reducing the number of rows returned.
Another technique for making indexes more usable is partial indexes. Instead of indexing all values in a column, you might choose to index only the set of rows that are frequently accessed; for example, ...