|< < 14 > >|

Optimizing single-table queries

Consider all possible plans

Covering indexes

  • The query restricts columns a and b

  • And projects only column c.

  • If we have an index keyed by either (a, b, c) or (b, a, c), then we can use the covering index optimization.

  • Use the index to find rows satisfying a = 1 and b = 10.

  • Then instead of retrieving rows from the heap to obtain c, just get it from the index.

|< < 14 > >|