Editorial question60.8K views1,694 votes0 answers3,340 following
AI-generatedDoes MongoDB prefer index intersection or a compound index for equality predicates on two fields?
Determine under what conditions MongoDB's query planner selects index intersection versus a compound index for queries that contain equality predicates on two different fields. The planner’s choice depends on index selectivity derived from collection statistics, the current state of the plan cache, and memory usage during the intersection merge step; updates