Skip to content
ClickHouse Docs
ClickHouse DocsClickHouse Docs

force_* session settings

These settings are available in system.settings and are autogenerated from source.

force_aggregate_partitions_independently

Type
Bool
Default
0

Force the use of optimization when it is applicable, but heuristics decided not to use it

force_aggregation_in_order

Type
Bool
Default
0

The setting is used by the server itself to support distributed queries. Do not change it manually, because it will break normal operations. (Forces use of aggregation in order on remote nodes during distributed aggregation).

force_creating_set_partitions_independently

Type
Bool
Default
0
Version history
VersionDefault valueComment
26.80New setting to force per-partition pre-deduplication for `IN (subquery)` set building even when the partition-skew check would skip it.

Force per-partition pre-deduplication for IN (subquery) set building when it is applicable, but the partition-skew check (largest partition more than twice the average) decided not to use it. Only bypasses the skew check of allow_creating_set_partitions_independently; the remaining conditions still apply.

force_data_skipping_indices

Disables query execution if passed data skipping indices wasn’t used.

Consider the following example:

CREATE TABLE data
(
    key Int,
    d1 Int,
    d1_null Nullable(Int),
    INDEX d1_idx d1 TYPE minmax GRANULARITY 1,
    INDEX d1_null_idx assumeNotNull(d1_null) TYPE minmax GRANULARITY 1
)
Engine=MergeTree()
ORDER BY key;

SELECT * FROM data_01515;
SELECT * FROM data_01515 SETTINGS force_data_skipping_indices=''; -- query will produce CANNOT_PARSE_TEXT error.
SELECT * FROM data_01515 SETTINGS force_data_skipping_indices='d1_idx'; -- query will produce INDEX_NOT_USED error.
SELECT * FROM data_01515 WHERE d1 = 0 SETTINGS force_data_skipping_indices='d1_idx'; -- Ok.
SELECT * FROM data_01515 WHERE d1 = 0 SETTINGS force_data_skipping_indices='`d1_idx`'; -- Ok (example of full featured parser).
SELECT * FROM data_01515 WHERE d1 = 0 SETTINGS force_data_skipping_indices='`d1_idx`, d1_null_idx'; -- query will produce INDEX_NOT_USED error, since d1_null_idx is not used.
SELECT * FROM data_01515 WHERE d1 = 0 AND assumeNotNull(d1_null) = 0 SETTINGS force_data_skipping_indices='`d1_idx`, d1_null_idx'; -- Ok.

force_distinct_partitions_independently

Type
Bool
Default
0
Version history
VersionDefault valueComment
26.80New setting to force independent per-partition evaluation of `DISTINCT` even when the cost heuristic would skip it.

Force independent DISTINCT evaluation per partition when it is applicable, but the cost heuristic decided not to use it. Only bypasses the cost heuristic of allow_distinct_partitions_independently; the remaining conditions still apply.

force_grouping_standard_compatibility

Type
Bool
Default
1
Version history
VersionDefault valueComment
22.91Make GROUPING function output the same as in SQL standard and other DBMS

Make GROUPING function to return 1 when argument is not used as an aggregation key

force_index_by_date

Type
Bool
Default
0

Disables query execution if the index can’t be used by date.

Works with tables in the MergeTree family.

If force_index_by_date=1, ClickHouse checks whether the query has a date key condition that can be used for restricting data ranges. If there is no suitable condition, it throws an exception. However, it does not check whether the condition reduces the amount of data to read. For example, the condition Date != ' 2000-01-01 ' is acceptable even when it matches all the data in the table (i.e., running the query requires a full scan). For more information about ranges of data in MergeTree tables, see MergeTree.

force_primary_key

Type
Bool
Default
0

Disables query execution if indexing by the primary key is not possible.

Works with tables in the MergeTree family.

If force_primary_key=1, ClickHouse checks to see if the query has a primary key condition that can be used for restricting data ranges. If there is no suitable condition, it throws an exception. However, it does not check whether the condition reduces the amount of data to read. For more information about data ranges in MergeTree tables, see MergeTree.

force_read_through_distributed_cache

ClickHouse Cloud only
Type
BoolAuto
Default
auto
Version history
VersionDefault valueComment
26.9autoNew setting overriding the server setting `enable_read_through_distributed_cache` for a single query.
26.8autoNew setting overriding the server setting `enable_read_through_distributed_cache` for a single query.

Only has an effect in ClickHouse Cloud. Overrides the server setting enable_read_through_distributed_cache for a single query. auto (the default) means to follow the server setting.

force_remove_data_recursively_on_drop

Type
Bool
Default
0

Recursively remove data on DROP query. Avoids ‘Directory not empty’ error, but may silently remove detached data

force_window_partitions_independently

Type
Bool
Default
0
Version history
VersionDefault valueComment
26.80New setting to force independent per-partition evaluation of window functions even when the cost heuristic would skip it.

Force independent evaluation of window functions per partition when it is applicable, but the cost heuristic decided not to use it. Only bypasses the cost heuristic of allow_window_partitions_independently; the remaining conditions still apply.

force_write_through_distributed_cache

ClickHouse Cloud only
Type
BoolAuto
Default
auto
Version history
VersionDefault valueComment
26.9autoNew setting overriding the server setting `enable_write_through_distributed_cache` for a single query.
26.8autoNew setting overriding the server setting `enable_write_through_distributed_cache` for a single query.

Only has an effect in ClickHouse Cloud. Overrides the server setting enable_write_through_distributed_cache for a single query. auto (the default) means to follow the server setting.

Navigation