|< < 3 > >|

Optimizing single-table queries

Consider all possible plans

There aren't that many plans to consider.

It's only with many joins that we need to worry about combinatorial explosions.

Query

select c from R where a = 1 and b = 10

Let's consider the possible plans:

No index

  • TableScan on R.
  • SelectScan to check the predicate for each row.

|< < 3 > >|