| enable_hashjoin | Boolean | Definition: Controls whether the optimizer uses hash join plans. Range: Boolean. - on: It is used.
- off: It is not used.
Default Value: on. |
| enable_nestloop | Boolean | Definition: Controls whether the optimizer uses the nested loop join plan type for full table scans of internal tables. It is impossible to completely eliminate nested loop joins, but disabling this variable will cause the optimizer to prefer other methods when they are available. Range: Boolean. - on: It is used.
- off: It is not used.
Default Value: off. |
| best_agg_plan | Integer | Definition: For the Agg operation in the stream, the optimizer generates three plans: - hashagg+gather(redistribute)+hashagg
- redistribute+hashagg(+gather)
- hashagg+redistribute+hashagg(+gather)
This parameter controls which hash aggregation plan the optimizer generates. Range: An integer, which can be 0, 1, 2, or 3. - The value 1 forces the generation of the first plan.
- The value 2 forces the generation of the second plan if the group by columns can be redistributed. Otherwise, it generates the first plan.
- The value 3 forces the generation of the third plan if the group by columns can be redistributed. Otherwise, it generates the first plan.
- The value 0 allows the optimizer to select the best plan based on the estimated costs of the above three plans.
Default Value: 0. |
| turbo_engine_version | Integer | Definition: Specifies whether to use the turbo execution engine. If the turbo storage format is specified for a table (the enable_turbo_store parameter in the table attribute is set to on) and the query does not involve the merge join or sort agg operator, the turbo execution engine can be used to multiply the performance of the executor. Range: An integer, which can be 0, 1, 2, or 3. - The value 0 disables the turbo execution engine.
- The value 1 enables the turbo execution engine only for single-table aggregate queries.
- The value 2 enables the turbo execution engine only for single-table aggregate or multi-table join queries.
- If the value is 3, the turbo execution engine can be used to accelerate the execution of most common operators, but not supported by some operators such as merge join and sort agg. When the data volume is large and the value of turbo_engine_version is 3, the merge join and sort agg operators are seldom used. Therefore, the turbo execution engine can be used to accelerate the execution of almost all SQL statements.
Default Value: 3. NOTE: You are advised not to enable the turbo execution engine in cross-VW scenarios. |
| agg_redistribute_enhancement | Boolean | Definition: Specifies the policy for selecting a redistribution column when multiple GROUP BY columns are involved in the Agg operation and none of them is a distribution key. This parameter is used to control the policy for selecting a redistribution column. Range: Boolean. - on indicates that the redistribution column with the largest estimated distinct value is selected as the redistribution column.
- off indicates the first column that can be redistributed for redistribution.
Default Value: off. |
| skew_option | String | Definition: Controls whether to use the optimization policy. Range: A string. - off: Disables the policy.
- normal: Uses the radical policy. For scenarios where skew occurrence is uncertain, assumes skew exists and performs corresponding optimizations.
- lazy: Uses a conservative policy. If it is uncertain whether skew occurs, the system considers that no skew occurs and does not perform optimization.
Default Value: normal. |
| rewrite_rule | String | Definition: Specifies the enabled optional query rewriting rules. In specific scenarios, this GUC parameter is used to set query rewriting rules to achieve optimal query efficiency. This parameter can be used to control the combination of query rewriting rules. For example, there are multiple rewriting rules: rule1, rule2, rule3, and rule4. You can set this parameter as follows: set rewrite_rule='on(rule1)'; -- Enable the query rewriting rule rule1.
set rewrite_rule='off(rule1)'; -- Disable the query rewriting rule rule1.
set rewrite_rule='rule2,rule3'; -- Enable the query rewriting rules rule2 and rule3.
set rewrite_rule=none; -- Disable all optional query rewriting rules. Range: A string, which can be a combination of multiple optional query rewriting rules, including: - none: No optional query rewriting rules are used.
- lazyagg: The Lazy Agg query rewriting rule is used to eliminate aggregation in subqueries.
- magicset: The Magic Set query rewriting rule is used (conditions are pushed down from the main query to subqueries).
- uniquecheck: The Unique Check query rewriting rule is used (expression sublinks without aggregate functions in target columns can be pulled up. This rule can be enabled only when the target column values are unique after the sublinks are aggregated by the associated columns. It is recommended that this rule be used by professional tuning personnel).
- disablerep: The rule for forbidding sublink pull-up for replicated tables is used.
- notinopt: The Not In query rewriting rule is used (Not In is converted to a more efficient hash join).
- or_conversion: The OR query rewriting rule is used (complex predicates containing OR are split or rewritten).
- projection_pushdown: The projection pushdown query rewriting rule is used.
- plain_lazyagg: The plain lazyagg query rewriting rule is used (for single subqueries and distinct operations).
- eager_magicset: The eager magic set query rewriting rule is used (qual conditions can be pushed down to subqueries with GROUP BY or PARTITION BY).
- outer_join_quality_imply: The outer join query rewriting rule is used (attributes can be transferred from the outer table to the inner table in an outer join).
- inlist_merge: The inlist merge query rewriting rule is used (multiple INs in the same column are combined into one IN(List)).
- casewhen_simplification: The CASE WHEN query rewriting rule is used (constant folding is performed on the CASE WHEN..THEN...ELSE...END statement, and unreachable branches are removed to simplify calculation).
- subquery_qual_pull_up: The subquery pull-up query rewriting rule is used (filter conditions in subqueries are pulled up to the outer query).
- join_elimination: The join elimination query rewriting rule is used (joins that do not affect the final result are deleted).
- not_distinct_from_opt: The NOT DISTINCT FROM query rewriting rule is used (IS NOT DISTINCT FROM is converted to = to support hash join).
- foreign_agg_opt: The query rewriting rule for partial aggregate functions is used (the result set is queried through the file footer for the count(1), max, and min functions).
- selfjoin_elimination: The self-join query rewriting rule is used (the self-join of two tables in the EXISTS and ANY sublinks is eliminated to a single-table aggregation).
- remove_groupby: The remove groupby query rewriting rule is used (redundant grouping columns are deleted).
- sum_opt: The SUM optimization query rewriting rule is used (extracting common expressions from SUM to reduce the number of SUM aggregations).
Default Value: magicset, or_conversion, projection_pushdown, plain_lazyagg, subquery_qual_pull_up, not_distinct_from_opt, foreign_agg_opt, selfjoin_elimination, remove_groupby, or sum_opt. |
| cte_options | String | Definition: Specifies the prerequisites for selecting CteScan in a plan. The parameter value is a string of comma-separated key-value pairs, with each pair in the format of (key:value). For details about the values and functions of each parameter, see the table of cte_options parameters and values. Range: A string of key-value pairs. The sub-items include pred_threshold, max_mem, and ref_count_threshold. For details about the value ranges of each sub-item, see the table of cte_options parameters and values. Default Value: (pred_threshold:2),(max_mem:256),(ref_count_threshold:4). |
| analyze_mode | String | Definition: Specifies the ANALYZE options. This parameter can be used to set a combination of multiple optimization options. For details, see the description of rewrite_rule. Range: A string. - none: No special configuration is required.
- auto: Enable auto-analyze.
- file_sample: Enable file-level sampling.
- partition: Enable partition-level ANALYZE.
Default Value: none. |
| sql_opt_options | String | Definition: Configures the optimization options for generating SQL plans. This parameter can be used to set a combination of multiple optimization options. For details, see the description of rewrite_rule. Range: A string. - none: No special configuration is required.
- cte_scan: Enables shared scan for WITH clause.
- common_expr_reuse: Enables expression reuse for non-result-set expressions.
- project_set: Enables expression reuse for result-set functions and optimizes execution logic using project_set.
- udf_split: Splits nested user-defined functions into different operators and uses the stream operator to execute the functions concurrently.
- async_udf: Enables asynchronous, concurrent execution of multiple UDFs at the same level.
- iceberg_bucket_stream_opt: Supports bucket aware joins for Iceberg bucket partitioned tables, reducing stream overhead.
- udf_fusion: Nested UDFs, such as udf1(udf2), can be combined into a single UDF and executed within one actor.
- objectref_transfer: Data of the bytea type can be stored in the distributed shared memory and transferred between operators as ObjectRef.
- udf_variadic_input: A UDF can accept multiple independent ObjectRef parameters, with a maximum of 32 ObjectRef parameters supported.
- arrow_column_convert: Vectorized conversion between Arrow and Turbo.
Default Value: cte_scan,iceberg_bucket_stream_opt. |