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

Factorize special index predicates in the simplifier

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

      The special index predicates (geo, text) can be used just once in one filter expression, if it happens that the simplified expression contains more than one of such predicates, the simplified expression is cancelled and the original one is used. We can fix it by factoring the factorizing optimized expressions. E.g. the expression like

      
      {$or: [{a: 1}, {$text: {$search: 'a'}}, {b: 1}, {$text: {$search: 'a'}}, {c: 1}]}
      
      

      can be factorized to 

      
      {$or: [{$and: [{$text: {$search: 'a'}}, {$or: [{a: 1}, {b: 1}]}]}, {c: 1}]}
      
      

            Assignee:
            backlog-query-optimization [DO NOT USE] Backlog - Query Optimization
            Reporter:
            alexander.ignatyev@mongodb.com Alexander Ignatyev
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: