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

[CQF] Add heuristic: don't generate multi-index plans with a full index scan

    • Query Optimization
    • Fully Compatible
    • QO 2023-05-29, QO 2023-06-12

      Sometimes we generate plans that involve more than one index scan, and one or more of those scans has no bounds--it scans the whole index. Are these plans useful?

      If index scans and collection scans have similar cost, then a single collection scan + filter should be cheaper than multiple full index scans. So we may want a heuristic to prevent union or intersection involving a full index scan.

      On the other hand, a collection scan may be much more expensive than an index scan, and the more complex indexed plan can help fetch fewer documents. So if we add this heuristic, we should have an internal-only query knob to decide whether to apply it.

            Assignee:
            chii.huang@mongodb.com Chi-I Huang
            Reporter:
            david.percy@mongodb.com David Percy
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: