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

Prevent bad query plans from being cached by adding additional safeguards

    • Type: Icon: Improvement Improvement
    • Resolution: Duplicate
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: Querying
    • Fully Compatible

      The query optimizer has always had a feature where if we use a cached plan for a query and we reach an nscanned that is 10x the nscanned that was recorded when the query plan was saved in the cache, then we attempt using other query plans as well. But this check is only triggered if a high nscanned is observed before 101 matches are found. After 101 matches are found, we're stuck using the cached plan only.

      We should add additional checks (eg, deviation from avg run time or total nscanned) to guard against keeping bad plans.

            Assignee:
            david.storch@mongodb.com David Storch
            Reporter:
            dan@mongodb.com Daniel Pasette (Inactive)
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: