clickhouse_query_statistics
Creates, updates, deletes, gets or lists a clickhouse_query_statistics resource.
Overview​
| Name | clickhouse_query_statistics |
| Type | Resource |
| Id | ovh.public_cloud_analytics.clickhouse_query_statistics |
Fields​
The following fields are returned by SELECT queries:
- list
Statistics for a single query pattern on a managed database service
| Name | Datatype | Description |
|---|---|---|
database_name | string | Name of the database (wire: databaseName) |
calls | integer | Number of times this query pattern has been executed |
digest | string | Digest hash of the normalized query |
first_seen | string (date-time) | Timestamp of the first execution (wire: firstSeen) |
last_seen | string (date-time) | Timestamp of the most recent execution (wire: lastSeen) |
max_time | number | Maximum execution time in milliseconds (wire: maxTime) |
mean_time | number | Mean execution time in milliseconds (wire: meanTime) |
min_time | number | Minimum execution time in milliseconds (wire: minTime) |
query | string | Representative SQL text of the query pattern |
rows | integer | Total number of rows retrieved or affected |
total_time | number | Total cumulative execution time in milliseconds (wire: totalTime) |
username | string | Name of the user who executed the query |
Methods​
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
list | select | service_id, project_id | x_pagination_cursor, x_pagination_size, limit, offset | Returns execution statistics for each query pattern: number of calls, rows and execution times. (Beta version) |
Parameters​
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
api_host | string | The OVHcloud API host. Selected by OVH_ENDPOINT (ovh-eu, ovh-ca or ovh-us; default ovh-eu). (default: api.eu.ovhcloud.com, x-stackQL-envVarSelector: {"envVar":"OVH_ENDPOINT","default":"ovh-eu","values":{"ovh-eu":"api.eu.ovhcloud.com","ovh-ca":"api.ca.ovhcloud.com","ovh-us":"api.us.ovhcloud.com"}}) |
project_id | string | The Public Cloud project ID. Resolved from OVH_CLOUD_PROJECT_SERVICE when set. |
service_id | string (uuid) | Service ID (wire: serviceId) |
limit | integer | Maximum number of entries to return |
offset | integer | Number of entries to skip before returning results |
x_pagination_cursor | string | Pagination cursor (wire: X-Pagination-Cursor) |
x_pagination_size | integer | Pagination size (wire: X-Pagination-Size) |
SELECT examples​
- list
Returns execution statistics for each query pattern: number of calls, rows and execution times. (Beta version)
SELECT
database_name,
calls,
digest,
first_seen,
last_seen,
max_time,
mean_time,
min_time,
query,
rows,
total_time,
username
FROM ovh.public_cloud_analytics.clickhouse_query_statistics
WHERE service_id = '{{ service_id }}' -- required
AND project_id = '{{ project_id }}' -- required unless OVH_CLOUD_PROJECT_SERVICE is set
AND x_pagination_cursor = '{{ x_pagination_cursor }}'
AND x_pagination_size = '{{ x_pagination_size }}'
AND limit = '{{ limit }}'
AND offset = '{{ offset }}'
;