Optimizer GUC Parameter Hints
Function
Sets GUC parameters related to query optimization that take effect during the query execution. For details about the application scenarios of hints, see the description of each GUC parameter.
Syntax
set(param value)Parameters
param indicates the parameter name.
value indicates the value of a parameter.
Currently, the following parameters can be set and take effect by using Hint:
Boolean
enable_bitmapscan, enable_hashagg, enable_hashjoin, enable_indexscan, enable_indexonlyscan, enable_material, enable_mergejoin, enable_nestloop, enable_index_nestloop, enable_seqscan, enable_sort, enable_tidscan, partition_iterator_elimination, partition_page_estimation, enable_functional_dependency, var_eq_const_selectivity, enable_inner_unique_opt, enable_broadcast, enable_fast_query_shipping, enable_force_smp, enable_imcsscan, enable_remotegroup, enable_remotejoin, enable_remotelimit, enable_remotesort, enable_smp_dml, enable_sortgroup_agg, enable_stream_operator, enable_stream_recursive, and enable_trigger_shipping
Integer
query_dop, best_agg_plan, and effective_cache_size
Floating point
cost_weight_index, default_limit_rows, seq_page_cost, random_page_cost, cpu_tuple_cost, cpu_index_tuple_cost, and cpu_operator_cost
Enumeration type
try_vector_engine_strategy and rewrite_rule
String
node_name
NOTE
- Some parameters are available only for specific deployment modes or build options. If a parameter is unavailable in the current instance, its Hint generates an unrecognized-parameter warning and does not affect correct query execution.
- If you set a parameter that is not in the whitelist and the parameter value is invalid or the hint syntax is incorrect, the query execution is not affected. Run explain(verbose on). An error message is displayed, indicating that hint parsing fails.
- The GUC parameter hint takes effect only in the outermost query. That is, the GUC parameter hint in the subquery does not take effect.
- The GUC parameter hint in the view definition does not take effect.
- In the CREATE TABLE ... AS ... statement, the outermost GUC parameter hint takes effect.