parsePersistentSample() should reserve space for the actual number of docs, not the requested sample size

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

      parsePersistentSample() does the following when reserving space to take ownership of the docs in a persisted sample:

      ownedDocs.reserve(sampleSize)

      It should instead do

      ownedDocs.reserve(parsed.getDocs().size()) to avoid over-allocating memory, since the actual number of docs in a sample can be fewer than the requested size.
       

            Assignee:
            Unassigned
            Reporter:
            Natalie Hill
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: