Docs Menu

Explain Atlas Vector Search Results

When you run an Atlas 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.

See also:

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>]
}
}
])

Verbosity mode controls the behavior of explain and the amount of information returned. Value can be one of the following, in order of decreasing verbosity:

Information about the query plan including the stats fields, which contain execution statistics for the query. Includes partial execution data captured during plan selection.

Information about the query plan including the stats fields, which contain execution statistics for the query.

queryPlanner (default)

Information about the query plan. Does not include the stats fields, which contain execution statistics for the query.

See also:

The explain method returns a BSON document with the following fields.

Option
Type
Necessity
Purpose

collectors

document

Optional

Describes the execution statistics for the collector.

metadata

document

Optional

Contains useful metadata.

query

document

Optional

Describes the execution statistics for the query. This is not present at the the top level for indexPartitionExplain.

resultMaterialization

document

Optional

Details related to retrieving per-document data after query execution. This is not returned for queryPlanner verbosity mode.

resourceUsage

document

Optional

Details the resource usage of the query when it was executed. This is not returned for queryPlanner verbosity mode.

The collectors is a BSON document with the following field:

Field
Type
Necessity
Purpose

allCollectorStats

document

Required

Statistics of all collectors of the query. Statistics reported represent either the maximum value across all collectors used in the query or a sum of the statistic across all the sub-collectors. The timing statistics are summed to reflect the total time spent across all collectors for the entire query. To learn more, see allCollectorStats.

The allCollectorStats is a BSON document that describes collector statistics across all collectors specified in the query. It contains the following keys:

Field
Description

collect

Tracks the duration and number of results collected by the collector.

competitiveIterator

Statistics tracking the total duration and the number of times a competitiveIterator was requested from the collector.

setScorer

Statistics tracking the total duration and number of times a scorer was set on the collector.

The metadata contains helpful metadata, such as the following:

Field
Type
Necessity
Purpose

mongotVersion

String

Optional

Current version of mongot.

mongotHostName

String

Optional

Human readable label that identifies the mongot host.

indexName

String

Optional

Atlas Vector Search index used in the query.

cursorOptions

Document

Optional

Cursor options given to mongot.

totalLuceneDocs

Integer

Optional

Total number of documents in the index including deleted documents.

The explain response is a BSON document with keys and values describing the execution statistics for the query. The explain document in the result set contains the following fields:

Field
Type
Necessity
Purpose

path

string

Optional

Path to the queried embedding field, only if it isn't the root.

type

string

Required

Name of the type of vector search query. See query for more information.

args

document

Required

Vector search query information. See query for more information.

stats

document

Optional

stats for the query if explain ran with executionStats or allPlansExecution verbosity.

The explain response contains information how the query was executed internally. The args field includes the following details:

  • Query type

  • A structured summary example for each query type

  • Query options in the structured summary

The following sections describe the query types and the fields in the structured summaries:

WrappedKnnQuery

A wrapper query used for ANN vector search that combines multiple queries. The structured summary includes details on the following option:

Field
Type
Necessity
Description

query

Array

Required

Array of sub-queries used in the vector search, typically containing KnnFloatVectorQuery and DocAndScoreQuery.

KnnFloatVectorQuery

A query type specific to ANN search on float vectors. The structured summary includes details on the following options:

Field
Type
Necessity
Description

field

String

Required

The vector field path being searched.

k

Integer

Required

Number of nearest neighbors to retrieve.

DocAndScoreQuery

A query type that handles document matching and scoring. The structured summary typically includes statistics about query execution.

ExactVectorSearchQuery

A query type for ENN vector searches. The structured summary includes details on the following options:

Field
Type
Necessity
Description

field

String

Required

The vector field path being searched.

similarityFunction

String

Required

The similarity function used (dotProduct, cosine, or euclidean).

filter

Document

Optional

Pre-filter query that limits the vector search scope.

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 Atlas Search Explain Page.

DefaultQuery

Queries that are not explicitly defined by another query are serialized using the default query. The structured summary includes details on the following option:

Field
Type
Necessity
Description

