Indexing Limitations in MongoDB


This limitation regards to MongoDB version 2.6 and above.

1- As we know,  that the indexes are stored in RAM, we should make sure that the index size does not exceed the RAM limit. If index size increases than RAM will start deleting some indexes and hence causing performance loss.

2- Total size of an index entry must be less than 1024 bytes but remember it can include overhead depending on the BSON type.

3- If index entry of existing document exceeds to index key limit, MongoDB will deny creating an index on a collection. In the previous version, MongoDB would not deny creating but will not index the document.

4- Re-indexing operation will give an error if the index entry field exceeds the index key limit.

5- Update to the indexed field will give an error if entry would exceed the index key limit.

6- A collection can't have more than 64 indexes.

7- The name length can't be more than 128 characters.

8- A compound index can have a maximum 31 fields indexed.


9- If you want to create a 2dsphere index on a field than the field must hold geometry data in the form of coordinate pairs or GeoJSON data. If you try to insert a document with non-geometry data in a 2dsphere indexed field, or build a 2dsphere index on a collection where the indexed field has non-geometry data, the operation will fail.

No comments:

Post a Comment

Please do not enter any spam link in the comment box.

Related Posts

What is the Use of isNaN Function in JavaScript? A Comprehensive Explanation for Effective Input Validation

In the world of JavaScript, input validation is a critical aspect of ensuring that user-provided data is processed correctly. One indispensa...