These settings are available in system.settings and are autogenerated from source.
enable_optimize_predicate_expression
Type
Bool
Default
1
Version history
| Version | Default value | Comment |
|---|---|---|
| 18.12.17 | 1 | Optimize 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:
SELECT count() FROM test_table WHERE date = '2018-10-10'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.