Skip to content
ClickHouse Docs
ClickHouse DocsClickHouse Docs

enable_optimize_predicate_expression_* session settings

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

enable_optimize_predicate_expression

Type
Bool
Default
1
Version history
VersionDefault valueComment
18.12.171Optimize predicates to subqueries by default

Turns on predicate pushdown in SELECT queries.

Predicate pushdown may significantly reduce network traffic for distributed queries.

Possible values:

  • 0 — Disabled.
  • 1 — Enabled.

Usage

Consider the following queries:

  1. SELECT count() FROM test_table WHERE date = '2018-10-10'
  2. SELECT count() FROM (SELECT * FROM test_table) WHERE date = '2018-10-10'

If enable_optimize_predicate_expression = 1, then the execution time of these queries is equal because ClickHouse applies WHERE to the subquery when processing it.

If enable_optimize_predicate_expression = 0, then the execution time of the second query is much longer because the WHERE clause applies to all the data after the subquery finishes.

enable_optimize_predicate_expression_to_final_subquery

Type
Bool
Default
1

Allow push predicate to final subquery.

Navigation