Postgres

List Postgres slow query patterns

This endpoint is in beta. API contract is stable, and no breaking changes are expected in the future. <br /><br /> 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
  • URL: https://api.clickhouse.cloud/v1/organizations/{organizationId}/postgres/{postgresId}/slowQueryPatterns
  • Auth: HTTP basic

Path parameters

organizationIdstring uuid required

ID of the organization that owns the Postgres service.

postgresIdstring uuid required

ID of the requested Postgres service.

Query parameters

from_datestring date-time required

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

to_datestring date-time required

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

db_namestring

Database name filter.

db_userstring

Database user filter.

db_operationstring

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

appstring

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.

limitinteger

Maximum number of results to return.

offsetinteger

Number of results to skip before returning.

Response

Successful response

statusnumber

HTTP status code.

requestIdstring uuid

Unique id assigned to every request. UUIDv4

Example response

{
  "status": 200
}

Changes

No recorded changes to this operation across all 1 revision of this API.