> For the complete MongoDB documentation index, see www.mongodb.com/docs/llms.txt

# Performance Insights

MongoDB Compass Readonly Edition will be deprecated in a future release. To replicate the read-only behavior in a standard Compass edition, assign users [`read`](https://www.mongodb.com/docs/manual/reference/built-in-roles.md#mongodb-authrole-read) access at the database level and enable the [readOnly](https://www.mongodb.com/docs/compass/settings/read-only.md#std-label-compass-read-only) option in Compass.

When MongoDB Compass determines that your schema or queries can be improved, it displays a performance insight. Performance insights show ways to improve your schema and data modeling practices. Use performance insights to learn best schema design practices and improve application performance.

## Use Cases

Performance insights are best followed early in your application development process. Starting your application with good data modeling practices helps prevent schema and performance issues as your application grows.

Although Compass provides performance insights at any stage of development, it can be difficult to make schema modifications in large-scale schemas that are used in production.

Before you modify your schema based on performance insights, ensure that the suggestion makes sense for your application. For example, if Compass suggests creating an index, make sure that index supports queries that are run frequently.

**Note:**

Performance insights direct you to the [Intelligent Assistant in Compass](https://www.mongodb.com/docs/compass/query-with-natural-language/compass-ai-assistant.md#std-label-compass-ai-assistant), which can provide additional help with your schema or queries.

## Behavior

Performance insights are enabled automatically.

Performance insights are generic, and do not use properties specific to your schema such as database or collection names.

Compass shows performance insights in the following scenarios:

| Scenario | Performance insight |
| --- | --- |
| You run a query or aggregation without an index. | Add an index to support the operation. |
| You run an aggregation pipeline that uses a [`$lookup`](https://www.mongodb.com/docs/manual/reference/operator/aggregation/lookup.md#mongodb-pipeline-pipe.-lookup) stage. | Embed related data to avoid the need for a `$lookup` operation. |
| You run a [`$text`](https://www.mongodb.com/docs/manual/reference/operator/query/text.md#mongodb-query-op.-text) or [`$regex`](https://www.mongodb.com/docs/manual/reference/operator/query/regex.md#mongodb-query-op.-regex) query. | If possible, use [Atlas Search](https://www.mongodb.com/docs/atlas/atlas-search/) to improve performance for text search queries. |
| Your database contains too many collections. | Reduce the number of collections. |
| Your documents contain an array field with too many elements. | Avoid unbounded arrays. |
| The data size of individual documents is too large. | Break up large documents into separate collections. |
| Your collection contains too many indexes. | Review your indexes and remove any that are unnecessary. |

## Learn More

- To learn more about data modeling in MongoDB, see [Data Modeling in MongoDB.](https://www.mongodb.com/docs/manual/data-modeling.md#std-label-manual-data-modeling-intro)

- To learn how to create effective indexes for your application, see [Indexing Strategies.](https://www.mongodb.com/docs/manual/applications/indexes/)
