Analytics
Analytics - Namespaces

Get Slow Queries

Get slow queries and their filter patterns.

Identifies queries exceeding a latency threshold and shows which metadata fields they're filtering on, helping pinpoint optimization opportunities.

Use Cases:

  • Troubleshoot slow queries
  • Identify unindexed fields causing slowdowns
  • Debug performance issues
  • Optimize query patterns

Response Includes:

  • Query details (retriever, inputs, latency)
  • Results count
  • Metadata fields being filtered
  • Full query context

Example:

curl -X GET "https://api.mixpeek.com/v1/analytics/namespaces/queries/slow?latency_threshold_ms=1000" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "X-Namespace: your-namespace"
get/v1/analytics/namespaces/queries/slow

Query parameters

daysinteger

Days of history to analyze

Days of history to analyze

latency_threshold_msnumber

Latency threshold in ms

Latency threshold in ms

limitinteger

Maximum queries to return

Maximum queries to return

Response

Successful Response

namespace_idstring required

Namespace ID analyzed

time_range_daysinteger required

Number of days analyzed

latency_threshold_msnumber required

Latency threshold used

total_slow_queriesinteger required

Slow queries in the whole window, NOT the length of slow_queries. Falls back to the returned count when total_is_exact is false.

returned_countinteger required

How many entries slow_queries actually contains

total_is_exactboolean required

False when the total could not be counted (analytics backend unreachable) and total_slow_queries is a floor, not a total.

Changes

Changed in 2 of the 29 revisions of this API.3

    • added the required property returned_count to the response with the 200 status

      response-required-property-added

    • added the required property total_is_exact to the response with the 200 status

      response-required-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