queryType

String

Required

Type of query.

The explain response for executionStats and allPlansExecution verbosity modes includes a stats field that contains information on how much time a query spends in various stages of query execution.

The timing breakdown describes execution statistics pertinent to an areas of query execution. The following fields show the timing breakdown:

Field
Type
Description

millisElapsed

Long

Approximate wall-clock time elapsed performing tasks in this area including the amount of time the children of the query spent in this area. The value is approximate number of milliseconds elapsed while performing tasks in this area.

invocationCounts

Document

Number of invocations of tasks included in this area. The value is a map of task names to their invocation count.

Statistics are available for the following areas of query:

Option
Description

context

Statistics related to the execution of the vector search query. There are two tasks whose invocation counts are enumerated in this area:

createScorer

Scorer iterates over documents and generates a score for each document. Invocations of createScorer create the object responsible for scoring. Note that time associated with this task is not time spent actually scoring documents. Count includes the number of scorerSupplier invocations.

createWeight

Weight stores state associated with a query and IndexSearcher. Count includes the number of createWeight invocations.

The time spent in this area is related to the structure of the query, and is not based on the number of results that are iterated through and scored.

For example:

"context" : {
"millisElapsed" : NumberDouble(4.934751),
"invocationCounts" : {
"createWeight" : NumberLong(1),
"createScorer" : NumberLong(10)
}
}

match

Statistics related to iterating over and matching result documents. This statistic shows the time it takes to determine which document is the next match. Time spent matching results can vary significantly depending on the nature of the query. There are two tasks whose invocation counts are enumerated in this area:

nextDoc

Requests to advance to the next document of the result set. This involves identifying and moving past skips, or other tasks necessary to find the next match. Count includes the number of nextDoc and advance invocations.

refineRoughMatch

Performs a more thorough match. Some queries execute in a two-phase process where a document is first "roughly" matched, and is checked with a second, more thorough phase only after satisfying the first rough match. The refineRoughMatch task is the second phase of the two-phase process. Count includes the number of refineRoughMatch invocations.

For example:

"match" : {
"millisElapsed" : NumberDouble(4.901597),
"invocationCounts" : {
"nextDoc" : NumberLong(541),
"refineRoughMatch" : NumberLong(0)
}
}

score

Statistics related to scoring documents in the result set. There are two tasks whose invocation counts are enumerated in this area:

score

Scores each document in the result set. Count includes the number of score invocations.

setMinCompetitiveScore

Ignores documents whose score is less than the given value. Indicates that a query may have been able to reduce the number of scoring operations performed by ignoring documents with scores below some uncompetitive threshold. Count includes the number of setMinCompetitiveScore invocations.

For example:

"score" : {
"millisElapsed" : NumberDouble(3.931312),
"invocationCounts" : {
"score" : NumberLong(536),
"setMinCompetitiveScore" : NumberLong(0)
}
}

The resourceUsage document shows the resource used for running the query. It contains the following fields:

Field
Type
Necessity
Purpose

majorFaults

Long

Required

Number of major page faults, which occur when the system can't find the required data in memory resulting in reading from the backing store such as disk, during query execution.

minorFaults

Long

Required

Number of minor page faults, which occur when the data is in the page cache, but hasn't yet been mapped to the process' page table.

userTimeMs

Long

Required

Amount of CPU time, in milliseconds, spent in user space.

systemTimeMs

Long

Required

Amount of CPU time, in milliseconds, spent in system space.

maxReportingThreads

Integer

Required

Maximum number of threads that mongot used during query execution across all batches. For non-concurrent explain queries, the value is 1.

numBatches

Integer

Required

Total number of batches that mongot was requested when processing the query.

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 Atlas Vector Search Quick Start using mongosh.

The following example runs the explain method on an ANN and ENN vector search query for the plot_embedding field with the allPlansExecution verbosity mode.

db.embedded_movies.explain("allPlansExecution").aggregate([
{
"$vectorSearch": {
"index": "vector_index",
"path": "plot_embedding",
"queryVector": QUERY_EMBEDDING,
"numCandidates": 150,
"limit": 10
}
}
])
{
explainVersion: '1',
stages: [
{
'$vectorSearch': {
index: 'vector_index',
path: 'plot_embedding',
queryVector: [
-0.0016261312, -0.028070757, -0.011342932, -0.012775794,
...
-0.0060913274, -0.007130985, -0.013109017, -0.009710136
],
numCandidates: 150,
limit: 10,
explain: {
query: {
type: 'WrappedKnnQuery',
args: {
query: [
{
type: 'KnnFloatVectorQuery',
args: { field: '$type:knnVector/plot_embedding', k: 150 },
stats: {
context: { millisElapsed: 0 },
match: { millisElapsed: 0 },
score: { millisElapsed: 0 }
}
},
{
type: 'DocAndScoreQuery',
args: {},
stats: {
context: {
millisElapsed: 0.011281,
invocationCounts: {
createWeight: Long('1'),
createScorer: Long('2')
}
},
match: {
millisElapsed: 0.045831,
invocationCounts: { nextDoc: Long('151') }
},
score: {
millisElapsed: 0.049853,
invocationCounts: {
score: Long('150'),
setMinCompetitiveScore: Long('30')
}
}
}
}
]
},
stats: {
context: {
millisElapsed: 3.226133,
invocationCounts: {
vectorExecution: Long('1'),
createWeight: Long('1'),
createScorer: Long('2')
}
},
match: {
millisElapsed: 0.045831,
invocationCounts: { nextDoc: Long('151') }
},
score: {
millisElapsed: 0.049853,
invocationCounts: {
score: Long('150'),
setMinCompetitiveScore: Long('30')
}
}
}
},
collectors: {
allCollectorStats: {
millisElapsed: 0.211472,
invocationCounts: {
collect: Long('150'),
competitiveIterator: Long('1'),
setScorer: Long('1')
}
},
facet: { collectorStats: { millisElapsed: 0 } }
},
metadata: {
mongotVersion: '1.44.0',
mongotHostName: '<hostname>.mongodb.net',
indexName: 'vector_index',
totalLuceneDocs: 3483
},
resourceUsage: {
majorFaults: Long('0'),
minorFaults: Long('0'),
userTimeMs: Long('0'),
systemTimeMs: Long('0'),
maxReportingThreads: 1,
numBatches: 1
}
}
},
nReturned: Long('0'),
executionTimeMillisEstimate: Long('29')
},
{
'$_internalSearchIdLookup': { limit: Long('10') },
nReturned: Long('0'),
executionTimeMillisEstimate: Long('29')
}
],
queryShapeHash: '9EFFBE6AC5B8DC66D20DB8939CF3ED6669D0C09BB6938C17AD3FB8C7793765B8',
serverInfo: {
host: '<hostname>.mongodb.net',
port: 27017,
version: '8.0.5',
gitVersion: 'cb9e2e5e552ee39dea1e39d7859336456d0c9820'
},
serverParameters: {
internalQueryFacetBufferSizeBytes: 104857600,
internalQueryFacetMaxOutputDocSizeBytes: 104857600,
internalLookupStageIntermediateDocumentMaxSizeBytes: 104857600,
internalDocumentSourceGroupMaxMemoryBytes: 104857600,
internalQueryMaxBlockingSortMemoryUsageBytes: 104857600,
internalQueryProhibitBlockingMergeOnMongoS: 0,
internalQueryMaxAddToSetBytes: 104857600,
internalDocumentSourceSetWindowFieldsMaxMemoryBytes: 104857600,
internalQueryFrameworkControl: 'trySbeRestricted',
internalQueryPlannerIgnoreIndexWithCollationForRegex: 1
},
command: {
aggregate: 'embedded_movies',
pipeline: [
{
'$vectorSearch': {
index: 'vector_index',
path: 'plot_embedding',
queryVector: [
-0.0016261312, -0.028070757, -0.011342932, -0.012775794,
...
-0.0060913274, -0.007130985, -0.013109017, -0.009710136
],
numCandidates: 150,
limit: 10
}
}
],
cursor: {},
'$db': 'sample_mflix'
},
ok: 1,
'$clusterTime': {
clusterTime: Timestamp({ t: 1740781674, i: 1 }),
signature: {
hash: Binary.createFromBase64('gpGnPOB17p3NnKu74vhm+kCLXf8=', 0),
keyId: Long('7446434162581438465')
}
},
operationTime: Timestamp({ t: 1740781674, i: 1 })
}
db.embedded_movies.explain("allPlansExecution").aggregate([
{
"$vectorSearch": {
"index": "vector_index",
"path": "plot_embedding",
"queryVector": QUERY_EMBEDDING,
"exact": true,
"limit": 10
}
}
])
{
explainVersion: '1',
stages: [
{
'$vectorSearch': {
index: 'vector_index',
path: 'plot_embedding',
queryVector: [
-0.0016261312, -0.028070757, -0.011342932, -0.012775794,
...
-0.0060913274, -0.007130985, -0.013109017, -0.009710136
],
exact: true,
limit: 10,
explain: {
query: {
type: 'ExactVectorSearchQuery',
args: {
field: '$type:knnVector/plot_embedding',
similarityFunction: 'dotProduct',
filter: {
type: 'DefaultQuery',
args: { queryType: 'FieldExistsQuery' },
stats: {
context: {
millisElapsed: 0.031999,
invocationCounts: {
createWeight: Long('1'),
createScorer: Long('2')
}
},
match: {
millisElapsed: 1.2138,
invocationCounts: { nextDoc: Long('3403') }
},
score: { millisElapsed: 0 }
}
}
},
stats: {
context: {
millisElapsed: 0.055318,
invocationCounts: { createWeight: Long('1'), createScorer: Long('2') }
},
match: {
millisElapsed: 2.578062,
invocationCounts: { nextDoc: Long('3403') }
},
score: {
millisElapsed: 5.624325,
invocationCounts: {
score: Long('3402'),
setMinCompetitiveScore: Long('71')
}
}
}
},
collectors: {
allCollectorStats: {
millisElapsed: 7.095773,
invocationCounts: {
collect: Long('3402'),
competitiveIterator: Long('1'),
setScorer: Long('1')
}
},
facet: { collectorStats: { millisElapsed: 0 } }
},
metadata: {
mongotVersion: '1.44.0',
mongotHostName: '<hostname>.mongodb.net',
indexName: 'vector_index',
totalLuceneDocs: 3483
},
resourceUsage: {
majorFaults: Long('0'),
minorFaults: Long('0'),
userTimeMs: Long('0'),
systemTimeMs: Long('0'),
maxReportingThreads: 1,
numBatches: 1
}
}
},
nReturned: Long('0'),
executionTimeMillisEstimate: Long('19')
},
{
'$_internalSearchIdLookup': { limit: Long('10') },
nReturned: Long('0'),
executionTimeMillisEstimate: Long('19')
}
],
queryShapeHash: '9EFFBE6AC5B8DC66D20DB8939CF3ED6669D0C09BB6938C17AD3FB8C7793765B8',
serverInfo: {
host: '<hostname>.mongodb.net',
port: 27017,
version: '8.0.5',
gitVersion: 'cb9e2e5e552ee39dea1e39d7859336456d0c9820'
},
serverParameters: {
internalQueryFacetBufferSizeBytes: 104857600,
internalQueryFacetMaxOutputDocSizeBytes: 104857600,
internalLookupStageIntermediateDocumentMaxSizeBytes: 104857600,
internalDocumentSourceGroupMaxMemoryBytes: 104857600,
internalQueryMaxBlockingSortMemoryUsageBytes: 104857600,
internalQueryProhibitBlockingMergeOnMongoS: 0,
internalQueryMaxAddToSetBytes: 104857600,
internalDocumentSourceSetWindowFieldsMaxMemoryBytes: 104857600,
internalQueryFrameworkControl: 'trySbeRestricted',
internalQueryPlannerIgnoreIndexWithCollationForRegex: 1
},
command: {
aggregate: 'embedded_movies',
pipeline: [
{
'$vectorSearch': {
index: 'vector_index',
path: 'plot_embedding',
queryVector: [
-0.0016261312, -0.028070757, -0.011342932, -0.012775794,
...
-0.0060913274, -0.007130985, -0.013109017, -0.009710136
],
exact: true,
limit: 10
}
}
],
cursor: {},
'$db': 'sample_mflix'
},
ok: 1,
'$clusterTime': {
clusterTime: Timestamp({ t: 1740781894, i: 1 }),
signature: {
hash: Binary.createFromBase64('cNmipB7AsFGaT4ipmWCKizM/EbU=', 0),
keyId: Long('7446434162581438465')
}
},
operationTime: Timestamp({ t: 1740781894, i: 1 })
}

The following example runs the explain method on an ANN and ENN vector search query for the plot_embedding field with the queryPlanner verbosity mode.

db.embedded_movies.explain("queryPlanner").aggregate([
{
"$vectorSearch": {
"index": "vector_index",
"path": "plot_embedding",
"queryVector": QUERY_EMBEDDING,
"numCandidates": 150,
"limit": 10
}
}
])
{
explainVersion: '1',
stages: [
{
'$vectorSearch': {
index: 'vector_index',
path: 'plot_embedding',
queryVector: [
-0.0016261312, -0.028070757, -0.011342932, -0.012775794,
...
-0.0060913274, -0.007130985, -0.013109017, -0.009710136
],
numCandidates: 150,
limit: 10,
explain: {
query: {
type: 'WrappedKnnQuery',
args: {
query: [
{
type: 'KnnFloatVectorQuery',
args: { field: '$type:knnVector/plot_embedding', k: 150 }
},
{ type: 'DocAndScoreQuery', args: {} }
]
}
},
metadata: {
mongotVersion: '1.44.0',
mongotHostName: '<hostname>.mongodb.net',
indexName: 'vector_index',
totalLuceneDocs: 3483
}
}
}
},
{ '$_internalSearchIdLookup': { limit: Long('10') } }
],
queryShapeHash: '9EFFBE6AC5B8DC66D20DB8939CF3ED6669D0C09BB6938C17AD3FB8C7793765B8',
serverInfo: {
host: '<hostname>.mongodb.net',
port: 27017,
version: '8.0.5',
gitVersion: 'cb9e2e5e552ee39dea1e39d7859336456d0c9820'
},
serverParameters: {
internalQueryFacetBufferSizeBytes: 104857600,
internalQueryFacetMaxOutputDocSizeBytes: 104857600,
internalLookupStageIntermediateDocumentMaxSizeBytes: 104857600,
internalDocumentSourceGroupMaxMemoryBytes: 104857600,
internalQueryMaxBlockingSortMemoryUsageBytes: 104857600,
internalQueryProhibitBlockingMergeOnMongoS: 0,
internalQueryMaxAddToSetBytes: 104857600,
internalDocumentSourceSetWindowFieldsMaxMemoryBytes: 104857600,
internalQueryFrameworkControl: 'trySbeRestricted',
internalQueryPlannerIgnoreIndexWithCollationForRegex: 1
},
command: {
aggregate: 'embedded_movies',
pipeline: [
{
'$vectorSearch': {
index: 'vector_index',
path: 'plot_embedding',
queryVector: [
-0.0016261312, -0.028070757, -0.011342932, -0.012775794,
...
-0.0060913274, -0.007130985, -0.013109017, -0.009710136
],
numCandidates: 150,
limit: 10
}
}
],
cursor: {},
'$db': 'sample_mflix'
},
ok: 1,
'$clusterTime': {
clusterTime: Timestamp({ t: 1740782044, i: 1 }),
signature: {
hash: Binary.createFromBase64('/ZHh6h+2qbJtYdOBHmeZepo1Wsc=', 0),
keyId: Long('7446434162581438465')
}
},
operationTime: Timestamp({ t: 1740782044, i: 1 })
}
db.embedded_movies.explain("queryPlanner").aggregate([
{
"$vectorSearch": {
"index": "vector_index",
"path": "plot_embedding",
"queryVector": QUERY_EMBEDDING,
"exact": true,
"limit": 10
}
}
])
{
explainVersion: '1',
stages: [
{
'$vectorSearch': {
index: 'vector_index',
path: 'plot_embedding',
queryVector: [
-0.0016261312, -0.028070757, -0.011342932, -0.012775794,
...
-0.0060913274, -0.007130985, -0.013109017, -0.009710136
],
exact: true,
limit: 10,
explain: {
query: {
type: 'ExactVectorSearchQuery',
args: {
field: '$type:knnVector/plot_embedding',
similarityFunction: 'dotProduct',
filter: {
type: 'DefaultQuery',
args: { queryType: 'FieldExistsQuery' }
}
}
},
metadata: {
mongotVersion: '1.44.0',
mongotHostName: '<hostname>.mongodb.net',
indexName: 'vector_index',
totalLuceneDocs: 3483
}
}
}
},
{ '$_internalSearchIdLookup': { limit: Long('10') } }
],
queryShapeHash: '9EFFBE6AC5B8DC66D20DB8939CF3ED6669D0C09BB6938C17AD3FB8C7793765B8',
serverInfo: {
host: '<hostname>.mongodb.net',
port: 27017,
version: '8.0.5',
gitVersion: 'cb9e2e5e552ee39dea1e39d7859336456d0c9820'
},
serverParameters: {
internalQueryFacetBufferSizeBytes: 104857600,
internalQueryFacetMaxOutputDocSizeBytes: 104857600,
internalLookupStageIntermediateDocumentMaxSizeBytes: 104857600,
internalDocumentSourceGroupMaxMemoryBytes: 104857600,
internalQueryMaxBlockingSortMemoryUsageBytes: 104857600,
internalQueryProhibitBlockingMergeOnMongoS: 0,
internalQueryMaxAddToSetBytes: 104857600,
internalDocumentSourceSetWindowFieldsMaxMemoryBytes: 104857600,
internalQueryFrameworkControl: 'trySbeRestricted',
internalQueryPlannerIgnoreIndexWithCollationForRegex: 1
},
command: {
aggregate: 'embedded_movies',
pipeline: [
{
'$vectorSearch': {
index: 'vector_index',
path: 'plot_embedding',
queryVector: [
-0.0016261312, -0.028070757, -0.011342932, -0.012775794,
...
-0.0060913274, -0.007130985, -0.013109017, -0.009710136
],
exact: true,
limit: 10
}
}
],
cursor: {},
'$db': 'sample_mflix'
},
ok: 1,
'$clusterTime': {
clusterTime: Timestamp({ t: 1740782103, i: 23 }),
signature: {
hash: Binary.createFromBase64('yn3TtM4cfhu6HXCGzBGPbLmlM4E=', 0),
keyId: Long('7446434162581438465')
}
},
operationTime: Timestamp({ t: 1740782103, i: 23 })
}

