Postgres

List Postgres slow query patterns

Changed on

Returns aggregate metrics for the slowest query patterns observed on a Postgres service during the given time window. Use this to discover which queries dominate total execution time, CPU, I/O, or WAL generation.

get/v1/organizations/{organizationId}/postgres/{postgresId}/slowQueryPatterns

Request

  • Base URL
    https://api.clickhouse.cloud
  • Auth
    HTTP basic

Path parameters

organizationId, string uuid required

ID of the organization that owns the Postgres service.

postgresId, string uuid required
Example:f71df78e-ddad-82d0-8dfa-abbec741b82e

ID of the requested Postgres service.

Query parameters

from_date, string date-time required
Example:2026-03-26T00:00:00Z

Inclusive start of the time window (RFC 3339 date-time).

to_date, string date-time required
Example:2026-03-27T00:00:00Z

Exclusive end of the time window (RFC 3339 date-time).

db_name, string

Database name filter.

db_user, string

Database user filter.

db_operation, string

Database operation filter (for example, SELECT, INSERT, UPDATE, DELETE, UTILITY).

app, string

Application name filter.

sort_by, 'total_duration' | 'avg_duration' | 'call_count' | 'total_blks_read' | 'total_cpu_time' | 'error_count' | 'max_duration' | 'p50_duration' | 'p95_duration' | 'p99_duration' | 'total_rows' | 'total_shared_blks_hit' | 'total_wal_bytes'

Field to sort results by.

sort_order, 'asc' | 'desc'

Sort order. One of asc or desc.

limit, integer

Maximum number of results to return.

offset, integer

Number of results to skip before returning.

Response

Successful response

object required
status, number

HTTP status code.

requestId, string uuid

Unique id assigned to every request. UUIDv4

result, PostgresSlowQueryPattern[]

List of results.

Example response

{
  "status": 200
}

Changes

    • breaking

      the result/items/avgDurationUs response's property type changed from integer to number for status

    • breaking

      the result/items/p50DurationUs response's property type changed from integer to number for status

    • breaking

      the result/items/p95DurationUs response's property type changed from integer to number for status

    1 more change in this revision