Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-97933

Resolve cost ties in a deterministic way

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

      Cost estimation may often estimate different plans to have the same cost.

      This may result in non-deterministic behavior when plans are enumerated in a different order. In such cases a different plan from the set of plans with equal costs will be chosen as the optimal one. This will be problematic both for testing and for the end-users.

      Few simple ideas how to impose an order on equal-cost plans:

      • Improve the resolution of the cost model, so that it takes more plan properties into account.
      • Consider some structural properties of plans that may affect their cost.
      • Order the plans according to some stable property
        • plan hash - if it is consistent, or
        • string comparison of the string representation of the plan.

       

            Assignee:
            Unassigned Unassigned
            Reporter:
            timour.katchaounov@mongodb.com Timour Katchaounov
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: