Query shapes
A query shape is a set of specifications that group similar queries. Queries that match the specifications have the same query shape. If you frequently run queries that have the same shape, you can take advantage of their shared qualities to optimize performance.
The following terms are also useful for this section:
- Query plan: A query plan is a method for executing a query. A single query can have multiple query plans that all produce the same results.
- Query optimizer/planner: The MongoDB query optimizer, also called the query planner, evaluates query plans and determines which plan to execute. Most often, the query plan that produces the most results during the evaluation plan while performing the least amount of work is the winning plan that MongoDB executes. The query optimizer evaluates queries with the same query shape as equivalent.
Previously, MongoDB used the term query shape to specifically describe queries with shared...