Enabling Cost-Based SQL Optimization
Hortonworks recommends that administrators always enable CBO. Set and verify the following
configuration parameters in the hive-site.xml
file to enable
cost-based optimization of SQL queries:
Table 2.2. CBO Configuration Parameters
CBO Configuration Parameter | Description | Default Value |
---|---|---|
| Enables cost-based query optimization. | False |
| Enables automated gathering of table-level statistics for newly created tables and table partitions, such as tables created with the INSERT OVERWRITE statement. The parameter does not produce column-level statistics, such as those generated by CBO. If disabled, administrators must manually generate these table-level statistics with the ANALYZE TABLE statement. | True |
The following configuration properties are not specific to CBO, but setting them to true
will also improve the performance of queries that generate statistics:
Configuration Parameter | Description | Default Value |
---|---|---|
| Instructs Hive to collect column-level statistics. | False |
| Instructs Hive to use statistics when generating query plans. | False |
Note | |
---|---|
Hortonworks recommends that administrators always enable CBO. |