As a PT user, I need to have information about unused and redundant indexes in the MongoDB server I'm analyzing with pt-mongodb-summary so that I'm aware of such indexes and can do future optimizations
- by running pt-mongodb-summary against MongoDB server user provided an additional information
Out of scope:
- an additional flag for the data
1. Connect to the MongoDB primary in your cluster
2. Create a database, a collection and insert some documents
3. Check there are documents (optional)
4. Create some indexes
5. Run a query to make use of one of the created indexes
Run the program to get a list of unused and duplicated indexes
In the example I am using the check-all command but you can use check-unused or check-duplicates commands.
Notice that the index idx_01 doesn't appear on the unused index list because we ran a query to make use of it.
See an attached scripts