[Yandex Cloud documentation](../../index.md) > [Yandex Managed Service for ClickHouse®](../index.md) > [Step-by-step guides](index.md) > Logs and monitoring > Performance diagnostics

# Performance diagnostics in Managed Service for ClickHouse®

{% note info %}

This feature is at the [Preview](../../overview/concepts/launch-stages.md) stage. To get access, contact [support](https://center.yandex.cloud/support) or your account manager.

{% endnote %}

Managed Service for ClickHouse® allows you to collect performance metrics of queries in a cluster. The feature is available in ClickHouse® version 25.3 and higher.

## Enabling statistics collection {#activate-stats-collector}

{% list tabs group=instructions %}

- Management console {#console}

  To enable statistics collection, select **Statistics sampling** when [creating](cluster-create.md#create-cluster) or [updating](update.md) a cluster. This option is disabled by default.


{% endlist %}

## Getting query statistics {#get-queries}

{% list tabs group=instructions %}

- Management console {#console}
  
  1. In the [management console](https://console.yandex.cloud), select the folder the cluster is in.
  1. Navigate to **Managed Service for&nbsp;ClickHouse**.
  1. Click the cluster name and select the ![image](../../_assets/console-icons/heart-pulse.svg) **Performance diagnostics** tab.

      To view query history or statistics, select the relevant tab. The data is displayed for the selected time period.
  
  1. Optionally, add query filters:
      
      1. Select hosts.
      1. Select users.
      1. Select query result: `QueryFinish`, `ExceptionBeforeStart`, or `ExceptionWhileProcessing`.
      1. Select query type.

  1. To view query info, select the query of interest in the **History** tab. This will open the query page.
  
      For queries of 5 seconds and longer, the following charts will be displayed:

      * **Chart CPU**: CPU usage.
      * **Chart memory**: RAM usage.
      * **Chart rows**: Number of rows read and added via the query.
      * **Chart bytes**: Amount of data read and added via the query, in bytes.

{% endlist %}

## Getting query group statistics {#get-query-groups}

{% list tabs group=instructions %}

- Management console {#console}
  
  1. In the [management console](https://console.yandex.cloud), select the folder the cluster is in.
  1. Navigate to **Managed Service for&nbsp;ClickHouse**.
  1. Click the cluster name and select the ![image](../../_assets/console-icons/heart-pulse.svg) **Performance diagnostics** tab.
  1. Navigate to the **Query groups** tab.

      The page displays unique queries for the selected time period.
  
  1. Optionally, add query filters:
      
      1. Select hosts.
      1. Select users.
      1. Select query result: `QueryFinish`, `ExceptionBeforeStart`, or `ExceptionWhileProcessing`.
      1. Select query type.

{% endlist %}