---
metadata:
  - name: generator
    content: Diplodoc Platform v5.70.2
alternate:
  - https://ydb-platform--ydb.viewer.diplodoc.com/en/reference/configuration/statistics_config.md
  - https://ydb-platform--ydb.viewer.diplodoc.com/ru/reference/configuration/statistics_config.md
  - href: https://ydb-platform--ydb.viewer.diplodoc.com/en/reference/configuration/statistics_config.md
    type: text/markdown
    title: Markdown version
  - href: https://ydb-platform--ydb.viewer.diplodoc.com/en/llms.txt?revision=0c1fe3abe22e79dcae73d3d42a31f00f0b4234f3&version=v26.3
    rel: describedby
sourcePath: en/core/reference/configuration/statistics_config.md
---
> **Documentation Index:** Fetch the complete configuration index at https://ydb-platform--ydb.viewer.diplodoc.com/en/llms.txt?revision=0c1fe3abe22e79dcae73d3d42a31f00f0b4234f3&version=v26.3

# statistics_config

The `statistics_config` section controls how column statistics are collected for the [cost-based optimizer](https://ydb-platform--ydb.viewer.diplodoc.com/en/concepts/query_execution/optimizer.md#statistics).

## Configuration parameters

| Parameter | Type | Default | Description |
|:----------|:-----|:--------|:------------|
| `enable_background_column_stats_collection` | bool | `false` | Background statistics collection is enabled |

## Background collection {#enable-background-column-stats-collection}

`enable_background_column_stats_collection: true` enables automatic `ANALYZE` runs for user column tables. Background collection is disabled by default.

The next collection is scheduled 24 hours after the start of the previous `ANALYZE`. This interval is fixed and cannot be configured. If another table is being processed, collection waits for it to finish.

## Configuration example

Enable background statistics collection:

```yaml
statistics_config:
  enable_background_column_stats_collection: true
```

## See also

- [Statistics for the Cost-Based Optimizer](https://ydb-platform--ydb.viewer.diplodoc.com/en/concepts/query_execution/optimizer.md#statistics)
- [ANALYZE](https://ydb-platform--ydb.viewer.diplodoc.com/en/yql/reference/syntax/analyze.md)
- [CREATE TABLE ... STATISTICS](https://ydb-platform--ydb.viewer.diplodoc.com/en/yql/reference/syntax/create_table/statistics.md)
- [ALTER TABLE ... STATISTICS](https://ydb-platform--ydb.viewer.diplodoc.com/en/yql/reference/syntax/alter_table/statistics.md)
