-
Type:
Bug
-
Resolution: Fixed
-
Priority:
Major - P3
-
Affects Version/s: None
-
Component/s: None
-
None
-
Query Optimization
-
Fully Compatible
-
ALL
-
QO 2025-02-17
-
None
-
None
-
None
-
None
-
None
-
None
-
None
The cost of SKIP appears to be calculated identically to LIMIT, but this is not right.
Enterprise test> db.foo.find().skip(1).explain().queryPlanner;
{
winningPlan: {
isCached: false,
stage: 'SKIP',
costEstimate: 0.6246551, <- cost must be equal to the cost of the input stage?
cardinalityEstimate: 9999,
estimatesMetadata: { ceSource: 'Metadata' },
skipAmount: 1,
inputStage: {
stage: 'COLLSCAN',
costEstimate: 4.2291755,
cardinalityEstimate: 10000,
numDocsEstimate: 10000,
estimatesMetadata: { ceSource: 'Metadata' },
direction: 'forward'
}
},
rejectedPlans: []
}