$vectorSearch supplemental query stats metrics don't work for queries with multiple batches

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Unresolved
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • Query Integration
    • ALL
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      $vectorSearch supplemental query stats metrics (limit and numCandidatesLimitRatio stats) are currently reported by setting a field on OpDebug when parsing DocumentSourceVectorSearch. Query stats checks this field when updating the stats for the entry and inserts the supplemental metrics if it is populated.

      If the results for the query fit in a single batch, this works, because we will collect query stats directly from OpDebug. However, if the results don't fit in a single batch, we will end up collecting query stats from the metrics stored on the cursor - which does not include these vector search metrics.

      The impact is that $vectorSearch queries with multiple batches will have query stats report but the supplemental metrics will not be populated.

      Note that this is a limitation of how the supplemental stats framework is set up and applies to the optimizer supplemental stats as well. Those stats are disabled by default, though, so likely not user-impacting.

            Assignee:
            Unassigned
            Reporter:
            Alyssa Clark
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: