Managed Databases

Get slow queries

Changed on

The slowest recent queries.

  • PostgreSQL: aggregated statistics from pg_stat_statements: each row is one normalized query with its call count, mean, and total time.
  • Valkey: individual slow commands from SLOWLOG: calls is 1 per entry and rows is not applicable.
  • MySQL: statement digests for defaultdb. ClickHouse: the query log. Kafka: none.

On PostgreSQL, turn on the pg_stat_statements extension first; until then collecting is false. limit is 1 to 100 (default 20). The database must be running.

get/api/v1/databases/{database_id}/slow-queries

Request

  • Base URL
    https://api.rafftechnologies.com
  • URL
    https://api.rafftechnologies.com/api/v1/databases/{database_id}/slow-queries
  • Auth
    API key in header X-API-Key

Path parameters

database_idstring required

Database ID (UUID) or short id (the database_id field, e.g. a1b2c3d4)

Query parameters

limitinteger

Maximum number of entries to return

Response

Slow query entries

successboolean
collectingboolean

Whether slow-query statistics are being collected

Changes