بنیادی single-field indexes سے آگے، MongoDB advanced indexing strategies فراہم کرتا ہے — compound index ordering (ESR rule)، covered queries، partial/sparse indexes، TTL indexes، اور بہت کچھ — جو query performance کو بہت زیادہ متاثر کرتے ہیں۔ ان میں مہارت MongoDB کو scale میں بہتری دینے کی کلید ہے۔
Compound indexes کے لیے ESR rule
For a compound index supporting a query with Equality, Sort, and Range conditions,
order the fields: EQUALITY → SORT → RANGE (the ESR rule).
