When you run an MongoDB Vector Search query with the explain
method, the query returns a BSON document containing query plan and execution statistics that describe how the query was run internally.
구문
db.<myCollection>.explain("<verbosity>").aggregate([ { "$vectorSearch": { "exact": true | false, "filter": {<filter-specification>}, "index": "<index-name>", "limit": <number-of-results>, "numCandidates": <number-of-candidates>, "path": "<field-to-search>", "queryVector": [<array-of-numbers>] } } ])
상세
상세 모드 explain
의 동작과 반환되는 정보의 양을 제어합니다. 값은 상세도가 낮은 순서대로 다음 중 하나일 수 있습니다.
쿼리에 대한 실행 쿼리 가 포함된 | |
쿼리에 대한 실행 통계가 포함된 | |
queryPlanner(기본값) | 쿼리 계획에 대한 정보입니다. 쿼리에 대한 실행 통계를 포함하는 |
결과 설명
explain
메서드는 다음 필드가 있는 BSON 문서 반환합니다.
옵션 | 유형 | 필요성 | 목적 |
---|---|---|---|
| 문서 | 옵션 | 수집기에 대한 실행 통계를 설명합니다. |
| 문서 | 옵션 | 유용한 메타데이터를 포함합니다. |
| 문서 | 옵션 | 쿼리 에 대한 실행 통계를 설명합니다. 이는 |
| 문서 | 옵션 | 쿼리 실행 후 문서별 데이터 검색과 관련된 세부 정보입니다. |
| 문서 | 옵션 | 쿼리가 실행되었을 때 쿼리의 리소스 사용량 세부 정보를 제공합니다. |
collectors
collectors
은 다음 필드 있는 BSON 문서 입니다.
필드 | 유형 | 필요성 | 목적 |
---|---|---|---|
| 문서 | 필수 사항 | 쿼리 의 모든 수집기 통계입니다. 보고된 통계는 쿼리 에 사용된 모든 수집기의 최대값 또는 모든 하위 수집기의 통계 합계를 나타냅니다. 타이밍 통계는 전체 쿼리 에 대해 모든 수집기에서 소요된 총 시간을 반영하기 위해 합산됩니다. 자세한 학습 은 |
allCollectorStats
allCollectorStats
은 쿼리 에 지정된 모든 수집기의 수집기 통계를 설명하는 BSON 문서 입니다. 여기에는 다음과 같은 키가 포함되어 있습니다.
필드 | 설명 |
---|---|
| 수집기가 수집한 결과의 지속 시간과 수량을 추적합니다. |
| 수집기에서 |
| 수집기에 설정된 점수 계산기의 총 지속 시간과 횟수를 추적하는 통계입니다. |
metadata
metadata
는 다음과 같은 유용한 메타데이터를 포함합니다.
필드 | 유형 | 필요성 | 목적 |
---|---|---|---|
| 문자열 | 옵션 |
|
| 문자열 | 옵션 |
|
| 문자열 | 옵션 | MongoDB Vector Search index used in the query. |
| 문서 | 옵션 |
|
| Integer | 옵션 | 삭제된 문서를 포함하여 인덱스 에 있는 총 문서 수입니다. |
query
explain
응답은 쿼리의 실행 통계를 설명하는 키와 값이 포함된 BSON 문서입니다. 결과 세트의 explain
문서에는 다음 필드가 포함되어 있습니다.
필드 | 유형 | 필요성 | 목적 |
---|---|---|---|
| 문자열 | 옵션 | 루트가 아닌 경우에만 쿼리된 임베딩 필드 의 경로입니다. |
| 문자열 | 필수 사항 | 벡터 검색 쿼리 유형의 이름입니다. 자세한 내용은 |
| 문서 | 필수 사항 | 벡터 검색 쿼리 정보입니다. 자세한 내용은 |
| 문서 | 옵션 |
|
args
설명 응답 에는 쿼리 내부적으로 실행된 방식에 대한 정보가 포함되어 있습니다. args
필드 에는 다음과 같은 세부 정보가 포함되어 있습니다.
쿼리 유형
각 쿼리 유형에 대한 구조화된 요약 예시
구조화된 요약의 쿼리 옵션
다음 섹션에서는 구조화된 요약의 쿼리 유형과 필드에 대해 설명합니다.
WrappedKnnQuery
여러 쿼리를 결합하는 ANN 벡터 검색에 사용되는 래퍼 쿼리입니다. 구조화된 요약에는 다음 옵션에 대한 세부 정보가 포함되어 있습니다.
필드유형필요성설명query
배열
필수 사항
벡터 검색 에 사용되는 하위 쿼리의 배열로, 일반적으로
KnnFloatVectorQuery
및DocAndScoreQuery
를 포함합니다.
KnnFloatVectorQuery
부동 소수점 벡터에 대한 ANN 검색과 관련된 쿼리 유형입니다. 구조화된 요약에는 다음 옵션에 대한 세부 정보가 포함되어 있습니다.
필드유형필요성설명field
문자열
필수 사항
검색 중인 벡터 필드 경로 .
k
Integer
필수 사항
조회 할 가장 가까운 이웃의 수입니다.
ExactVectorSearchQuery
ENN 벡터 검색을 위한 쿼리 유형입니다. 구조화된 요약에는 다음 옵션에 대한 세부 정보가 포함되어 있습니다.
필드유형필요성설명field
문자열
필수 사항
검색 중인 벡터 필드 경로 .
similarityFunction
문자열
필수 사항
사용된 유사성 함수(
dotProduct
,cosine
또는euclidean
)입니다.filter
문서
옵션
벡터 검색 범위를 제한하는 사전 필터 쿼리 .
BooleanQuery
If you use a pre-filter in your vector search query, your explain results include the
BooleanQuery
type. To learn more about the fields for this type and other query types specific to your pre-filter query, refer to the Query Types on the MongoDB Search Explain Page.
stats
executionStats 및 allPlansExecution 상세도 모드에 대한 explain
응답에는 stats
쿼리가 쿼리 실행의 다양한 단계 에서 소비하는 시간 에 대한 정보가 포함된 필드가 포함되어 있습니다.
타이밍 분석
타이밍 분석은 쿼리 실행 영역 과 관련된 실행 통계를 설명합니다. 다음 필드에는 타이밍 분석이 표시됩니다.
쿼리 영역
다음 쿼리 영역에 대한 통계를 사용할 수 있습니다.
resourceUsage
resourceUsage
문서는 쿼리 실행에 사용된 리소스를 보여줍니다. 다음 필드를 포함합니다.
필드 | 유형 | 필요성 | 목적 |
---|---|---|---|
| Long | 필수 사항 | 쿼리 실행 중 시스템이 메모리에서 필요한 데이터를 찾지 못해 디스크와 같은 백업 저장소에서 읽게 될 때 발생하는 주요 페이지 폴트 수입니다. |
| Long | 필수 사항 | 데이터가 페이지 캐시에 있지만 아직 프로세스의 페이지 테이블에 매핑되지 않은 경우 발생하는 경미한 페이지 폴트의 수입니다. |
| Long | 필수 사항 | 사용자 공간에서 소요된 CPU 시간(밀리초)입니다. |
| Long | 필수 사항 | 시스템 공간에서 소요된 CPU 시간(단위: 밀리초)입니다. |
| Integer | 필수 사항 | 모든 배치에서 쿼리 실행 중 |
| Integer | 필수 사항 | 쿼리 처리 시 요청된 |
예시
The following examples use the explain
method on sample ANN and ENN queries. If you want to run the following examples in your own environment, you must first complete the MongoDB Vector Search Quick Start using mongosh
.
allPlansExecution
다음 예시 상세도 모드 사용하여 필드 plot_embedding_voyage_3_large
에 대한 ANN 및 ENN 벡터 검색 쿼리 allPlansExecution
에서 explain 메서드를 실행합니다.
db.embedded_movies.explain("allPlansExecution").aggregate([ { "$vectorSearch": { "index": "vector_index", "path": "plot_embedding_voyage_3_large", "queryVector": QUERY_EMBEDDING, "numCandidates": 150, "limit": 10 } } ])
1 { 2 explainVersion: '1', 3 stages: [ 4 { 5 '$vectorSearch': { 6 index: 'vector_index', 7 path: 'plot_embedding_voyage_3_large', 8 queryVector: [ 9 -0.034731735, 0.008558298, -0.0153717, -0.029912498, 0.011549547, 10 ..., 11 -0.006688767, 0.047527634, 0.040714234 12 ], 13 numCandidates: 150, 14 limit: 10, 15 explain: { 16 query: { 17 type: 'WrappedKnnQuery', 18 args: { 19 query: [ 20 { 21 type: 'InstrumentableKnnFloatVectorQuery', 22 args: { 23 field: '$type:knnVector/plot_embedding_voyage_3_large', 24 k: 150 25 }, 26 stats: { 27 context: { millisElapsed: 0 }, 28 match: { millisElapsed: 0 }, 29 score: { millisElapsed: 0 } 30 } 31 }, 32 { 33 type: 'DocAndScoreQuery', 34 args: {}, 35 stats: { 36 context: { 37 millisElapsed: 15.794112, 38 invocationCounts: { 39 createWeight: Long('1'), 40 createScorer: Long('4') 41 } 42 }, 43 match: { 44 millisElapsed: 0.084957, 45 invocationCounts: { nextDoc: Long('152') } 46 }, 47 score: { 48 millisElapsed: 0.688285, 49 invocationCounts: { 50 score: Long('150'), 51 setMinCompetitiveScore: Long('25') 52 } 53 } 54 } 55 } 56 ] 57 }, 58 stats: { 59 context: { 60 millisElapsed: 76.547561, 61 invocationCounts: { 62 vectorExecution: Long('1'), 63 createWeight: Long('1'), 64 createScorer: Long('4') 65 } 66 }, 67 match: { 68 millisElapsed: 0.084957, 69 invocationCounts: { nextDoc: Long('152') } 70 }, 71 score: { 72 millisElapsed: 0.688285, 73 invocationCounts: { 74 score: Long('150'), 75 setMinCompetitiveScore: Long('25') 76 } 77 } 78 } 79 }, 80 collectors: { 81 allCollectorStats: { 82 millisElapsed: 2.513847, 83 invocationCounts: { 84 collect: Long('150'), 85 competitiveIterator: Long('2'), 86 setScorer: Long('2') 87 } 88 } 89 }, 90 metadata: { 91 mongotVersion: '1.49.3', 92 mongotHostName: '<hostname>.mongodb.net', 93 indexName: 'vector_index', 94 lucene: { totalSegments: 2, totalDocs: 3483 } 95 }, 96 resourceUsage: { 97 majorFaults: Long('0'), 98 minorFaults: Long('0'), 99 userTimeMs: Long('0'), 100 systemTimeMs: Long('0'), 101 maxReportingThreads: 1, 102 numBatches: 1 103 }, 104 luceneVectorSegmentStats: [ 105 { 106 executionType: 'Approximate', 107 docCount: 3420, 108 approximateStage: { millisElapsed: 47.246946 } 109 }, 110 { 111 executionType: 'Approximate', 112 docCount: 63, 113 approximateStage: { millisElapsed: 0.520547 } 114 } 115 ] 116 } 117 }, 118 nReturned: Long('0'), 119 executionTimeMillisEstimate: Long('306') 120 }, 121 { 122 '$_internalSearchIdLookup': { limit: Long('10') }, 123 nReturned: Long('0'), 124 executionTimeMillisEstimate: Long('306') 125 } 126 ], 127 queryShapeHash: '2816D59590F550220114018918B7CF7D39CFFD6832A9D0FAAAD28D70B83A3185', 128 serverInfo: { 129 host: '<hostname>.mongodb.net', 130 port: 27017, 131 version: '8.0.3', 132 gitVersion: 'bed99f699da6cb2b74262aa6d473446c41476643' 133 }, 134 serverParameters: { 135 internalQueryFacetBufferSizeBytes: 104857600, 136 internalQueryFacetMaxOutputDocSizeBytes: 104857600, 137 internalLookupStageIntermediateDocumentMaxSizeBytes: 16793600, 138 internalDocumentSourceGroupMaxMemoryBytes: 104857600, 139 internalQueryMaxBlockingSortMemoryUsageBytes: 33554432, 140 internalQueryProhibitBlockingMergeOnMongoS: 0, 141 internalQueryMaxAddToSetBytes: 104857600, 142 internalDocumentSourceSetWindowFieldsMaxMemoryBytes: 104857600, 143 internalQueryFrameworkControl: 'trySbeRestricted', 144 internalQueryPlannerIgnoreIndexWithCollationForRegex: 1 145 }, 146 command: { 147 aggregate: 'embedded_movies', 148 pipeline: [ 149 { 150 '$vectorSearch': { 151 index: 'vector_index', 152 path: 'plot_embedding_voyage_3_large', 153 queryVector: [ 154 -0.034731735, 0.008558298, -0.0153717, -0.029912498, 0.011549547, 155 ..., 156 -0.006688767, 0.047527634, 0.040714234 157 ], 158 numCandidates: 150, 159 limit: 10 160 } 161 } 162 ], 163 cursor: {}, 164 '$db': 'sample_mflix' 165 }, 166 ok: 1, 167 '$clusterTime': { 168 clusterTime: Timestamp({ t: 1752447925, i: 20 }), 169 signature: { 170 hash: Binary.createFromBase64('JELVXSAkvhOwS5+CSP58Hj7wJZA=', 0), 171 keyId: Long('7485474929970774018') 172 } 173 }, 174 operationTime: Timestamp({ t: 1752447925, i: 20 }) 175 }
db.embedded_movies.explain("allPlansExecution").aggregate([ { "$vectorSearch": { "index": "vector_index", "path": "plot_embedding_voyage_3_large", "queryVector": QUERY_EMBEDDING, "exact": true, "limit": 10 } } ])
{ explainVersion: '1', stages: [ { '$vectorSearch': { index: 'vector_index', path: 'plot_embedding_voyage_3_large', queryVector: [ -0.034731735, 0.008558298, -0.0153717, -0.029912498, 0.011549547, ..., -0.006688767, 0.047527634, 0.040714234 ], exact: true, limit: 10, explain: { query: { type: 'ExactVectorSearchQuery', args: { field: '$type:knnVector/plot_embedding_voyage_3_large', similarityFunction: 'dotProduct', filter: { type: 'DefaultQuery', args: { queryType: 'FieldExistsQuery' }, stats: { context: { millisElapsed: 0.930996, invocationCounts: { createWeight: Long('1'), createScorer: Long('4') } }, match: { millisElapsed: 4.238513, invocationCounts: { nextDoc: Long('3405') } }, score: { millisElapsed: 0 } } } }, stats: { context: { millisElapsed: 1.657495, invocationCounts: { createWeight: Long('1'), createScorer: Long('4') } }, match: { millisElapsed: 17.668666, invocationCounts: { nextDoc: Long('3405') } }, score: { millisElapsed: 19.425755, invocationCounts: { score: Long('3403'), setMinCompetitiveScore: Long('63') } } } }, collectors: { allCollectorStats: { millisElapsed: 23.323921, invocationCounts: { collect: Long('3403'), competitiveIterator: Long('2'), setScorer: Long('2') } } }, metadata: { mongotVersion: '1.49.3', mongotHostName: '<hostname>.mongodb.net', indexName: 'vector_index', lucene: { totalSegments: 2, totalDocs: 3483 } }, resourceUsage: { majorFaults: Long('0'), minorFaults: Long('0'), userTimeMs: Long('0'), systemTimeMs: Long('0'), maxReportingThreads: 1, numBatches: 1 } } }, nReturned: Long('0'), executionTimeMillisEstimate: Long('75') }, { '$_internalSearchIdLookup': { limit: Long('10') }, nReturned: Long('0'), executionTimeMillisEstimate: Long('75') } ], queryShapeHash: '2816D59590F550220114018918B7CF7D39CFFD6832A9D0FAAAD28D70B83A3185', serverInfo: { host: '<hostname>.mongodb.net', port: 27017, version: '8.0.3', gitVersion: 'bed99f699da6cb2b74262aa6d473446c41476643' }, serverParameters: { internalQueryFacetBufferSizeBytes: 104857600, internalQueryFacetMaxOutputDocSizeBytes: 104857600, internalLookupStageIntermediateDocumentMaxSizeBytes: 16793600, internalDocumentSourceGroupMaxMemoryBytes: 104857600, internalQueryMaxBlockingSortMemoryUsageBytes: 33554432, internalQueryProhibitBlockingMergeOnMongoS: 0, internalQueryMaxAddToSetBytes: 104857600, internalDocumentSourceSetWindowFieldsMaxMemoryBytes: 104857600, internalQueryFrameworkControl: 'trySbeRestricted', internalQueryPlannerIgnoreIndexWithCollationForRegex: 1 }, command: { aggregate: 'embedded_movies', pipeline: [ { '$vectorSearch': { index: 'vector_index', path: 'plot_embedding_voyage_3_large', queryVector: [ -0.034731735, 0.008558298, -0.0153717, -0.029912498, 0.011549547, ..., -0.006688767, 0.047527634, 0.040714234 ], exact: true, limit: 10 } } ], cursor: {}, '$db': 'sample_mflix' }, ok: 1, '$clusterTime': { clusterTime: Timestamp({ t: 1752448055, i: 1 }), signature: { hash: Binary.createFromBase64('CgUWjXI0nRt1qJLXIPYHurdhutI=', 0), keyId: Long('7485474929970774018') } }, operationTime: Timestamp({ t: 1752448055, i: 1 }) }
queryPlanner
다음 예시 상세도 모드 사용하여 필드 plot_embedding_voyage_3_large
에 대한 ANN 및 ENN 벡터 검색 쿼리 queryPlanner
에서 explain 메서드를 실행합니다.
db.embedded_movies.explain("queryPlanner").aggregate([ { "$vectorSearch": { "index": "vector_index", "path": "plot_embedding_voyage_3_large", "queryVector": QUERY_EMBEDDING, "numCandidates": 150, "limit": 10 } } ])
{ explainVersion: '1', stages: [ { '$vectorSearch': { index: 'vector_index', path: 'plot_embedding_voyage_3_large', queryVector: [ -0.034731735, 0.008558298, -0.0153717, -0.029912498, 0.011549547, ..., -0.006688767, 0.047527634, 0.040714234 ], numCandidates: 150, limit: 10, explain: { query: { type: 'WrappedKnnQuery', args: { query: [ { type: 'InstrumentableKnnFloatVectorQuery', args: { field: '$type:knnVector/plot_embedding_voyage_3_large', k: 150 } }, { type: 'DocAndScoreQuery', args: {} } ] } }, metadata: { mongotVersion: '1.49.3', mongotHostName: '<hostname>.mongodb.net', indexName: 'vector_index', lucene: { totalSegments: 2, totalDocs: 3483 } } } } }, { '$_internalSearchIdLookup': { limit: Long('10') } } ], queryShapeHash: '2816D59590F550220114018918B7CF7D39CFFD6832A9D0FAAAD28D70B83A3185', serverInfo: { host: '<hostname>.mongodb.net', port: 27017, version: '8.0.3', gitVersion: 'bed99f699da6cb2b74262aa6d473446c41476643' }, serverParameters: { internalQueryFacetBufferSizeBytes: 104857600, internalQueryFacetMaxOutputDocSizeBytes: 104857600, internalLookupStageIntermediateDocumentMaxSizeBytes: 16793600, internalDocumentSourceGroupMaxMemoryBytes: 104857600, internalQueryMaxBlockingSortMemoryUsageBytes: 33554432, internalQueryProhibitBlockingMergeOnMongoS: 0, internalQueryMaxAddToSetBytes: 104857600, internalDocumentSourceSetWindowFieldsMaxMemoryBytes: 104857600, internalQueryFrameworkControl: 'trySbeRestricted', internalQueryPlannerIgnoreIndexWithCollationForRegex: 1 }, command: { aggregate: 'embedded_movies', pipeline: [ { '$vectorSearch': { index: 'vector_index', path: 'plot_embedding_voyage_3_large', queryVector: [ -0.034731735, 0.008558298, -0.0153717, -0.029912498, 0.011549547, ..., -0.006688767, 0.047527634, 0.040714234 ], numCandidates: 150, limit: 10 } } ], cursor: {}, '$db': 'sample_mflix' }, ok: 1, '$clusterTime': { clusterTime: Timestamp({ t: 1752448485, i: 1 }), signature: { hash: Binary.createFromBase64('iYSyi5w37pkDySHs527CKYShigA=', 0), keyId: Long('7485474929970774018') } }, operationTime: Timestamp({ t: 1752448485, i: 1 }) }
db.embedded_movies.explain("queryPlanner").aggregate([ { "$vectorSearch": { "index": "vector_index", "path": "plot_embedding_voyage_3_large", "queryVector": QUERY_EMBEDDING, "exact": true, "limit": 10 } } ])
{ explainVersion: '1', stages: [ { '$vectorSearch': { index: 'vector_index', path: 'plot_embedding_voyage_3_large', queryVector: [ -0.034731735, 0.008558298, -0.0153717, -0.029912498, 0.011549547, ..., -0.006688767, 0.047527634, 0.040714234 ], exact: true, limit: 10, explain: { query: { type: 'ExactVectorSearchQuery', args: { field: '$type:knnVector/plot_embedding_voyage_3_large', similarityFunction: 'dotProduct', filter: { type: 'DefaultQuery', args: { queryType: 'FieldExistsQuery' } } } }, metadata: { mongotVersion: '1.49.3', mongotHostName: '<hostname>.mongodb.net', indexName: 'vector_index', lucene: { totalSegments: 2, totalDocs: 3483 } } } } }, { '$_internalSearchIdLookup': { limit: Long('10') } } ], queryShapeHash: '2816D59590F550220114018918B7CF7D39CFFD6832A9D0FAAAD28D70B83A3185', serverInfo: { host: '<hostname>.mongodb.net', port: 27017, version: '8.0.3', gitVersion: 'bed99f699da6cb2b74262aa6d473446c41476643' }, serverParameters: { internalQueryFacetBufferSizeBytes: 104857600, internalQueryFacetMaxOutputDocSizeBytes: 104857600, internalLookupStageIntermediateDocumentMaxSizeBytes: 16793600, internalDocumentSourceGroupMaxMemoryBytes: 104857600, internalQueryMaxBlockingSortMemoryUsageBytes: 33554432, internalQueryProhibitBlockingMergeOnMongoS: 0, internalQueryMaxAddToSetBytes: 104857600, internalDocumentSourceSetWindowFieldsMaxMemoryBytes: 104857600, internalQueryFrameworkControl: 'trySbeRestricted', internalQueryPlannerIgnoreIndexWithCollationForRegex: 1 }, command: { aggregate: 'embedded_movies', pipeline: [ { '$vectorSearch': { index: 'vector_index', path: 'plot_embedding_voyage_3_large', queryVector: [ -0.034731735, 0.008558298, -0.0153717, -0.029912498, 0.011549547, ..., -0.006688767, 0.047527634, 0.040714234 ], exact: true, limit: 10 } } ], cursor: {}, '$db': 'sample_mflix' }, ok: 1, '$clusterTime': { clusterTime: Timestamp({ t: 1752448635, i: 1 }), signature: { hash: Binary.createFromBase64('owXx/7Ttr9TxABg103TayYunJN4=', 0), keyId: Long('7485474929970774018') } }, operationTime: Timestamp({ t: 1752448635, i: 1 }) }
executionStats
다음 예시 상세도 모드 사용하여 필드 plot_embedding_voyage_3_large
에 대한 ANN 및 ENN 벡터 검색 쿼리 executionStats
에서 explain 메서드를 실행합니다.
db.embedded_movies.explain("executionStats").aggregate([ { "$vectorSearch": { "index": "vector_index", "path": "plot_embedding_voyage_3_large", "queryVector": QUERY_EMBEDDING, "numCandidates": 150, "limit": 10 } } ])
{ explainVersion: '1', stages: [ { '$vectorSearch': { index: 'vector_index', path: 'plot_embedding_voyage_3_large', queryVector: [ -0.034731735, 0.008558298, -0.0153717, -0.029912498, 0.011549547, ..., -0.006688767, 0.047527634, 0.040714234 ], numCandidates: 150, limit: 10, explain: { query: { type: 'WrappedKnnQuery', args: { query: [ { type: 'InstrumentableKnnFloatVectorQuery', args: { field: '$type:knnVector/plot_embedding_voyage_3_large', k: 150 }, stats: { context: { millisElapsed: 0 }, match: { millisElapsed: 0 }, score: { millisElapsed: 0 } } }, { type: 'DocAndScoreQuery', args: {}, stats: { context: { millisElapsed: 0.013604, invocationCounts: { createWeight: Long('1'), createScorer: Long('4') } }, match: { millisElapsed: 0.036124, invocationCounts: { nextDoc: Long('152') } }, score: { millisElapsed: 0.068273, invocationCounts: { score: Long('150'), setMinCompetitiveScore: Long('25') } } } } ] }, stats: { context: { millisElapsed: 4.770557, invocationCounts: { vectorExecution: Long('1'), createWeight: Long('1'), createScorer: Long('4') } }, match: { millisElapsed: 0.036124, invocationCounts: { nextDoc: Long('152') } }, score: { millisElapsed: 0.068273, invocationCounts: { score: Long('150'), setMinCompetitiveScore: Long('25') } } } }, collectors: { allCollectorStats: { millisElapsed: 0.235587, invocationCounts: { collect: Long('150'), competitiveIterator: Long('2'), setScorer: Long('2') } } }, metadata: { mongotVersion: '1.49.3', mongotHostName: '<hostname>.mongodb.net', indexName: 'vector_index', lucene: { totalSegments: 2, totalDocs: 3483 } }, resourceUsage: { majorFaults: Long('0'), minorFaults: Long('0'), userTimeMs: Long('0'), systemTimeMs: Long('0'), maxReportingThreads: 1, numBatches: 1 }, luceneVectorSegmentStats: [ { executionType: 'Approximate', docCount: 3420, approximateStage: { millisElapsed: 3.849357 } }, { executionType: 'Approximate', docCount: 63, approximateStage: { millisElapsed: 0.265218 } } ] } }, nReturned: Long('0'), executionTimeMillisEstimate: Long('16') }, { '$_internalSearchIdLookup': { limit: Long('10') }, nReturned: Long('0'), executionTimeMillisEstimate: Long('16') } ], queryShapeHash: '2816D59590F550220114018918B7CF7D39CFFD6832A9D0FAAAD28D70B83A3185', serverInfo: { host: '<hostname>.mongodb.net', port: 27017, version: '8.0.3', gitVersion: 'bed99f699da6cb2b74262aa6d473446c41476643' }, serverParameters: { internalQueryFacetBufferSizeBytes: 104857600, internalQueryFacetMaxOutputDocSizeBytes: 104857600, internalLookupStageIntermediateDocumentMaxSizeBytes: 16793600, internalDocumentSourceGroupMaxMemoryBytes: 104857600, internalQueryMaxBlockingSortMemoryUsageBytes: 33554432, internalQueryProhibitBlockingMergeOnMongoS: 0, internalQueryMaxAddToSetBytes: 104857600, internalDocumentSourceSetWindowFieldsMaxMemoryBytes: 104857600, internalQueryFrameworkControl: 'trySbeRestricted', internalQueryPlannerIgnoreIndexWithCollationForRegex: 1 }, command: { aggregate: 'embedded_movies', pipeline: [ { '$vectorSearch': { index: 'vector_index', path: 'plot_embedding_voyage_3_large', queryVector: [ -0.034731735, 0.008558298, -0.0153717, -0.029912498, 0.011549547, ..., -0.006688767, 0.047527634, 0.040714234 ], numCandidates: 150, limit: 10 } } ], cursor: {}, '$db': 'sample_mflix' }, ok: 1, '$clusterTime': { clusterTime: Timestamp({ t: 1752448765, i: 1 }), signature: { hash: Binary.createFromBase64('fPG6SZuq84jgloPSQYmnngr1kdU=', 0), keyId: Long('7485474929970774018') } }, operationTime: Timestamp({ t: 1752448765, i: 1 }) }
db.embedded_movies.explain("executionStats").aggregate([ { "$vectorSearch": { "index": "vector_index", "path": "plot_embedding_voyage_3_large", "queryVector": QUERY_EMBEDDING, "exact": true, "limit": 10 } } ])
{ explainVersion: '1', stages: [ { '$vectorSearch': { index: 'vector_index', path: 'plot_embedding_voyage_3_large', queryVector: [ -0.034731735, 0.008558298, -0.0153717, -0.029912498, 0.011549547, ..., -0.006688767, 0.047527634, 0.040714234 ], exact: true, limit: 10, explain: { query: { type: 'ExactVectorSearchQuery', args: { field: '$type:knnVector/plot_embedding_voyage_3_large', similarityFunction: 'dotProduct', filter: { type: 'DefaultQuery', args: { queryType: 'FieldExistsQuery' }, stats: { context: { millisElapsed: 0.098481, invocationCounts: { createWeight: Long('1'), createScorer: Long('4') } }, match: { millisElapsed: 0.430795, invocationCounts: { nextDoc: Long('3405') } }, score: { millisElapsed: 0 } } } }, stats: { context: { millisElapsed: 0.143681, invocationCounts: { createWeight: Long('1'), createScorer: Long('4') } }, match: { millisElapsed: 0.928141, invocationCounts: { nextDoc: Long('3405') } }, score: { millisElapsed: 7.96188, invocationCounts: { score: Long('3403'), setMinCompetitiveScore: Long('63') } } } }, collectors: { allCollectorStats: { millisElapsed: 12.335932, invocationCounts: { collect: Long('3403'), competitiveIterator: Long('2'), setScorer: Long('2') } } }, metadata: { mongotVersion: '1.49.3', mongotHostName: '<hostname>.mongodb.net', indexName: 'vector_index', lucene: { totalSegments: 2, totalDocs: 3483 } }, resourceUsage: { majorFaults: Long('0'), minorFaults: Long('0'), userTimeMs: Long('0'), systemTimeMs: Long('0'), maxReportingThreads: 1, numBatches: 1 } } }, nReturned: Long('0'), executionTimeMillisEstimate: Long('38') }, { '$_internalSearchIdLookup': { limit: Long('10') }, nReturned: Long('0'), executionTimeMillisEstimate: Long('38') } ], queryShapeHash: '2816D59590F550220114018918B7CF7D39CFFD6832A9D0FAAAD28D70B83A3185', serverInfo: { host: '<hostname>.mongodb.net', port: 27017, version: '8.0.3', gitVersion: 'bed99f699da6cb2b74262aa6d473446c41476643' }, serverParameters: { internalQueryFacetBufferSizeBytes: 104857600, internalQueryFacetMaxOutputDocSizeBytes: 104857600, internalLookupStageIntermediateDocumentMaxSizeBytes: 16793600, internalDocumentSourceGroupMaxMemoryBytes: 104857600, internalQueryMaxBlockingSortMemoryUsageBytes: 33554432, internalQueryProhibitBlockingMergeOnMongoS: 0, internalQueryMaxAddToSetBytes: 104857600, internalDocumentSourceSetWindowFieldsMaxMemoryBytes: 104857600, internalQueryFrameworkControl: 'trySbeRestricted', internalQueryPlannerIgnoreIndexWithCollationForRegex: 1 }, command: { aggregate: 'embedded_movies', pipeline: [ { '$vectorSearch': { index: 'vector_index', path: 'plot_embedding_voyage_3_large', queryVector: [ -0.034731735, 0.008558298, -0.0153717, -0.029912498, 0.011549547, ..., -0.006688767, 0.047527634, 0.040714234 ], exact: true, limit: 10 } } ], cursor: {}, '$db': 'sample_mflix' }, ok: 1, '$clusterTime': { clusterTime: Timestamp({ t: 1752449065, i: 1 }), signature: { hash: Binary.createFromBase64('TwyeFcQsr24W6cTIx7ZIb/R0H6I=', 0), keyId: Long('7485474929970774018') } }, operationTime: Timestamp({ t: 1752449065, i: 1 }) }