|
After the update, we will have three possible explain output format:
1. the query is purely executed in SBE engine
{
|
explainVersion: '2',
|
queryPlanner: {
|
namespace: 'test.search',
|
indexFilterSet: false,
|
parsedQuery: {},
|
....,
|
winningPlan: {
|
queryPlan: { stage: 'SEARCH', planNodeId: 1 },
|
slotBasedPlan: {
|
slots: '....',
|
stages: '....'
|
},
|
remotePlans: [{
|
id: 1,
|
mongotQuery: { query: 'cakes', path: 'title' },
|
explain: {profession: 'writer'}
|
}]
|
},
|
rejectedPlans: []
|
},
|
command: {
|
....
|
},
|
serverInfo: {
|
....
|
},
|
serverParameters: {
|
....
|
},
|
ok: 1
|
}
|
2. the query is executed in hybrid engines (one or more stages in pipeline is not compatible with SBE)
{
|
explainVersion: '2',
|
stages: [
|
{
|
'$cursor': {
|
queryPlanner: {
|
namespace: 'test.search',
|
indexFilterSet: false,
|
parsedQuery: {},
|
....
|
winningPlan: {
|
queryPlan: { stage: 'SEARCH', planNodeId: 1 },
|
slotBasedPlan: {
|
slots: '....',
|
stages: '....'
|
},
|
remotePlans: [{
|
id: 1,
|
mongotQuery: { query: 'cakes', path: 'title' },
|
explain: {profession: 'writer'}
|
}]
|
},
|
rejectedPlans: []
|
}
|
}
|
},
|
{ '$project': { _id: false } }
|
],
|
serverInfo: {
|
....
|
},
|
serverParameters: {
|
....
|
},
|
command: {
|
....
|
},
|
ok: 1
|
}
|
3. the query is executed in classic engine (SBE is turned off). This is same with current format.
{
|
explainVersion: '1',
|
stages: [
|
{
|
'$_internalSearchMongotRemote': {
|
mongotQuery: { query: 'cakes', path: 'title' },
|
explain: { profession: 'writer' }
|
}
|
},
|
{ '$_internalSearchIdLookup': {} }
|
],
|
serverInfo: {
|
....
|
},
|
serverParameters: {
|
....
|
},
|
command: {
|
....
|
},
|
ok: 1
|
}
|
|
|
Search explain format:
winningPlan: {
|
queryPlan: { stage: 'SEARCH', planNodeId: 1 },
|
slotBasedPlan: {
|
slots: '$$RESULT=s6 env: { s1 = 0 (searchCursorId), s2 = [{"_id" : 6, "score" : 0.123}] (searchFirstBatch), s3 = {"query" : "cakes", "path" : "title", "returnStoredSource" : true} (searchQuery), s4 = Nothing (searchLimit), s5 = Nothing (searchProtocolVersion) }',
|
stages: '[1] search_cursor s6 [s8, s9, s10, s11] [] s1 s2 s4 s7 remotePlanId=1
|
}
|
remotePlans: [{
|
id: 1,
|
explain: {profession: 'writer'}
|
}]
|
}
|
|