As part of testing/continuous integration, I would like to make sure that every query in my application uses an index. I already have a “wrapper” function for virtually every find query so if in testing mode, before executing the query, I’d like to make sure that there is an index that supports the query. How do I run the explain command? Or are there “server stats” that would show me how many queries were run without an index?
My production dataset is such that queries that don’t have indexes don’t return, so it’s not okay to not have an index for a query.