Without an index MongoDB scans every document (COLLSCAN). Indexes are B-trees on one or more fields. Index type Example Single field { email: 1 } (+ { unique: true }) Compound { status: 1, createdAt: -1 } Multikey on an array field — automatic Text { title: "text", body: "text" } TTL { createdAt: 1 }, { expireAfterSeconds: 3600 } — auto-delete Partial { partialFilterExpression: { status: "active" } } Wildcard / 2dsphere / hashed dynamic fields / geo / sharding The ESR rule for compound indexes Order fields as Equality → Sort → Range. For find({ status: "paid", total: { $gt: 100 } }).sort({ createdAt: -1 }) use { status: 1, createdAt: -1, total: 1 }. Reading explain() explain("executionStats") → look for IXSCAN vs COLLSCAN, and compare totalDocsExamined with nReturned — ideally close to…