Index the way the application searches

An index is useful when a frequent query filters, sorts, or joins on the indexed fields. Begin by looking at the queries people actually use, not by indexing every field.

A compound index can support multiple conditions, but its field order affects which queries it can serve efficiently.

Measure before and after

Use MongoDB explain output to see whether a query scans many documents or uses an index. Compare execution statistics on representative data.

An index that looks helpful in development may behave differently when the collection is much larger.

Account for write costs

Every index takes storage and must be updated as documents change. Keep the set focused, remove indexes that no longer serve an important query, and monitor slow operations after release.