Data Access
Also available as:
PDF
loading table of contents...

Enabling Cost-Based Optimization

About this Task

Turning on CBO is highly recommended.

Prerequisite

You must have administrator previleges.

Steps

  1. In Ambari, open Services > Hive > Configs tab.

  2. Refer to the following table for the properties that enable CBO and assist with generating table statistics, along with the required property settings.

    You can view the properties by either of these methods:

    Type each property name in the Filter field in the top right corner.
    Open the General, Advanced hive-env, etc., sections and scan the lists of each category.
  3. Click Save.

  4. If prompted to restart, restart the Hive Service.

Table 2.2. CBO Configuration Parameters

Configuration ParameterSetting to Enable CBODescription

hive.cbo.enable

true

Enables cost-based query optimization.

hive.stats.autogather

true

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 the table-level statistics for newly generated tables and table partitions with the ANALYZE TABLE statement.