---
title: "Return statistics on recent queries"
method: GET
path: "/project/{project}/service/{service_name}/clickhouse/query/stats"
tags: ["Service:_ClickHouse"]
---

# Return statistics on recent queries

`GET /project/{project}/service/{service_name}/clickhouse/query/stats`

## Path parameters

- `project` string, required
- `service_name` string, required

## Query parameters

- `limit` integer
- `offset` integer
- `order_by` 'calls:asc' | 'calls:desc' | 'min_time:asc' | 'min_time:desc' | 'max_time:asc' | 'max_time:desc' | 'mean_time:asc' | 'mean_time:desc' | 'p95_time:asc' | 'p95_time:desc' | 'stddev_time:asc' | 'stddev_time:desc' | 'total_time:asc' | 'total_time:desc'

## Response `200`

Response

- ServiceClickHouseQueryStatsResponse — ServiceClickHouseQueryStatsResponse
  - `errors` object[] — List of errors occurred during request processing
    - `message` string, required — Printable error message
    - `more_info` string — URL to the documentation of the error
    - `status` integer, required — HTTP error status code
  - `message` string — Printable result of the request
  - `queries` object[], required — List of query statistics
    - `calls` integer — Number of calls
    - `database` string — Database
    - `max_time` integer — Maximum query duration in milliseconds
    - `mean_time` integer — Average query duration in milliseconds
    - `min_time` integer — Minimum query duration in milliseconds
    - `p95_time` integer — Query duration 95th percentile in milliseconds
    - `query` string — Normalized query
    - `rows` number — Average number of rows per call
    - `stddev_time` integer — Query duration standard deviation in milliseconds
    - `total_time` integer — Total duration of all calls in milliseconds

---

[API](https://skmtc.dev/aiven/apis/aiven-api-documentation.md) · [All operations](https://skmtc.dev/aiven/apis/aiven-api-documentation/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/aiven/aiven-api-documentation/revisions/722c06d35bb1/schema)
