Analytics
Analytics - Namespaces

Get Index Recommendations

Get comprehensive MongoDB index recommendations.

Analyzes query patterns and generates prioritized index recommendations with ready-to-use MongoDB commands.

Use Cases:

  • Get actionable index suggestions
  • Prioritize database optimization
  • Copy/paste index creation commands
  • Track optimization opportunities

Recommendation Levels:

  • HIGH PRIORITY: >100 queries, >300ms avg OR >10 very slow queries
  • MEDIUM PRIORITY: >50 queries, >200ms avg OR >20 slow queries
  • LOW PRIORITY: >10 queries but acceptable performance
  • NO ACTION: Low usage, no optimization needed

Response Includes:

  • Prioritized recommendations
  • Usage and latency statistics
  • MongoDB index creation commands
  • Summary by priority level

Example:

curl -X GET "https://api.mixpeek.com/v1/analytics/namespaces/indexes/recommendations" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "X-Namespace: your-namespace"
get/v1/analytics/namespaces/indexes/recommendations

Query parameters

daysinteger

Days of history to analyze

Days of history to analyze

min_usage_countinteger

Minimum queries to consider

Minimum queries to consider

limitinteger

Maximum recommendations to return

Maximum recommendations to return

Response

Successful Response

namespace_idstring required

Namespace ID analyzed

time_range_daysinteger required

Number of days analyzed

summaryobject required

Summary statistics (high_priority, medium_priority, low_priority counts)

Changes

Changed in 3 of the 31 revisions of this API.3

    • added the optional property coverage to the response with the 200 status

      response-optional-property-added

    • added the optional property recommendations/items/index_kind to the response with the 200 status

      response-optional-property-added

    • the endpoint scheme security BearerAuth AND NamespaceHeader was added to the API

      api-security-added

    This revision also has 3 changes that name no endpoint, such as unreferenced schemas being removed. See the revision's changelog