|< < 39 > >|

Joins

Index Nested Loops Join

The join algorithms we've examined so far don't assume any indexes.

If a table has an index on the join columns:

  • It can greatly speed up the inner loop.

  • Instead of scanning the entire table for qualifying rows, use the index to find them.

If S has an index on the join columns:
for each row r in R: for each row s in index_scan(join columns(r)): output join(r, s)

|< < 39 > >|