[CQF] Only evaluate expressions deriving from getParam once during plan execution

XMLWordPrintableJSON

    • Type: Task
    • Resolution: Won't Do
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • Query Optimization
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      When we enable parameterization, the bounds we generate in SargableNode (and lower to Filter + PhysicalScan or IxScan) contain expressions. In the case of M2 queries, we currently generate plans which evaluate these expressions on every document, despite being constant for the duration of the query.

      We can modify lowerPartialSchemaRequirements() to generate a NLJ with Limit 1 CoScan as the outer child to evaluate these expressions once and expose them as a correlated projection.

      We have concerns about the performance of such an approach, but since it is simple to implement, propose to measure the performance to verify our suspicions before embarking on a solution that might be more complex.

            Assignee:
            [DO NOT USE] Backlog - Query Optimization
            Reporter:
            Ben Shteinfeld
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: