Learn how to find slow MongoDB queries, create better compound indexes, and manage index recommendations visually in VisuaLeaf.
Not all slow MongoDB queries are bad queries.
Sometimes the query is fine, but MongoDB does not have a good index to help with your filtering, sorting, and retrieving of the data
In this tutorial, we'll use payments as an example of our database. The collection starts without a useful index for our query. We'll identify the slow operation, learn about the recommended index, explain why the compound index works, and manage it visually in VisuaLeaf.
The payments collection includes fields such as currency, status, amount, and paidAt, which we use in the query example.
The workflow is simple:
slow query -> query profiler -> index recommendation -> compound index -> index manager
You can use the same workflow when your own MongoDB collections start to feel slow.
On this page
The Slow Query Problem
... continue reading