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

Ensure the child of a SargableNode is always a ScanNode after substitution phase

    XMLWordPrintableJSON

Details

    • Icon: Improvement Improvement
    • Resolution: Unresolved
    • Icon: Major - P3 Major - P3
    • None
    • None
    • None
    • None
    • Query Optimization

    Description

      Currently, the child of a SargableNode is not always a ScanNode after the substitution phase. This happens when the SargableMerge fails to merge two SargableNode (e.g. one of them has non-singleton disjunction requirement) in the substitution phase. Such SargableNode will remain in memo until the exploration phase.

      Due to this, a SamplingEstimator may encounter such SargableNode and has to fall back to heuristic estimation without an additional check.
       
      To address that:

      1. Create a SubstituteConvert<SargableNode> rewrite which converts SargableNode back to a FilterNode like what ExploreConvert<Sargablenode> does today by calling lowerSargableNode(sargableNode, ctx).
      2. Update the TODO in the sampling_estimator.cpp into an assertion such that the child of a SargableNode is always a ScanNode.

      Attachments

        Activity

          People

            backlog-query-optimization Backlog - Query Optimization
            chii.huang@mongodb.com Chi-I Huang
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated: