What is best way to find whether an index in reside in RAM or Disk in mongodb?
On one hand, it is entirely possible only some parts of the index is in RAM http://docs.mongodb.org/manual/applications/indexes/#indexing-right-handed
Indexes do not have to fit entirely into RAM in all cases. If the value of the indexed field grows 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.
On the other hand, db.serverStatus()
gives you an aggregate of the information you wanted. Check http://docs.mongodb.org/manual/reference/server-status/#server-status-indexcounters:
The
indexCounters.btree.hits
value reflects the number of times that an index has been accessed and mongod is able to return the index from memory.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With