Statistics and Catalogs
Need information about the relations and indexes involved. Catalogs typically contain at least:
- # tuples (NTuples) and # pages (NPages) for each relation.
- # distinct key values (NKeys) and NPages for each index.
- Index height, low/high key values (Low/High) for each tree index.
Catalogs updated periodically.
- Updating whenever data changes is too expensive; lots of approximation anyway, so slight inconsistency ok.
More detailed information (e.g., histograms of the values in some field) are usually stored.