The following example runs the explain method on an ANN and ENN vector search query for the plot_embedding field with the executionStats verbosity mode.

db.embedded_movies.explain("executionStats").aggregate([
{
"$vectorSearch": {
"index": "vector_index",
"path": "plot_embedding",
"queryVector": QUERY_EMBEDDING,
"numCandidates": 150,
"limit": 10
}
}
])
{
explainVersion: '1',
stages: [
{
'$vectorSearch': {
index: 'vector_index',
path: 'plot_embedding',
queryVector: [
-0.0016261312, -0.028070757, -0.011342932, -0.012775794,
...
-0.0060913274, -0.007130985, -0.013109017, -0.009710136
],
numCandidates: 150,
limit: 10,
explain: {
query: {
type: 'WrappedKnnQuery',
args: {
query: [
{
type: 'KnnFloatVectorQuery',
args: { field: '$type:knnVector/plot_embedding', k: 150 },
stats: {
context: { millisElapsed: 0 },
match: { millisElapsed: 0 },
score: { millisElapsed: 0 }
}
},
{
type: 'DocAndScoreQuery',
args: {},
stats: {
context: {
millisElapsed: 0.015853,
invocationCounts: {
createWeight: Long('1'),
createScorer: Long('2')
}
},
match: {
millisElapsed: 0.013112,
invocationCounts: { nextDoc: Long('151') }
},
score: {
millisElapsed: 0.033269,
invocationCounts: {
score: Long('150'),
setMinCompetitiveScore: Long('30')
}
}
}
}
]
},
stats: {
context: {
millisElapsed: 3.979414,
invocationCounts: {
vectorExecution: Long('1'),
createWeight: Long('1'),
createScorer: Long('2')
}
},
match: {
millisElapsed: 0.013112,
invocationCounts: { nextDoc: Long('151') }
},
score: {
millisElapsed: 0.033269,
invocationCounts: {
score: Long('150'),
setMinCompetitiveScore: Long('30')
}
}
}
},
collectors: {
allCollectorStats: {
millisElapsed: 0.115101,
invocationCounts: {
collect: Long('150'),
competitiveIterator: Long('1'),
setScorer: Long('1')
}
},
facet: { collectorStats: { millisElapsed: 0 } }
},
metadata: {
mongotVersion: '1.44.0',
mongotHostName: '<hostname>.mongodb.net',
indexName: 'vector_index',
totalLuceneDocs: 3483
},
resourceUsage: {
majorFaults: Long('0'),
minorFaults: Long('0'),
userTimeMs: Long('0'),
systemTimeMs: Long('0'),
maxReportingThreads: 1,
numBatches: 1
}
}
},
nReturned: Long('0'),
executionTimeMillisEstimate: Long('13')
},
{
'$_internalSearchIdLookup': { limit: Long('10') },
nReturned: Long('0'),
executionTimeMillisEstimate: Long('13')
}
],
queryShapeHash: '9EFFBE6AC5B8DC66D20DB8939CF3ED6669D0C09BB6938C17AD3FB8C7793765B8',
serverInfo: {
host: '<hostname>.mongodb.net',
port: 27017,
version: '8.0.5',
gitVersion: 'cb9e2e5e552ee39dea1e39d7859336456d0c9820'
},
serverParameters: {
internalQueryFacetBufferSizeBytes: 104857600,
internalQueryFacetMaxOutputDocSizeBytes: 104857600,
internalLookupStageIntermediateDocumentMaxSizeBytes: 104857600,
internalDocumentSourceGroupMaxMemoryBytes: 104857600,
internalQueryMaxBlockingSortMemoryUsageBytes: 104857600,
internalQueryProhibitBlockingMergeOnMongoS: 0,
internalQueryMaxAddToSetBytes: 104857600,
internalDocumentSourceSetWindowFieldsMaxMemoryBytes: 104857600,
internalQueryFrameworkControl: 'trySbeRestricted',
internalQueryPlannerIgnoreIndexWithCollationForRegex: 1
},
command: {
aggregate: 'embedded_movies',
pipeline: [
{
'$vectorSearch': {
index: 'vector_index',
path: 'plot_embedding',
queryVector: [
-0.0016261312, -0.028070757, -0.011342932, -0.012775794,
...
-0.0060913274, -0.007130985, -0.013109017, -0.009710136
],
numCandidates: 150,
limit: 10
}
}
],
cursor: {},
'$db': 'sample_mflix'
},
ok: 1,
'$clusterTime': {
clusterTime: Timestamp({ t: 1740782136, i: 1 }),
signature: {
hash: Binary.createFromBase64('33LuqO946oIzmslClhuu+Z+PthQ=', 0),
keyId: Long('7446434162581438465')
}
},
operationTime: Timestamp({ t: 1740782136, i: 1 })
}
db.embedded_movies.explain("executionStats").aggregate([
{
"$vectorSearch": {
"index": "vector_index",
"path": "plot_embedding",
"queryVector": QUERY_EMBEDDING,
"exact": true,
"limit": 10
}
}
])
{
explainVersion: '1',
stages: [
{
'$vectorSearch': {
index: 'vector_index',
path: 'plot_embedding',
queryVector: [
-0.0016261312, -0.028070757, -0.011342932, -0.012775794,
...
-0.0060913274, -0.007130985, -0.013109017, -0.009710136
],
exact: true,
limit: 10,
explain: {
query: {
type: 'ExactVectorSearchQuery',
args: {
field: '$type:knnVector/plot_embedding',
similarityFunction: 'dotProduct',
filter: {
type: 'DefaultQuery',
args: { queryType: 'FieldExistsQuery' },
stats: {
context: {
millisElapsed: 0.029472,
invocationCounts: {
createWeight: Long('1'),
createScorer: Long('2')
}
},
match: {
millisElapsed: 0.234054,
invocationCounts: { nextDoc: Long('3403') }
},
score: { millisElapsed: 0 }
}
}
},
stats: {
context: {
millisElapsed: 0.050328,
invocationCounts: { createWeight: Long('1'), createScorer: Long('2') }
},
match: {
millisElapsed: 0.622028,
invocationCounts: { nextDoc: Long('3403') }
},
score: {
millisElapsed: 3.03997,
invocationCounts: {
score: Long('3402'),
setMinCompetitiveScore: Long('71')
}
}
}
},
collectors: {
allCollectorStats: {
millisElapsed: 3.601357,
invocationCounts: {
collect: Long('3402'),
competitiveIterator: Long('1'),
setScorer: Long('1')
}
},
facet: { collectorStats: { millisElapsed: 0 } }
},
metadata: {
mongotVersion: '1.44.0',
mongotHostName: '<hostname>.mongodb.net',
indexName: 'vector_index',
totalLuceneDocs: 3483
},
resourceUsage: {
majorFaults: Long('0'),
minorFaults: Long('0'),
userTimeMs: Long('0'),
systemTimeMs: Long('0'),
maxReportingThreads: 1,
numBatches: 1
}
}
},
nReturned: Long('0'),
executionTimeMillisEstimate: Long('12')
},
{
'$_internalSearchIdLookup': { limit: Long('10') },
nReturned: Long('0'),
executionTimeMillisEstimate: Long('12')
}
],
queryShapeHash: '9EFFBE6AC5B8DC66D20DB8939CF3ED6669D0C09BB6938C17AD3FB8C7793765B8',
serverInfo: {
host: '<hostname>.mongodb.net',
port: 27017,
version: '8.0.5',
gitVersion: 'cb9e2e5e552ee39dea1e39d7859336456d0c9820'
},
serverParameters: {
internalQueryFacetBufferSizeBytes: 104857600,
internalQueryFacetMaxOutputDocSizeBytes: 104857600,
internalLookupStageIntermediateDocumentMaxSizeBytes: 104857600,
internalDocumentSourceGroupMaxMemoryBytes: 104857600,
internalQueryMaxBlockingSortMemoryUsageBytes: 104857600,
internalQueryProhibitBlockingMergeOnMongoS: 0,
internalQueryMaxAddToSetBytes: 104857600,
internalDocumentSourceSetWindowFieldsMaxMemoryBytes: 104857600,
internalQueryFrameworkControl: 'trySbeRestricted',
internalQueryPlannerIgnoreIndexWithCollationForRegex: 1
},
command: {
aggregate: 'embedded_movies',
pipeline: [
{
'$vectorSearch': {
index: 'vector_index',
path: 'plot_embedding',
queryVector: [
-0.0016261312, -0.028070757, -0.011342932, -0.012775794,
...
-0.0060913274, -0.007130985, -0.013109017, -0.009710136
],
exact: true,
limit: 10
}
}
],
cursor: {},
'$db': 'sample_mflix'
},
ok: 1,
'$clusterTime': {
clusterTime: Timestamp({ t: 1740782184, i: 1 }),
signature: {
hash: Binary.createFromBase64('tpxoW70Y+Z5HmDqaswag+matLQQ=', 0),
keyId: Long('7446434162581438465')
}
},
operationTime: Timestamp({ t: 1740782184, i: 1 })
}