---
metadata:
  - name: generator
    content: Diplodoc Platform v5.70.2
alternate:
  - https://ydb.tech/docs/en/yql/reference/syntax/alter_table/statistics.md
  - https://ydb.tech/docs/ru/yql/reference/syntax/alter_table/statistics.md
  - href: https://ydb.tech/docs/en/yql/reference/syntax/alter_table/statistics.md
    type: text/markdown
    title: Markdown version
  - href: https://ydb.tech/docs/en/llms.txt?revision=d94cda5622eadbc2010c4ce972644123d8f317b6&version=v26.3
    rel: describedby
sourcePath: en/core/yql/reference/syntax/alter_table/statistics.md
---
> **Documentation Index:** Fetch the complete configuration index at https://ydb.tech/docs/en/llms.txt?revision=d94cda5622eadbc2010c4ce972644123d8f317b6&version=v26.3

# STATISTICS

`ADD STATISTICS` defines multi-column statistics for an existing table. Run [ANALYZE](https://ydb.tech/docs/en/yql/reference/syntax/analyze.md) to collect them.

`DROP STATISTICS` removes the multi-column statistics with the specified name.

Statistics types and column requirements are described in [CREATE TABLE ... STATISTICS](https://ydb.tech/docs/en/yql/reference/syntax/create_table/statistics.md). An `ALTER TABLE` statement can include several of these actions along with other table changes.

## Examples

Add two multi-column sketches and run `ANALYZE`:

```yql
ALTER TABLE orders
    ADD STATISTICS amount_category ON (amount, category) WITH (COUNT_MIN_SKETCH),
    ADD STATISTICS amount_time ON (amount, created_at) WITH (COUNT_MIN_SKETCH);

ANALYZE orders;
```

Remove the multi-column statistics named `amount_category`:

```yql
ALTER TABLE orders DROP STATISTICS amount_category;
```
