Then let’s try to explain the same query again. Let’s try to create a single field index on borough, the only condition we have in the find(). Think about what this time could be in the case of a collection with millions of documents! This might seem good, but remember that this is the time needed to scan just 3772 documents, a very small test collection. This was expected because the query uses COLLSCAN The number of documents examined is exactly the number of documents in the collection. The number of documents returned is 1883, the number of restaurants located in Manhattan. We don’t have any indexes in the collection, apart the one on _id, so there aren’t other execution plans. When the query needs to be executed with COLLSCAN the only execution plan is the winning plan.
#Robo 3t query how to#
The query it’s not optimized because all the documents must be read. In this Highlights video, well be using the Customers collection to learn how to query in MongoDB, using Studio 3T- For more information on Studio 3T, pleas. Robo 3T makes you more efficient by giving you the ability to create databases, collections, add users, documents, execute one-time queries with auto-completion, and visualize results from a GUI interface. This provides very important information about the winning plan: it means that MongoDB needs to do a collection scan. Robo 3T is a lightweight, open-source, shell centric, cross-platform graphical user interface tool for managing MongoDB workloads. We won’t describe each one of the values, as some are really intuitive. First of all, we can clearly distinguish the “queryPlanner” and the “executionStats” modes. Here we can see the output of the explain().
#Robo 3t query free#
3T will continue development of Robo 3T in parallel with its own MongoDB GUI and the good news is that it will be making Robo 3T free for all users from now on. Robo 3T (formerly Robomongo) not only analyzes the semantic of the code, but also executes it in an internal JavaScript VM, allowing us to give you a runtime autocompletion that is impossible to obtain statically.
#Robo 3t query software#
You can apply the explain() method to a query or a cursor in the following way, as per any other method: The Robo 3T (formerly Robomongo) tool has been acquired by 3T Software Labs, the creators of the MongoDB client Studio 3T (formerly MongoChef). If you are familiar with the EXPLAIN command in MySQL, the goals of MongoDB’s explain() method are exactly the same.
For example, by creating missing indexes or by rewriting it in order to use existing indexes more correctly. The aim of using explain() is to find out how to improve the query.
In MongoDB: index usage and MongoDB explain() we introduced the main index types supported by MongoDB, and how to create and use them. This is the second part of a two parts series.