Use better heuristic for picking the best index for INLJ plans

    • Type: Improvement
    • Resolution: Unresolved
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • Query Optimization
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      SERVER-112338 produces INLJ plans with the first eligible index which has a prefix on the equijoin fields. This algorithm has two problems:

      • It is not deterministic if the order of indexes in the catalog changes
      • It may pick a suboptimal index (larger than required)

      In this ticket, we should use a heuristic to pick the smallest index (fewest number of components) to satisfy the INLJ. In the case where two indexes have the same number of components, we should pick one deterministically.

            Assignee:
            Unassigned
            Reporter:
            Ben Shteinfeld
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: