[CQF] Design how histogram CE interacts with parameterized queries

XMLWordPrintableJSON

    • Type: New Feature
    • 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 parameterization is enabled in CQF, the intervals generated in SargableNodes are no-longer guaranteed to have constant bounds, they will be expressions. While we do maintain a mapping of parameter ID to constant in the given query, simply replacing references to parameters with constants is not sufficient, we'd need to invoke constant folding to get back a set of intervals with constant bounds. Doing so would require copying an ABT with potentially large constants in it, which may have performance implications; since we don't have to mutate the ABT that CE is given, since that get inserted into the memo.

      This ticket is a placeholder for work to design and implement a solution to this problem. One idea: disable interval simplification in SargableNode and estimate the CE of all predicates independently; this would allow direct replacement of parameter markers for their constant values.

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

              Created:
              Updated:
              Resolved: