- MongoDB - PHP
- MongoDB - Java
- MongoDB - Deployment
- MongoDB - Create Backup
- MongoDB - Sharding
- MongoDB - Replication
- MongoDB - Aggregation
- MongoDB - Indexing
- MongoDB - Sorting Records
- MongoDB - Limiting Records
- MongoDB - Projection
- MongoDB - Delete Document
- MongoDB - Update Document
- MongoDB - Query Document
- MongoDB - Insert Document
- MongoDB - Data Types
- MongoDB - Drop Collection
- MongoDB - Create Collection
- MongoDB - Drop Database
- MongoDB - Create Database
- MongoDB - Data Modeling
- MongoDB - Environment
- MongoDB - Advantages
- MongoDB - Overview
- MongoDB - Home
Advanced MongoDB
- Auto-Increment Sequence
- MongoDB - Capped Collections
- MongoDB - GridFS
- Working with Rockmongo
- MongoDB - Regular Expression
- MongoDB - Text Search
- MongoDB - Map Reduce
- MongoDB - ObjectId
- MongoDB - Indexing Limitations
- MongoDB - Advanced Indexing
- MongoDB - Atomic Operations
- MongoDB - Analyzing Queries
- MongoDB - Covered Queries
- MongoDB - Database References
- MongoDB - Relationships
MongoDB Useful Resources
- MongoDB - Discussion
- MongoDB - Useful Resources
- MongoDB - Quick Guide
- MongoDB - Questions and Answers
Selected Reading
- Who is Who
- Computer Glossary
- HR Interview Questions
- Effective Resume Writing
- Questions and Answers
- UPSC IAS Exams Notes
MongoDB - Indexing Limitations
In this chapter, we will learn about Indexing Limitations and its other components.
Extra Overhead
Every index occupies some space as well as causes an overhead on each insert, update and delete. So if you rarely use your collection for read operations, it makes sense not to use indexes.
RAM Usage
Since indexes are stored in RAM, you should make sure that the total size of the index does not exceed the RAM pmit. If the total size increases the RAM size, it will start deleting some indexes, causing performance loss.
Query Limitations
Indexing can t be used in queries which use −
Regular expressions or negation operators pke $nin, $not, etc.
Arithmetic operators pke $mod, etc.
$where clause
Hence, it is always advisable to check the index usage for your queries.
Index Key Limits
Starting from version 2.6, MongoDB will not create an index if the value of existing index field exceeds the index key pmit.
Inserting Documents Exceeding Index Key Limit
MongoDB will not insert any document into an indexed collection if the indexed field value of this document exceeds the index key pmit. Same is the case with mongorestore and mongoimport utipties.
Maximum Ranges
A collection cannot have more than 64 indexes.
The length of the index name cannot be longer than 125 characters.
A compound index can have maximum 31 fields indexed.