Implement heuristic for evaluating most performant operators first inside $and

XMLWordPrintableJSON

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

      The basic idea is that if the doc is

      { a:0 }

      and the query is

      { a:1, $where:... }

      then we should reject on the basis of 'a' before evaluating the $where clause (slow).

      In the old Matcher, $and checks:

      • simple operators eg equality, $gt, $in
      • then regular expressions
      • then nested compound expressions (nested $and, $or, etc)
      • then $where

      We can change the heuristics in the new implementation, but they should stay at least as good as the old ones.

        1. server7389.js
          0.2 kB
          Benety Goh

            Assignee:
            [DO NOT USE] Backlog - Query Execution
            Reporter:
            Aaron Staple (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: