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

Make logical rewrites more granular

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

      Logical rewrites could in some cases be more granular, e.g. FilterSubstitute. Splitting larger rewrites up would allow us to:

      • configure sub-rewrites up front during phase manager construction, e.g. NotPushdown could be disabled once at the start of optimization, rather than having a check for it ever time we try to apply FilterSubstitute to a FilterNode.
      • reuse sub-rewrites when we have alternate sets of phases and rewrites that we want to apply in different scenarios, as was proposed in SERVER-83456
      • needed for SERVER-80735 
      • this also has the side-benefit of reducing code duplication

      The first thing to implement is the ability to apply the same rewrite struct (e.g. SubstituteConvert) to the same type of node multiple times. This would require the introduction of an additional template parameter to distinguish between SubstituteConvert/FilterNode combinations.

      The second would be to ensure 1) ordering of rewrites and 2) that we only run each rewrite once per node.

      A possible future improvement is for rewrites to be able to schedule (or maybe unschedule) other rewrites once they run.

            Assignee:
            backlog-query-optimization [DO NOT USE] Backlog - Query Optimization
            Reporter:
            alya.berciu@mongodb.com Alya Berciu
            Votes:
            0 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated: