This document describes the system configuration parameters in the Query Tuning category.
Note!
To ensure system stability and security, manually modifying these parameters should be done with caution.
Query tuning parameters are categorized as follows:
These parameters provide basic control over the query optimizer's choice of query plans.
If the default plan chosen by the optimizer for a specific query is suboptimal, you can use these parameters to force the optimizer to select a better plan as a temporary workaround.
A better long-term approach to improve plan quality includes: adjusting the planner's cost parameters (see below), manually running ANALYZE, increasing the value of the default_statistics_target configuration parameter, and using the ALTER TABLE SET STATISTICS statement to increase the amount of statistics collected for specific columns.
Enables or disables the use of bitmap scan plans by the Postgres query optimizer (planner).
| Data Type | Default Value | Setting Scope |
|---|---|---|
| boolean | on | master; session; reload |
Enables or disables the use of group aggregate plans by the Postgres query optimizer (planner).
| Data Type | Default Value | Setting Scope |
|---|---|---|
| boolean | on | master; session; reload |
Enables or disables the use of hash aggregate plans by the Postgres query optimizer (planner).
| Data Type | Default Value | Setting Scope |
|---|---|---|
| boolean | on | master; session; reload |
Enables or disables the use of hash join plans by the Postgres query optimizer (planner).
| Data Type | Default Value | Setting Scope |
|---|---|---|
| boolean | on | master; session; reload |
Enables or disables the use of index-only scan plans by the Postgres query optimizer (planner).
| Data Type | Default Value | Setting Scope |
|---|---|---|
| boolean | on | master; session; reload |
Enables or disables the use of index scan plans by the Postgres query optimizer (planner).
| Data Type | Default Value | Setting Scope |
|---|---|---|
| boolean | on | master; session; reload |
Enables or disables MARS2 aggscan.
| Data Type | Default Value | Setting Scope |
|---|---|---|
| boolean | on | master; session; reload |
Enables or disables the use of materialization by the Postgres query optimizer (planner).
| Data Type | Default Value | Setting Scope |
|---|---|---|
| boolean | on | master; session; reload |
Enables or disables the use of merge join plans by the Postgres query optimizer (planner).
| Data Type | Default Value | Setting Scope |
|---|---|---|
| boolean | on | master; session; reload |
Enables or disables the use of nested loop join plans by the Postgres query optimizer (planner).
| Data Type | Default Value | Setting Scope |
|---|---|---|
| boolean | on | master; session; reload |
Enables or disables the use of parallel append plans by the Postgres query optimizer (planner).
| Data Type | Default Value | Setting Scope |
|---|---|---|
| boolean | on | master; session; reload |
Enables or disables the use of hash join plans with parallel hash by the Postgres query optimizer (planner).
| Data Type | Default Value | Setting Scope |
|---|---|---|
| boolean | on | master; session; reload |
Enables or disables the ability of the Postgres query optimizer (planner) to reduce partitions in partitioned tables from the query plan.
| Data Type | Default Value | Setting Scope |
|---|---|---|
| boolean | on | master; session; reload |
Enables or disables partition-wise grouping or aggregation by the Postgres query optimizer (planner).
GROUP BY clause does not include the partition key, only partial aggregation can be executed per partition. Finalization must occur later.off.| Data Type | Default Value | Setting Scope |
|---|---|---|
| boolean | off | master; session; reload |
Enables or disables partition-wise joins by the Postgres query optimizer (planner).
off.| Data Type | Default Value | Setting Scope |
|---|---|---|
| boolean | off | master; session; reload |
Enables or disables the use of sequential scan plans by the Postgres query optimizer (planner).
| Data Type | Default Value | Setting Scope |
|---|---|---|
| boolean | on | master; session; reload |
Enables or disables explicit sort steps in plans generated by the Postgres query optimizer (planner).
| Data Type | Default Value | Setting Scope |
|---|---|---|
| boolean | on | master; session; reload |
Enables or disables the use of tuple identifier (TID) scan plans by the Postgres query optimizer (planner).
| Data Type | Default Value | Setting Scope |
|---|---|---|
| boolean | on | master; session; reload |
Enables or disables two-stage aggregation to compute single DISTINCT-aggregate functions.
| Data Type | Default Value | Setting Scope |
|---|---|---|
| boolean | on | master; session; reload |
Enables or disables three-stage aggregation and join to compute DISTINCT-aggregate functions.
| Data Type | Default Value | Setting Scope |
|---|---|---|
| boolean | on | master; session; reload |
Enables or disables direct dispatch of query plans to target segments for queries accessing data on a single segment.
| Data Type | Default Value | Setting Scope |
|---|---|---|
| boolean | on | master; system; restart |
When set to on, the Postgres query optimizer (planner) plans single-row inserts to be sent directly to the correct segment instance (without motion operations).
| Data Type | Default Value | Setting Scope |
|---|---|---|
| boolean | on | master; session; reload |
Enables or disables the use of two-stage or three-stage parallel aggregation plans by the Postgres query optimizer.
gp_enable_multiphase_agg is off, gp_enable_agg_distinct and gp_enable_agg_distinct_pruning are disabled.| Data Type | Default Value | Setting Scope |
|---|---|---|
| boolean | on | master; session; reload |
Enables two-stage deduplication (not SELECT COUNT(DISTINCT)) for SELECT DISTINCT queries.
SORT DISTINCT plan nodes before motion.SORT DISTINCT is much lower than sending rows over the interconnect.| Data Type | Default Value | Setting Scope |
|---|---|---|
| boolean | on | master; session; reload |
Allows the Greenplum GPORCA optimizer and Postgres query optimizer (planner) to use estimated table size (pg_relation_size function) when table statistics are unavailable.
ANALZYE ROOTPARTITION to collect statistics on the root partition. See ANALYZE.| Data Type | Default Value | Setting Scope |
|---|---|---|
| boolean | off | master; session; reload |
Enables duplicate removal during sorting.
| Data Type | Default Value | Setting Scope |
|---|---|---|
| boolean | on | master; session; reload |
Enables LIMIT operation during sorting. Sorting is more efficient when the plan only needs the first limit_number rows.
| Data Type | Default Value | Setting Scope |
|---|---|---|
| boolean | on | master; session; reload |
Dampens selectivity estimates in join clauses.
| Data Type | Default Value | Setting Scope |
|---|---|---|
| boolean | off | master; session; reload |
Dampens selectivity estimates in clauses on the same base table.
| Data Type | Default Value | Setting Scope |
|---|---|---|
| boolean | on | master; session; reload |
Sets the minimum amount of index data (in BLOCKS) that must be scanned before a parallel index scan is considered.
| Data Type | Default Value | Valid Range | Setting Scope |
|---|---|---|---|
| int | 512 | 0 ~ (INT_MAX/3) | master; session; reload |
Sets the minimum amount of table data (in BLOCKS) that must be scanned before a parallel table scan is considered.
| Data Type | Default Value | Valid Range | Setting Scope |
|---|---|---|---|
| int | 8192 | 0 ~ (INT_MAX/3) | master; session; reload |
Allows the leader process to execute parts of the query plan under Gather and Gather Merge nodes instead of waiting for worker processes.
off reduces the chance that workers are blocked waiting for the leader to read tuples, but requires the leader to wait for workers to start before producing the first tuple.| Data Type | Default Value | Setting Scope |
|---|---|---|
| boolean | on | master; system; restart |
Note!
Do not adjust these parameters. Changes affect YMatrix database hardware configuration and typical workloads. All these parameters are interrelated; changing one without considering side effects may degrade query performance.
Sets the optimizer's (planner's) estimated cost of processing each index entry during an index scan. Measured as a fraction of a sequential page fetch.
| Data Type | Default Value | Valid Range | Setting Scope |
|---|---|---|---|
| floating point | 0.005 | 0 ~ DBL_MAX | master; session; reload |
Sets the optimizer's (planner's) estimated cost of processing each operator in a WHERE statement.
| Data Type | Default Value | Valid Range | Setting Scope |
|---|---|---|---|
| floating point | 0.0025 | 0 ~ DBL_MAX | master; session; reload |
Sets the optimizer's (planner's) estimated cost of processing each row (tuple) in a query. Measured as a fraction of a sequential page fetch.
| Data Type | Default Value | Valid Range | Setting Scope |
|---|---|---|---|
| floating point | 0.01 | 0 ~ DBL_MAX | master; session; reload |
Sets the optimizer's (planner's) estimate of the fraction of rows that will be retrieved by a cursor.
1.0, cursors are planned like regular queries, considering only total time, not initial row return speed.| Data Type | Default Value | Valid Range | Setting Scope |
|---|---|---|---|
| floating point | 0.1 | 0.0 ~ 1.0 | master; session; reload |
Sets the optimizer's (planner's) assumption about the effective disk buffer size (in BLOCKS) available for a single query.
gpconfig tools and SHOW commands display effective cache size in "MB" or "kB".| Data Type | Default Value | Valid Range | Setting Scope |
|---|---|---|---|
| int | 524288 | 1 ~ INT_MAX | master; session; reload |
Sets the optimizer's estimated cost of non-sequential disk page fetches from AO tables.
| Data Type | Default Value | Valid Range | Setting Scope |
|---|---|---|---|
| floating point | 40.0 | 0 ~ DBL_MAX | master; session; reload |
Sets the optimizer's estimated cost of non-sequential disk page fetches from compressed AO tables.
| Data Type | Default Value | Valid Range | Setting Scope |
|---|---|---|---|
| floating point | 400.0 | 0 ~ DBL_MAX | master; session; reload |
Sets the cost estimate for the Motion operator in the Postgres query optimizer (planner), per row transferred between segments, measured as a fraction of sequential page fetch cost.
0, the value used is twice the cpu_tuple_cost value.| Data Type | Default Value | Valid Range | Setting Scope |
|---|---|---|---|
| floating point | 0.0 | 0 ~ DBL_MAX | master; session; reload |
Sets the number of primary instances the Postgres query optimizer (planner) assumes for cost and size estimation.
0, the actual number of primaries is used.| Data Type | Default Value | Valid Range | Setting Scope |
|---|---|---|---|
| int | 0 | 0 ~ INT_MAX | master; session; reload |
Sets the optimizer's (planner's) estimated cost of launching parallel worker processes.
| Data Type | Default Value | Valid Range | Setting Scope |
|---|---|---|---|
| floating point | 1000.0 | 0 ~ INT_MAX | master; session; reload |
Sets the optimizer's (planner's) estimated cost of passing a tuple from one parallel worker process to another.
| Data Type | Default Value | Valid Range | Setting Scope |
|---|---|---|---|
| floating point | 0.1 | 0 ~ DBL_MAX | master; session; reload |
Sets the optimizer's (planner's) estimated cost of a non-sequential disk page fetch.
seq_page_cost) make the system favor sequential scans; lower values favor index scans. You can adjust both parameters together to change the relative importance of disk I/O vs CPU cost.random_page_cost to better reflect true random read cost. Conversely, if your data fits entirely in cache (e.g., database smaller than total server memory), lowering random_page_cost may be appropriate. For storage with low random read cost (e.g., SSDs), a lower random_page_cost value may be better.Note!
Although you can setrandom_page_costlower thanseq_page_cost, physical reality remains unchanged. When all data is in memory, setting them equal is reasonable, as random access incurs no extra cost. Similarly, in highly cached databases, both values should be reduced relative to CPU costs, as fetching pages from RAM is much cheaper. If the entire database is cached in RAM, setting them equal makes sense—there is no additional cost for non-sequential access. In a highly cached database, reduce both values relative to CPU parameters, as fetching a page already in RAM is far cheaper than typical.
| Data Type | Default Value | Valid Range | Setting Scope |
|---|---|---|---|
| floating point | 4.0 | 0 ~ DBL_MAX | master; session; reload |
Sets the optimizer's (planner's) estimated cost of a sequential disk page fetch.
| Data Type | Default Value | Valid Range | Setting Scope |
|---|---|---|---|
| floating point | 1.0 | 0 ~ DBL_MAX | master; session; reload |
GEQO is an algorithm that uses heuristic search for query planning. It reduces planning time for complex queries (those involving multiple table joins), at the cost of potentially suboptimal plans compared to exhaustive search.
Enables or disables Genetic Query Optimization.
geqo_threshold variable provides finer control over GEQO.| Data Type | Default Value | Setting Scope |
|---|---|---|
| boolean | off | master; session; reload |
Controls the balance between planning time and effectiveness of query plans in GEQO.
geqo_effort does not directly affect behavior; it is used to compute default values for other GEQO-related variables.| Data Type | Default Value | Valid Range | Setting Scope |
|---|---|---|---|
| int | 0 | 0 ~ INT_MAX | master; session; reload |
Controls the number of generations used by GEQO.
1; useful values are in the same range as pool size.0 (default), YMatrix selects an appropriate value based on geqo_pool_size.| Data Type | Default Value | Valid Range | Setting Scope |
|---|---|---|---|
| int | 0 | 0 ~ INT_MAX | master; session; reload |
Controls the pool size used by GEQO, i.e., the number of individuals in the genetic population.
geqo_effort and the number of tables in the query.| Data Type | Default Value | Valid Range | Setting Scope |
|---|---|---|---|
| int | 0 | 0 ~ INT_MAX | master; session; reload |
Controls the initial seed for the random number generator used by GEQO to select random paths in the join order search space.
0 (default) to 1. Changing it alters the set of explored join paths and may result in better or worse plans.| Data Type | Default Value | Valid Range | Setting Scope |
|---|---|---|---|
| floating point | 0.0 | 0.0 ~ 1.0 | master; session; reload |
Controls the selection bias used by GEQO.
| Data Type | Default Value | Valid Range | Setting Scope |
|---|---|---|---|
| floating point | 1.0 | 0.0 ~ 100.0 | master; session; reload |
Genetic Query Optimization is used only when the number of FROM items involved is at least this value (note: a FULL OUTER JOIN counts as one FROM item).
| Data Type | Default Value | Valid Range | Setting Scope |
|---|---|---|---|
| int | 12 | 2 ~ INT_MAX | master; session; reload |
These parameters control the amount of data sampled during ANALYZE operations. Adjusting them affects statistics collection system-wide. Use the ALTER TABLE SET STATISTICS clause to configure statistics collection for specific tables and columns.
Sets the default statistics target for table columns that have not had a column-specific target set via ALTER TABLE SET STATISTICS.
ANALYZE time but improve the quality of estimates made by the Postgres query optimizer.| Data Type | Default Value | Valid Range | Setting Scope |
|---|---|---|---|
| int | 100 | 0 ~ 10000 | master; session; reload |
Enables LIMIT operation during sorting. Sorting is more efficient when the plan only needs the first limit_number rows.
| Data Type | Default Value | Setting Scope |
|---|---|---|
| boolean | on | master; session; reload |
Enables or disables two-stage aggregation to compute single DISTINCT-aggregate functions.
| Data Type | Default Value | Setting Scope |
|---|---|---|
| boolean | on | master; session; reload |
--- SPLIT ---
gp_enable_agg_distinct_pruning
Enables or disables three-stage aggregation and joins to compute distinct qualified aggregates.
| Data Type | Default Value | Scope |
|---|---|---|
| boolean | on | master; session; reload |
Enables or disables the use of two-stage or three-stage parallel aggregation plans by the Postgres query optimizer.
gp_enable_multiphase_agg is off, then gp_enable_agg_distinct and gp_enable_agg_distinct_pruning are disabled.| Data Type | Default Value | Scope |
|---|---|---|
| boolean | on | master; session; reload |
Enables two-stage deduplication for SELECT DISTINCT queries (not SELECT COUNT(DISTINCT)).
SORT DISTINCT plan nodes before data movement.SORT DISTINCT is much lower than sending rows over the interconnect.| Data Type | Default Value | Scope |
|---|---|---|
| boolean | on | master; session; reload |
Specifies whether temporary files created when hash aggregation or hash join operations spill to disk are compressed.
| Data Type | Default Value | Scope |
|---|---|---|
| boolean | off | master; session; reload |
Pulls up projection fields and moves aggregate evaluations into a separate result node.
| Data Type | Default Value | Scope |
|---|---|---|
| boolean | off | segments; session; reload |
If the resulting list has no more than this number of items, the Postgres optimizer (planner) rewrites explicit JOIN (except FULL JOIN) constructs into a list of FROM items.
from_collapse_limit, which is suitable for most cases.1 prevents any reordering of inner joins. Thus, the join order specified in the query becomes the actual execution order.1 and from_collapse_limit may help balance planning time against plan quality (higher values may yield better plans).geqo_threshold or higher may trigger the use of the GEQO planner, potentially producing suboptimal plans.| Data Type | Default Value | Valid Range | Scope |
|---|---|---|---|
| int | 20 | 1 ~ INT_MAX | master; session; reload |
Enables selectivity adjustment for NULL tests in outer joins.
| Data Type | Default Value | Scope |
|---|---|---|
| boolean | on | master; session; reload |
Sets the target density of the hash table used by HashJoin operations.
| Data Type | Default Value | Valid Range | Scope |
|---|---|---|---|
| int | 5 | 1 ~ 25 | master; session; reload |
Specifies whether temporary files created when hash aggregation or hash join operations spill to disk are compressed.
| Data Type | Default Value | Scope |
|---|---|---|
| boolean | off | master; session; reload |
Controls the use of table constraints by the Postgres query optimizer (planner) to optimize queries.
on (check constraints for all tables), off (never check constraints), and partition (check constraints only for inherited child tables and UNION ALL subqueries). The default is partition. This setting is typically used with traditional inheritance trees to improve performance.CHECK constraints and skips scanning tables where the conditions contradict the constraints. For example:=# CREATE TABLE parent(key integer, ...);
=# CREATE TABLE child1000(check (key between 1000 and 1999)) INHERITS(parent);
=# CREATE TABLE child2000(check (key between 2000 and 2999)) INHERITS(parent);
...
=# SELECT * FROM parent WHERE key = 2400;
With constraint exclusion enabled, this SELECT will skip scanning child1000, improving performance.
enable_partition_pruning.)| Data Type | Default Value | Valid Range | Scope |
|---|---|---|---|
| enum | on | true / false / yes / no / 1 / 0 / on / off / partition | master; session; reload |
Allows parallel queries to be used for testing purposes, even when no performance benefit is expected.
off (use parallel mode only when performance improvement is expected), on (force parallel query whenever the query is considered safe), and regress (similar to on, but with additional behavioral changes as explained below).on adds a Gather node at the top of any query plan deemed safe for parallel execution, so the query runs inside a parallel worker. Even if no worker is available or usable, operations forbidden in parallel contexts (e.g., starting subtransactions) are prohibited unless the optimizer believes skipping them would cause query failure. When this option is set, functions causing failures or unexpected results may need to be marked PARALLEL UNSAFE (or PARALLEL RESTRICTED).regress has all the effects of on, plus additional effects useful for regression testing. Messages from parallel workers normally include a hint line indicating their origin; setting this to regress removes that line, making output identical to non-parallel execution. Similarly, Gather nodes added by this setting are hidden in EXPLAIN output, matching the output when set to off.| Data Type | Default Value | Valid Range | Scope |
|---|---|---|---|
| enum | off | on / off / regress | master; session; reload |
If the resulting FROM list does not exceed this value, the Postgres query optimizer (planner) flattens subqueries into the upper-level query.
geqo_threshold or higher may trigger the use of the GEQO planner, potentially resulting in suboptimal plans.| Data Type | Default Value | Valid Range | Scope |
|---|---|---|---|
| int | 20 | 1 ~ INT_MAX | master; session; reload |
When enabled, the Postgres query optimizer (planner) applies query predicates to both table expressions when tables are joined on their distribution key columns.
| Data Type | Default Value | Scope |
|---|---|---|
| boolean | on | master; session; reload |
Specifies the maximum uncompressed total size of a query execution plan multiplied by the number of Motion operators (slices) in the plan.
0 means plan size is not monitored.200 means 200kB. The value 1GB is equivalent to 1024MB or 1048576kB.| Data Type | Default Value | Valid Range | Scope |
|---|---|---|---|
| int | 0 | 0 ~ (INT_MAX/1024) | master; session; superuser |
Allows the Postgres query optimizer (planner) to use statistics from child partitions when planning queries on a parent table.
| Data Type | Default Value | Scope |
|---|---|---|
| boolean | off | master; session; reload |
When enabled, allows the Postgres query optimizer (planner) to use foreign key information stored in the system catalog to optimize joins between foreign and primary keys.
| Data Type | Default Value | Scope |
|---|---|---|
| boolean | off | master; session; reload |
Specifies the maximum number of slices (parts of a query plan executed on Segment instances) that a query can generate.
UNION or UNION ALL operators on multiple complex views may generate many slices. You can run EXPLAIN ANALYZE on a query to view its slice statistics.| Data Type | Default Value | Valid Range | Scope |
|---|---|---|---|
| int | 0 | 0 ~ INT_MAX | master; session; reload |
Prepared statements (explicitly prepared or implicitly generated, e.g., in PL/pgSQL) can be executed using either custom or generic plans.
| Data Type | Default Value | Valid Range | Scope |
|---|---|---|---|
| enum | auto | auto / force_custom_plan / force_generic_plan | master; session; reload |
Determines whether YMatrix allows JIT compilation.
| Data Type | Default Value | Scope |
|---|---|---|
| boolean | on | master; session; reload |
Sets the query cost threshold for activating JIT (Just-In-Time) compilation. If the query cost exceeds this value, JIT compilation is activated.
-1 disables JIT compilation.| Data Type | Default Value | Valid Range | Scope |
|---|---|---|---|
| floating point | 100000 | -1 ~ DBL_MAX | master; session; reload |
If LLVM has the required capability, registers generated functions with GDB. This makes debugging easier.
| Data Type | Default Value | Scope |
|---|---|---|
| boolean | off | master; session; reload; superuser |
Writes the generated LLVM IR to the file system under data_directory.
SET privilege can change this setting.| Data Type | Default Value | Scope |
|---|---|---|
| boolean | off | master; session; reload; superuser |
When JIT compilation is activated, allows JIT compilation of expressions.
| Data Type | Default Value | Scope |
|---|---|---|
| boolean | on | master; session; reload |
Sets the query cost threshold at which JIT compilation attempts to inline functions and operators.
jit_above_cost is ineffective.-1 disables inlining.| Data Type | Default Value | Valid Range | Scope |
|---|---|---|---|
| floating point | 500000 | -1 ~ DBL_MAX | master; session; reload |
Sets the query cost threshold at which JIT compilation applies expensive optimizations.
jit_above_cost is ineffective, and setting it above jit_inline_above_cost may not be beneficial.-1 disables expensive optimizations.| Data Type | Default Value | Valid Range | Scope |
|---|---|---|---|
| floating point | 500000 | -1 ~ DBL_MAX | master; session; reload |
If LLVM has the required capability, emits data needed by the perf command to profile JIT-generated functions.
~/.debug/jit/. If the environment variable JITDUMPDIR is set and loaded, files are written to JITDUMPDIR/debug/jit instead.| Data Type | Default Value | Scope |
|---|---|---|
| boolean | off | master; session; reload; superuser |
When JIT compilation is activated, allows JIT compilation of tuple deforming.
| Data Type | Default Value | Scope |
|---|---|---|
| boolean | on | master; session; reload |
If a table lacks statistics, allows the ORCA optimizer and Postgres query optimizer to use the table's estimated size (pg_relation_size function).
ANALZYE ROOTPARTITION to collect statistics on the root partition. See ANALYZE.| Data Type | Default Value | Scope |
|---|---|---|
| boolean | off | master; session; reload |
Enables or disables GPORCA when running SQL queries.
on. If GPORCA is disabled, the YMatrix database uses only the Postgres query optimizer.optimizer parameter can be set at the database system, individual database, session, or query level.| Data Type | Default Value | Scope |
|---|---|---|
| boolean | on | master; session; reload |
For partitioned tables, controls whether the ANALYZE command requires the ROOTPARTITION keyword to collect statistics on the root partition.
on, meaning ANALYZE can collect root partition statistics without the ROOTPARTITION keyword. Statistics are collected when running ANALYZE on the root partition, or when running ANALYZE on a child leaf partition if other leaf partitions have statistics.off, you must run ANALZYE ROOTPARTITION to collect root partition statistics.optimizer is set to on (default), this parameter should also be set to on.| Data Type | Default Value | Scope |
|---|---|---|
| boolean | on | master; system; restart |
When GPORCA is enabled (default) and processing queries with predicates containing constant arrays, the optimizer_array_expansion_threshold parameter limits optimization based on the number of constants in the array.
IN clause containing more than 100 elements, it does not convert the predicate during optimization to reduce planning time and memory usage. The difference in query processing can be seen in the filter conditions of the EXPLAIN clause in the query IN plan.| Data Type | Default Value | Valid Range | Scope |
|---|---|---|---|
| int | 100 | 0 ~ INT_MAX | master; session; reload |
Controls whether users can change the server configuration parameter optimizer using SET, RESET commands, or the YMatrix utility gpconfig.
optimizer_control parameter is enabled, users can set optimizer parameters.optimizer_control parameter is set to off, optimizer parameters cannot be changed.| Data Type | Default Value | Scope |
|---|---|---|
| boolean | on | master; system; restart; superuser |
When GPORCA is enabled (default), this parameter controls the cost model GPORCA uses for bitmap scans, which are used with bitmap indexes or btree indexes on AO tables.
legacy - Retains the calibrated cost model used by GPORCA in Greenplum Database versions 6.13 and earlier.calibrated - Improves cost estimation for indexes.experimental - Reserved for future experimental cost models; currently equivalent to calibrated.calibrated cost model is more likely to choose faster bitmap index scans with nested loop joins instead of hash joins.| Data Type | Default Value | Valid Range | Scope |
|---|---|---|---|
| enum | calibrated | legacy / calibrated / experimental | master; session; reload |
When GPORCA is enabled (default), this parameter controls the amount of inlining performed for common table expression (CTE) queries (queries with WHERE clauses).
0 disables inlining.| Data Type | Default Value | Valid Range | Scope |
|---|---|---|---|
| int | 0 | 0 ~ INT_MAX | master; session; reload |
When the Greenplum ORCA optimizer is enabled (default) and this parameter is on (default), GPORCA derives statistics to more accurately estimate the number of rows scanned during dynamic partition elimination.
| Data Type | Default Value | Scope |
|---|---|---|
| boolean | on | master; session; reload |
When GPORCA is enabled (default), this parameter controls whether join associativity transformations are enabled during query optimization.
off, only the GPORCA dynamic programming algorithm for join order analysis is enabled.on, GPORCA can use associativity transformations during query optimization.| Data Type | Default Value | Scope |
|---|---|---|
| boolean | off | master; session; reload |
When GPORCA is enabled (default) and this parameter is on (default), GPORCA attempts to process DML commands such as INSERT, UPDATE, and DELETE.
| Data Type | Default Value | Scope |
|---|---|---|
| boolean | on | master; session; reload |
When GPORCA is enabled (default) and this parameter is on (default), GPORCA can generate index-only scan plans for B-tree indexes.
off), GPORCA does not generate index-only scan plans.| Data Type | Default Value | Scope |
|---|---|---|
| boolean | on | master; session; reload |
When GPORCA is enabled (default), this parameter allows GPORCA to support multiple distinct qualified aggregates, such as SELECT count(DISTINCT a),sum(DISTINCT b) FROM foo.
| Data Type | Default Value | Scope |
|---|---|---|
| boolean | off | master; session; reload |
When GPORCA is enabled (default), this parameter affects the query plan alternatives GPORCA considers when generating three-stage aggregation plans.
on, GPORCA considers only three-stage aggregation plans where intermediate aggregation uses GROUP BY and DISTINCT columns for distribution to reduce skew impact.off, GPORCA may also consider plans that distribute using the GROUP BY column.| Data Type | Default Value | Scope |
|---|---|---|
| boolean | on | master; session; reload |
With the default setting, when GPORCA is enabled and this parameter is on, GPORCA selects three-stage aggregation plans for scalar distinct qualified aggregates when such plan alternatives are available.
| Data Type | Default Value | Scope |
|---|---|---|
| boolean | off | master; session; reload |
With the default setting, GPORCA is enabled and this parameter is on, GPORCA selects multi-stage aggregation plans when such alternatives are available.
| Data Type | Default Value | Scope |
|---|---|---|
| boolean | on | master; session; reload |
This value is an optimization hint that limits the number of join associativity and commutativity transformations explored during query optimization.
18 tells GPORCA to stop exploring associativity and commutativity transformations when an n-ary join operator has more than 18 children.optimizer_join_order parameter is set to query or greedy.| Data Type | Default Value | Valid Range | Scope |
|---|---|---|---|
| int | 18 | 0 ~ INT_MAX | segments; system; reload |
--- SPLIT ---
optimizer_join_order
When GPORCA is enabled, this parameter sets the optimization level for join ordering during query optimization by specifying the type of join order alternatives to evaluate.
query - Use the join order specified in the query.greedy - Compute the join order specified in the query and alternatives based on the smallest cardinality of relations in the joins.exhaustive - Apply transformation rules to find and evaluate all possible join order alternatives.exhaustive. Setting this parameter to query or greedy may generate suboptimal query plans. However, if the administrator is confident that satisfactory plans are produced with query or greedy, lowering the optimization level can improve query optimization time.query or greedy overrides the optimizer_join_order_threshold and optimizer_join_arity_for_associativity_commutativity parameters.| Data Type | Default Value | Value Range | Setting Classification |
|---|---|---|---|
| enum | exhaustive | exhaustive / greedy / query | master; session; reload |
When GPORCA is enabled (default), this parameter sets the maximum number of join inputs for which GPORCA uses a dynamic programming-based join ordering algorithm.
optimizer_join_query parameter is set to query or greedy.| Data Type | Default Value | Value Range | Setting Classification |
|---|---|---|---|
| int | 10 | 0 ~ 12 | master; session; reload |
Sets the maximum amount of memory (in KB) on the YMatrix database Master that GPORCA uses to cache query metadata (optimization data) during query optimization.
optimizer_metadata_caching is enabled.16384(16MB), which is the optimal value determined through performance analysis.KB, MB, or GB. The default unit is KB. For example, a value of 16384 means 16384KB. A value of 1GB is equivalent to 1024MB or 1048576KB.0, the cache size is unlimited.| Data Type | Default Value | Value Range | Setting Classification |
|---|---|---|---|
| int | 16384 | 0 ~ INT_MAX | master; session; reload |
When GPORCA is enabled (default), this parameter specifies whether GPORCA caches query metadata (optimization data) in memory on the YMatrix database Master during query optimization.
off, GPORCA does not cache metadata during query optimization.optimizer_mdcache_size controls the size of the query metadata cache.| Data Type | Default Value | Setting Classification |
|---|---|---|
| boolean | on | master; session; reload |
When GPORCA is enabled (default), optimizer_parallel_union controls the degree of parallelization for queries containing UNION or UNION ALL clauses.
off, GPORCA generates a query plan where each child of the APPEND(UNION) operator resides in the same slice as the APPEND operator.APPEND(UNION) operator. During execution, the children and parent APPEND operators reside on different slices, allowing the children of the APPEND(UNION) operator to execute in parallel across Segment instances.| Data Type | Default Value | Setting Classification |
|---|---|---|
| boolean | off | master; session; reload |
When GPORCA is enabled (default), during query optimization, GPORCA penalizes the cost of plans that attempt to broadcast relations exceeding the number of rows specified by this parameter.
100K rows (default), any broadcast exceeding 100K rows is heavily penalized.0, GPORCA sets the broadcast threshold to unlimited and never penalizes broadcast operations.| Data Type | Default Value | Value Range | Setting Classification |
|---|---|---|---|
| int | 100000 | 0 ~ INT_MAX | master; session; reload |
When GPORCA is enabled (default), this parameter allows GPORCA to penalize the segment cost of HashJoin operators that have a skewed Redistribute Motion as a child, favoring Broadcast Motion during query optimization.
| Data Type | Default Value | Setting Classification |
|---|---|---|
| boolean | on | master; session; reload |
When GPORCA is enabled (default), this parameter enables logging of GPORCA query optimization statistics for various optimization phases.
off; optimization statistics are not logged.on, and the parameter client_min_messages must be set to log.set optimizer_print_optimization_stats = on;set client_min_messages = 'log';EXPLAIN or EXPLAIN ANALYZE commands.| Data Type | Default Value | Setting Classification |
|---|---|---|
| boolean | off | master; session; reload |
When GPORCA is enabled (default), optimizer_sort_factor controls the cost factor applied to sort operations during query optimization.
1 specifies the default sort cost factor.2.0 sets the cost factor to twice the default, and a value of 0.5 sets it to half the default.| Data Type | Default Value | Value Range | Setting Classification |
|---|---|---|---|
| floating point | 1.0 | 0.0 ~ DBL_MAX | master; session; reload |
Enables or disables Runtime Filter.
| Data Type | Default Value | Setting Classification |
|---|---|---|
| boolean | on | master; session; reload |
Runtime Filter is not triggered when the ratio of outer table rows to inner table rows in a join is less than this value.
| Data Type | Default Value | Value Range | Setting Classification |
|---|---|---|---|
| int | 10 | 0 ~ (INT_MAX/2) | master; session; reload |
Maximum number of Runtime Filters allowed per query.
| Data Type | Default Value | Value Range | Setting Classification |
|---|---|---|---|
| int | 4 | 0 ~ (INT_MAX/2) | master; session; reload |
Runtime Filter is not triggered when the number of rows in the inner table of a join exceeds this value.
| Data Type | Default Value | Value Range | Setting Classification |
|---|---|---|---|
| int | 2000000 | 0 ~ (INT_MAX/2) | master; session; reload |
Runtime Filter is not triggered when the number of rows in the outer table of a join is less than this value.
| Data Type | Default Value | Value Range | Setting Classification |
|---|---|---|---|
| int | 3 | 0 ~ (INT_MAX/2) | master; session; reload |
Runtime Filter is not triggered when the number of rows in the outer table of a join is less than this value.
| Data Type | Default Value | Value Range | Setting Classification |
|---|---|---|---|
| int | 500000 | 0 ~ (INT_MAX/2) | master; session; reload |
Runtime Filter is not triggered when the ratio of scanned rows in the inner table to rows satisfying the join condition is less than this value.
| Data Type | Default Value | Value Range | Setting Classification |
|---|---|---|---|
| int | 25 | 0 ~ (INT_MAX/2) | master; session; reload |
Enables or disables the vectorized execution engine.
| Data Type | Default Value | Setting Classification |
|---|---|---|
| boolean | true | master; session; reload |
Enables the vectorized execution engine to use grouped aggregate plans.
| Data Type | Default Value | Setting Classification |
|---|---|---|
| boolean | true | master; session; reload |
Enables the vectorized execution engine to use hash aggregate plans.
| Data Type | Default Value | Setting Classification |
|---|---|---|
| boolean | true | master; session; reload |
Enables the vectorized execution engine to use append plan types.
| Data Type | Default Value | Setting Classification |
|---|---|---|
| boolean | true | master; session; reload |
Enables the vectorized execution engine to use Motion plan types.
| Data Type | Default Value | Setting Classification |
|---|---|---|
| boolean | true | master; session; reload |
Enables the vectorized execution engine to use aggregate plan types with explicit pre-sorting.
| Data Type | Default Value | Setting Classification |
|---|---|---|
| boolean | true | master; session; reload |
Enables the root executor of the vectorized execution engine.
| Data Type | Default Value | Setting Classification |
|---|---|---|
| boolean | true | master; session; reload |
Enables the vectorized execution engine to use sort plan types.
| Data Type | Default Value | Setting Classification |
|---|---|---|
| boolean | true | master; session; reload |
Enables strict mode for the vectorized execution engine.
| Data Type | Default Value | Setting Classification |
|---|---|---|
| boolean | false | master; session; reload |
Enables fallback expressions for the vectorized execution engine.
| Data Type | Default Value | Setting Classification |
|---|---|---|
| boolean | true | master; session; reload |
Enables the vectorized execution engine to use limit plan types.
| Data Type | Default Value | Setting Classification |
|---|---|---|
| boolean | true | master; session; reload |
Enables the vectorized execution engine to use window aggregate plan types.
| Data Type | Default Value | Setting Classification |
|---|---|---|
| boolean | false | master; session; reload |
Enables the vectorized execution engine to use subquery scan plan types.
| Data Type | Default Value | Setting Classification |
|---|---|---|
| boolean | true | master; session; reload |
Enables the vectorized execution engine to use hash join plan types.
| Data Type | Default Value | Setting Classification |
|---|---|---|
| boolean | true | master; session; reload |
Enables advanced hash map for vectorized hash joins.
| Data Type | Default Value | Setting Classification |
|---|---|---|
| boolean | true | master; session; reload |
Enables the vectorized execution engine to use aggregate scan plan types.
| Data Type | Default Value | Setting Classification |
|---|---|---|
| boolean | true | master; session; reload |
Enables the vectorized execution engine to use index scans.
| Data Type | Default Value | Setting Classification |
|---|---|---|
| boolean | true | master; session; reload |