Home > Software design >  I have a question about cleaning up unused indexes in mongodb
I have a question about cleaning up unused indexes in mongodb

Time:11-26

enter image description here

Please refer to the attached image

I am trying to delete an index that is not being used, but if useage is 0, is it an unnecessary index?

What does it mean when the useage is 0 and the size is 5.3GB?

CodePudding user response:

Indexes are special data structures that store a small portion of the collection's data set in an easy to traverse form. This forms the size of the index.

If usage is 0, that means it has not been used since the time specified. Statistics for an index are reset on mongod restart or index drop/modification/recreation.

More details here.

So, in your case the index exists and occupies certain space, but there have been no queries run, which have made use of that index.

  • Related