Indexes & explain plans

See what a query does.
Understand the work behind it.

A result tells you what came back. Explain helps you understand how MongoDB found it, with the winning plan, index details, and examined-document counts beside the query.

Winning planExecution statisticsIndex management
Take a closer look
Bison explaining an indexed query with returned documents, examined keys, and examined documents.
A sample query’s explain results, captured in the Bison development app.
01

Read the important numbers.

See documents returned, documents and keys examined, and execution time. Compare the work done with the result you actually needed.

02

Keep the details available.

Inspect the winning plan and the index it uses. The raw explain JSON is available when you need the server’s full response.

03

Manage the index, too.

Inspect index keys, options, sizes, and usage. Create indexes with a form or JSON, and confirm before dropping one.

From first click to useful work

A place for
your next step.

  1. 01

    Start with a real query

    Use the filter or aggregation pipeline whose behavior you want to understand.

  2. 02

    Open Explain

    Check the selected plan and compare keys and documents examined with documents returned.

  3. 03

    Inspect the collection’s indexes

    Review existing keys and options before deciding whether an index change makes sense.

A few practical details

Good to know.
Before you begin.

Can I explain an aggregation pipeline?

Yes. Explain is available for find queries and aggregation pipelines.

Does Bison automatically optimize my database?

No. Explain reports MongoDB’s execution information. You decide which queries or indexes to change.