MongoDB Documentation, Release 3.0.4 If the query does not specify an equality condition on an index prefix that precedes or overlaps with the sort specifi- cation, the operation will not efficiently use the index. For example, the following operations specify a sort document of { c: 1 } , but the query documents do not contain equality matches on the preceding index fields a and b : db.data.find( { a: { $gt: 2 } } ).sort( { c: 1 } ) db.data.find( { c: 5 } ).sort( { c: 1 } ) These operations will not efficiently use the index { a: 1, b: 1, c: 1, d: 1 } and may not even use the index to retrieve the documents. For the fastest processing, ensure that your indexes fit entirely in RAM so that the system can avoid reading the index from disk. To check the size of your indexes, use the db.collection.totalIndexSize() helper, which returns data in bytes: Ensure Indexes Fit in RAM See also: Indexes that Hold Only Recent Values in RAM Create Queries that Ensure Selectivity Example Chapter 8. Indexes 550 Suppose you have a field called status where the possible values are new and processed . If you add an index on status you’ve created a low-selectivity index. The index will be of little help in locating records. A better strategy, depending on your queries, would be to create a compound index (page 489) that includes the low- selectivity field and another field. For example, you could create a compound index on status and created_at. To ensure selectivity, write queries that limit the number of possible documents with the indexed field. Write queries that are appropriately selective relative to your indexed data. Selectivity is the ability of a query to narrow results using the index. Effective indexes are more selective and allow MongoDB to use the index for a larger portion of the work associated with fulfilling the query. Indexes do not have to fit entirely into RAM in all cases. If the value of the indexed field increments with every insert, and most queries select recently added documents; then MongoDB only needs to keep the parts of the index that hold the most recent or “right-most” values in RAM. This allows for efficient index use for read and write operations and minimize the amount of RAM required to support the index. collStats and db.collection.stats() There are some limited cases where indexes do not need to fit in memory. See Indexes that Hold Only Recent Values in RAM (page 550). If you have and use multiple collections, you must consider the size of all indexes on all collections. The indexes and the working set must be able to fit in memory at the same time. The above example shows an index size of almost 4.3 gigabytes. To ensure this index fits in RAM, you must not only have more than that much RAM available but also must have RAM available for the rest of the working set . Also remember: > db.collection.totalIndexSize() 4294976499