> ## Documentation Index
> Fetch the complete documentation index at: https://clickhouse.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# use_statistics_* session settings

> ClickHouse session settings in the use_statistics_* generated group.

These settings are available in [system.settings](https://clickhouse.com/docs/reference/system-tables/settings.md) and are autogenerated from [source](https://github.com/ClickHouse/ClickHouse/blob/master/src/Core/Settings.cpp).

## use\_statistics

Type

Bool

Default

1

/// preferred over 'allow\_statistics\_optimize' because of consistency with 'use\_primary\_key' and 'use\_skip\_indexes'
Allows using statistics to optimize queries

## use\_statistics\_for\_min\_max\_aggregation

Type

Bool

Default

1

Answer `min`, `max` and `count` aggregations from per-part column statistics instead of reading data.

When enabled, a query of the form `SELECT min(column), max(column), count() FROM table` without `GROUP BY` and filters
is answered from column statistics (e.g. MinMax statistics, see the `auto_statistics_types` MergeTree setting)
for the data parts that have them materialized, and only the remaining parts are read.
`count()` is also answered together with the aggregations of `use_statistics_for_sum_avg_aggregation`.

Possible values:

* 0 — Disabled.
* 1 — Enabled.

## use\_statistics\_for\_part\_pruning

Type

Bool

Default

1

Use statistics to filter out parts during query execution.

When enabled, pruning in SELECT queries will use column statistics (e.g. MinMax statistics) to eliminate parts that cannot contain matching data before reading any data.

Possible values:

* 0 — Disabled.
* 1 — Enabled.

## use\_statistics\_for\_sum\_avg\_aggregation

Type

Bool

Default

1

Answer `sum`, `avg` and `sumCount` aggregations over integer and `Decimal` columns that are not `Nullable` or
`LowCardinality`, without `GROUP BY` and filters, from per-part column statistics (the `basic` statistics type, see the
`auto_statistics_types` `MergeTree` setting) for the data parts that have them materialized, and read only the remaining
parts. `count(column)` of a column that is not `Nullable` or `LowCardinality` is answered there from the number of rows.
The result is exactly the same as when reading the data.

Possible values:

* 0 — Disabled.
* 1 — Enabled.
