count may not yield before paging in initial candidate documents

XMLWordPrintableJSON

    • Type: Improvement
    • Resolution: Duplicate
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: Concurrency, Querying
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      Current behavior of count is to construct a ClientCursor and perform non in mem yielding only after an elapsed tracker has elapsed. But this means it may hold a read lock while initial candidate documents are paged in.

                      if ( !ccPointer ) {
                          if ( timeToStartYielding.intervalHasElapsed() ) {
                              // Lazily construct a ClientCursor, avoiding a performance regression when scanning a very
                              // small number of documents.
                              ccPointer.reset( new ClientCursor( QueryOption_NoCursorTimeout, cursor, ns ) );
                          }
                      }
                      else if ( !ccPointer->yieldSometimes( simpleEqualityMatch ? ClientCursor::DontNeed : ClientCursor::MaybeCovered ) ||
                               !cursor->ok() ) {
                          break;
                      }
      

      In 2.0 count did not have non in mem yielding, so current behavior does improve on that.

              Assignee:
              Unassigned
              Reporter:
              Aaron Staple (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved: