Investigate if its meaningfully more performant to do a direct read of the samples collection

    • Type: Task
    • Resolution: Unresolved
    • Priority: Minor - P4
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • Query Optimization
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      Instead of setting up a collection scan on the write path as we did in SERVER-130446, it may be faster to do something like

      auto cursor = collection.getCollectionPtr()->getCursor(opCtx);
      // Seek to first page
      auto record = cursor->seekExact(recordIdForId(minId));
      std::vector<BSONObj> pages;
      while (record) {
          // Check if we've exceeded max bound
          if (record->id > recordIdForId(maxId)) {
              break;
          }
          
          pages.push_back(record->data.toBson().getOwned());
          record = cursor->next();
      }
      

      We should create a google benchmark to test this

            Assignee:
            Unassigned
            Reporter:
            Militsa Sotirova
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: