Skip to main content

IXSCAN

Short Description

Scanning index keys

Detailed Description​

IXSCAN stands for Index Scan in MongoDB explain plans.

In simple terms:

  • IXSCAN means MongoDB is using an index (like a table of shortcuts) to quickly find the documents that match your query, rather than scanning every document in the collection.
  • This is much faster and more efficient than a COLLSCAN (collection scan), especially for large collections.

When do you see IXSCAN?

  • Whenever your query or sort can use an existing index on the collection.
  • For example, if you have an index on { year: 1 } and you run a query like { year: 2000 }, MongoDB uses IXSCAN.

In MongoDB Compass:

If you view an explain plan and see an IXSCAN stage, it means your query benefited from an index, which is a sign of good query optimization.

Summary:

IXSCAN = MongoDB is scanning an index to find or sort results efficiently. This is much better for performance compared to a full collection scan.

Search online​

If this article doesn't have the information you need you can try searching online. Remember, you can contribute suggestions to this page.