From the course: MongoDB C# Developer Associate Cert Prep

Unlock this course with a free trial

Join today to access over 24,900 courses taught by industry experts.

Deleting MongoDB indexes

Deleting MongoDB indexes

- Hello, in this video, you'll learn about the impact of deleting an index and how to delete an existing index from a collection. We recommend having indexes and collections because they can speed up queries and improve performance, but indexes also have a write cost. Every time we insert new documents or update them, the index keys need to be updated. Too many indexes in a collection can affect the system performance, so we should delete unused or redundant indexes. Before deleting an index, make sure the index is not being used. Deleting an index that is the only index supporting a query will affect the performance of that query. With no suitable index, queries will have to scan every document in the collection to return results. This greatly affects performance. We can delete any of the indexes in a collection except for the default index on _id. Also, recreating an index that was deleted can cost extra time and…

Contents