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

Avoid redundant child estimation of no-filter FetchNode

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

      If a FetchNode has no filter, then its estimate is equal to it's child estimate. In this case we can avoid estimating the child in this code block:

      if (node->children[0]->getType() == STAGE_IXSCAN &&
      static_cast<const IndexScanNode*>(node->children[0].get())->filter ==
      nullptr && // TODO SERVER-98577: Remove this restriction
      _rankerMode == QueryPlanRankerModeEnum::kSamplingCE) {

      Thanks milena.ivanova@mongodb.com for discovering the redundancy.

      This makes me think that we need cardinality and cost estimation counters which we could assert on that a certain query took no more than that many estimations.

            Assignee:
            Unassigned Unassigned
            Reporter:
            timour.katchaounov@mongodb.com Timour Katchaounov
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: