Posts

Showing posts with the label limitations

MongoDB tip: Index Consideration/Tips/Limitations

MongoDB Index Consideration and Tips Insert, delete, update on a collection will update the indexes per transaction. Index improved read performance for queries that are supported by the index. Index will be slower where there are indexes that MongoDB must also update. The speed of updates may be improved because MongoDB will not need to do a collection scan to find target documents. Index is modified any time when a document: is inserted (applies to all indexes) is deleted (applies to all indexes) is updated in such a way that its indexed field changes Index limitations: 64 indexes per collection Should never create as many indexes anywhere close to the upper bound Write performance will degrade to unusable at somewhere between 20-30 Index options: Sparse - sparse index will skip any document that doesn't contain the field specified - syntax: db.<collection>.createIndex( {field_name : 1}, {sparse : true}) Unique - unique index will prohibit any do...