นอกเหนือจาก single-field index พื้นฐาน MongoDB มีกลยุทธ์ indexing ขั้นสูง — การจัดลำดับ compound index (กฎ ESR), covered query, partial/sparse index, TTL index และอื่น ๆ — ที่ส่งผลอย่างมากต่อประสิทธิภาพ query การเชี่ยวชาญมันคือกุญแจสู่การ optimize MongoDB ที่ scale
กฎ ESR สำหรับ compound index
For a compound index supporting a query with Equality, Sort, and Range conditions,
order the fields: EQUALITY → SORT → RANGE (the ESR rule).
