You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+19-1Lines changed: 19 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1243,7 +1243,25 @@ db.accounts.dropIndexes()
1243
1243
<b><a href="#">↥ back to top</a></b>
1244
1244
</div>
1245
1245
1246
-
#### Q. ***What happens if an index does not fit into RAM?***
1246
+
## Q. ***What happens if an index does not fit into RAM?***
1247
+
1248
+
If the indexes does not fit into RAM, MongoDB reads data from disk which is relatively very much slower than reading from RAM.
1249
+
1250
+
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.
1251
+
1252
+
**Example**: To check the size of indexes
1253
+
1254
+
```js
1255
+
>db.collection.totalIndexSize()
1256
+
1257
+
// Output (in bytes)
1258
+
4294976499
1259
+
```
1260
+
1261
+
<div align="right">
1262
+
<b><a href="#">↥ back to top</a></b>
1263
+
</div>
1264
+
1247
1265
#### Q. ***Does MongoDB provide a facility to do text searches?***
1248
1266
#### Q. ***Where can I run MongoDB?***
1249
1267
#### Q. ***How to remove a field completely from a MongoDB document?***
0 commit comments