---
metadata:
  - name: generator
    content: Diplodoc Platform v5.50.6
alternate:
  - https://ydb.tech/docs/en/yql/reference/syntax/analyze.md
sourcePath: en/core/yql/reference/syntax/analyze.md
---
> **Documentation Index:** Fetch the complete configuration index at https://ydb.tech/docs/en/llms.txt

# ANALYZE

`ANALYZE` forces the collection of statistics for [YDB cost-based optimizer](https://ydb.tech/docs/en/concepts/query_execution/optimizer.md).

## Syntax

```yql
ANALYZE <path_to_table> [ (<column_name> [, ...]) ]
```

This command forces the synchronous collection of table statistics and column statistics for the specified columns or for all columns if none are specified. `ANALYZE` returns once all the requested statistics have been collected and are up to date.

* `path_to_table` — the path to the table for which statistics should be collected.
* `column_name` — collect column statistics only for the specified columns of the table.

The current set of statistics is described in [Statistics for the Cost-Based Optimizer](https://ydb.tech/docs/en/concepts/query_execution/optimizer.md#statistics).
