mongodb/mongodb-query-optimizer
Analyze and optimize query performance using Atlas Performance Advisor
Description
mongodb-query-optimizer is an agent skill that diagnoses slow MongoDB queries and recommends indexes. It works from the explain plan, the indexes that already exist on the collection and the output of the Atlas Performance Advisor. For compound indexes it follows the ESR rule, which orders fields by equality, then sort, then range, and it prefers making an index cover the query over rewriting the query. The skill pulls real explain() statistics and Performance Advisor data from your cluster instead of guessing from the shape of the query, so its suggestions match the actual selectivity and workload. Typical tasks include finding out why a find() with a sort is running an in-memory SORT stage, choosing the field order for a compound index on a filter and sort, reviewing the slow query logs from the Performance Advisor for the last 24 hours, deciding which redundant indexes to drop on a collection close to the 20-index limit, and fixing a query that scans too many documents. Install it with the command shown on this page, then ask your coding assistant to explain a slow query.…
Highlights
- Explain plan analysis
- ESR rule for compound indexes
- Atlas Performance Advisor review
- Finds redundant indexes
- Prefers covered queries
Ratings & Reviews
No ratings yet
Be the first to rate mongodb/mongodb-query-optimizer.
People also visit
mongodb/mongodb-query-optimizer FAQ
What does this skill do?
It diagnoses slow MongoDB queries and recommends indexes, using explain plans, existing indexes and Atlas Performance Advisor output.
How do I install it?
Run npx skills add https://github.com/mongodb/agent-skills --skill mongodb-query-optimizer, or paste the skill link into your coding assistant and ask it to install the skill.
What is the ESR rule?
The skill uses it to order compound index fields: equality first, then sort, then range.
Does it need my cluster data?
The page says it pulls explain() stats and Performance Advisor data from your cluster to base its suggestions on real workload.
What are the best mongodb/mongodb-query-optimizer alternatives?
Popular alternatives to mongodb/mongodb-query-optimizer include mongodb-query-optimizer, mongodb-skills and database-optimizer. See all mongodb/mongodb-query-optimizer alternatives












