Implementing Projection
(1) remove unwanted attributes,
(2) remove duplicates from the result.
Refinements to duplicate removal:
- If an index on a relation contains all wanted attributes, then we can do an index-only scan.
- If the index contains a subset of the wanted attributes, you can remove duplicates locally.