Skip to content

Query Tuning

Complete dossiers for 55 core PostgreSQL settings in Query Tuning.

Dossier URLs remain flat; this category exists only to organize browsing and the sidebar.

constraint_exclusion

constraint_exclusion — Enables the planner to use constraints to optimize queries. Observed in PG9.0–19 Beta 3; its last measured boot default is partition in PG19 Beta 3, with user context. This is a beta-snapshot fact and can change before PostgreSQL 19 GA.

cpu_index_tuple_cost

cpu_index_tuple_cost — Sets the planner’s estimate of the cost of processing each index entry during an index scan. Observed in PG9.0–19 Beta 3; its last measured boot default is 0.005 in PG19 Beta 3, with user context. This is a beta-snapshot fact and can change before PostgreSQL 19 GA.

cpu_operator_cost

cpu_operator_cost — Sets the planner’s estimate of the cost of processing each operator or function call. Observed in PG9.0–19 Beta 3; its last measured boot default is 0.0025 in PG19 Beta 3, with user context. This is a beta-snapshot fact and can change before PostgreSQL 19 GA.

cpu_tuple_cost

cpu_tuple_cost — Sets the planner’s estimate of the cost of processing each tuple (row). Observed in PG9.0–19 Beta 3; its last measured boot default is 0.01 in PG19 Beta 3, with user context. This is a beta-snapshot fact and can change before PostgreSQL 19 GA.

cursor_tuple_fraction

cursor_tuple_fraction — Sets the planner’s estimate of the fraction of a cursor’s rows that will be retrieved. Observed in PG9.0–19 Beta 3; its last measured boot default is 0.1 in PG19 Beta 3, with user context. This is a beta-snapshot fact and can change before PostgreSQL 19 GA.

default_statistics_target

Sets the default detail level for column statistics collected by ANALYZE when a column has no explicit target. More detail can improve cardinality estimates at the cost of collection time and catalog space.

effective_cache_size

A planner estimate of how much PostgreSQL data cache is effectively available to one query; it changes plan costing but allocates no memory.

enable_async_append

enable_async_append — Enables the planner’s use of async append plans. Observed in PG14–19 Beta 3; its last measured boot default is on in PG19 Beta 3, with user context. This is a beta-snapshot fact and can change before PostgreSQL 19 GA.

enable_bitmapscan

enable_bitmapscan — Enables the planner’s use of bitmap-scan plans. Observed in PG9.0–19 Beta 3; its last measured boot default is on in PG19 Beta 3, with user context. This is a beta-snapshot fact and can change before PostgreSQL 19 GA.

enable_distinct_reordering

enable_distinct_reordering — Enables reordering of DISTINCT keys. Observed in PG18–19 Beta 3; its last measured boot default is on in PG19 Beta 3, with user context. This is a beta-snapshot fact and can change before PostgreSQL 19 GA.

enable_eager_aggregate

enable_eager_aggregate — Enables eager aggregation. Observed in PG19 Beta 3; its last measured boot default is on in PG19 Beta 3, with user context. This is a beta-snapshot fact and can change before PostgreSQL 19 GA.

enable_gathermerge

enable_gathermerge — Enables the planner’s use of gather merge plans. Observed in PG10–19 Beta 3; its last measured boot default is on in PG19 Beta 3, with user context. This is a beta-snapshot fact and can change before PostgreSQL 19 GA.

enable_group_by_reordering

enable_group_by_reordering — Enables reordering of GROUP BY keys. Observed in PG17–19 Beta 3; its last measured boot default is on in PG19 Beta 3, with user context. This is a beta-snapshot fact and can change before PostgreSQL 19 GA.

enable_hashagg

enable_hashagg — Enables the planner’s use of hashed aggregation plans. Observed in PG9.0–19 Beta 3; its last measured boot default is on in PG19 Beta 3, with user context. This is a beta-snapshot fact and can change before PostgreSQL 19 GA.

enable_hashjoin

enable_hashjoin — Enables the planner’s use of hash join plans. Observed in PG9.0–19 Beta 3; its last measured boot default is on in PG19 Beta 3, with user context. This is a beta-snapshot fact and can change before PostgreSQL 19 GA.

enable_incremental_sort

enable_incremental_sort — Enables the planner’s use of incremental sort steps. Observed in PG13–19 Beta 3; its last measured boot default is on in PG19 Beta 3, with user context. This is a beta-snapshot fact and can change before PostgreSQL 19 GA.

enable_indexonlyscan

enable_indexonlyscan — Enables the planner’s use of index-only-scan plans. Observed in PG9.2–19 Beta 3; its last measured boot default is on in PG19 Beta 3, with user context. This is a beta-snapshot fact and can change before PostgreSQL 19 GA.

enable_indexscan

enable_indexscan — Enables the planner’s use of index-scan plans. Observed in PG9.0–19 Beta 3; its last measured boot default is on in PG19 Beta 3, with user context. This is a beta-snapshot fact and can change before PostgreSQL 19 GA.

enable_material

enable_material — Enables the planner’s use of materialization. Observed in PG9.0–19 Beta 3; its last measured boot default is on in PG19 Beta 3, with user context. This is a beta-snapshot fact and can change before PostgreSQL 19 GA.

enable_memoize

enable_memoize — Enables the planner’s use of memoization. Observed in PG14–19 Beta 3; its last measured boot default is on in PG19 Beta 3, with user context. This is a beta-snapshot fact and can change before PostgreSQL 19 GA.

enable_mergejoin

enable_mergejoin — Enables the planner’s use of merge join plans. Observed in PG9.0–19 Beta 3; its last measured boot default is on in PG19 Beta 3, with user context. This is a beta-snapshot fact and can change before PostgreSQL 19 GA.

enable_nestloop

enable_nestloop — Enables the planner’s use of nested-loop join plans. Observed in PG9.0–19 Beta 3; its last measured boot default is on in PG19 Beta 3, with user context. This is a beta-snapshot fact and can change before PostgreSQL 19 GA.

enable_parallel_append

enable_parallel_append — Enables the planner’s use of parallel append plans. Observed in PG11–19 Beta 3; its last measured boot default is on in PG19 Beta 3, with user context. This is a beta-snapshot fact and can change before PostgreSQL 19 GA.

enable_parallel_hash

enable_parallel_hash — Enables the planner’s use of parallel hash plans. Observed in PG11–19 Beta 3; its last measured boot default is on in PG19 Beta 3, with user context. This is a beta-snapshot fact and can change before PostgreSQL 19 GA.

enable_partition_pruning

enable_partition_pruning — Enables plan-time and execution-time partition pruning. Observed in PG11–19 Beta 3; its last measured boot default is on in PG19 Beta 3, with user context. This is a beta-snapshot fact and can change before PostgreSQL 19 GA.

enable_partitionwise_aggregate

enable_partitionwise_aggregate — Enables partitionwise aggregation and grouping. Observed in PG11–19 Beta 3; its last measured boot default is off in PG19 Beta 3, with user context. This is a beta-snapshot fact and can change before PostgreSQL 19 GA.

enable_partitionwise_join

enable_partitionwise_join — Enables partitionwise join. Observed in PG11–19 Beta 3; its last measured boot default is off in PG19 Beta 3, with user context. This is a beta-snapshot fact and can change before PostgreSQL 19 GA.

enable_presorted_aggregate

enable_presorted_aggregate — Enables the planner’s ability to produce plans that provide presorted input for ORDER BY / DISTINCT aggregate functions. Observed in PG16–19 Beta 3; its last measured boot default is on in PG19 Beta 3, with user context. This is a beta-snapshot fact and can change before PostgreSQL 19 GA.

enable_self_join_elimination

enable_self_join_elimination — Enables removal of unique self-joins. Observed in PG18–19 Beta 3; its last measured boot default is on in PG19 Beta 3, with user context. This is a beta-snapshot fact and can change before PostgreSQL 19 GA.

enable_seqscan

enable_seqscan — Enables the planner’s use of sequential-scan plans. Observed in PG9.0–19 Beta 3; its last measured boot default is on in PG19 Beta 3, with user context. This is a beta-snapshot fact and can change before PostgreSQL 19 GA.

enable_sort

enable_sort — Enables the planner’s use of explicit sort steps. Observed in PG9.0–19 Beta 3; its last measured boot default is on in PG19 Beta 3, with user context. This is a beta-snapshot fact and can change before PostgreSQL 19 GA.

enable_tidscan

enable_tidscan — Enables the planner’s use of TID scan plans. Observed in PG9.0–19 Beta 3; its last measured boot default is on in PG19 Beta 3, with user context. This is a beta-snapshot fact and can change before PostgreSQL 19 GA.

from_collapse_limit

from_collapse_limit — Sets the FROM-list size beyond which subqueries are not collapsed. Observed in PG9.0–19 Beta 3; its last measured boot default is 8 in PG19 Beta 3, with user context. This is a beta-snapshot fact and can change before PostgreSQL 19 GA.

geqo

geqo — Enables genetic query optimization. Observed in PG9.0–19 Beta 3; its last measured boot default is on in PG19 Beta 3, with user context. This is a beta-snapshot fact and can change before PostgreSQL 19 GA.

geqo_effort

geqo_effort — GEQO: effort is used to set the default for other GEQO parameters. Observed in PG9.0–19 Beta 3; its last measured boot default is 5 in PG19 Beta 3, with user context. This is a beta-snapshot fact and can change before PostgreSQL 19 GA.

geqo_generations

geqo_generations — GEQO: number of iterations of the algorithm. Observed in PG9.0–19 Beta 3; its last measured boot default is 0 in PG19 Beta 3, with user context. This is a beta-snapshot fact and can change before PostgreSQL 19 GA.

geqo_pool_size

geqo_pool_size — GEQO: number of individuals in the population. Observed in PG9.0–19 Beta 3; its last measured boot default is 0 in PG19 Beta 3, with user context. This is a beta-snapshot fact and can change before PostgreSQL 19 GA.

geqo_seed

geqo_seed — GEQO: seed for random path selection. Observed in PG9.0–19 Beta 3; its last measured boot default is 0 in PG19 Beta 3, with user context. This is a beta-snapshot fact and can change before PostgreSQL 19 GA.

geqo_selection_bias

geqo_selection_bias — GEQO: selective pressure within the population. Observed in PG9.0–19 Beta 3; its last measured boot default is 2 in PG19 Beta 3, with user context. This is a beta-snapshot fact and can change before PostgreSQL 19 GA.

geqo_threshold

geqo_threshold — Sets the threshold of FROM items beyond which GEQO is used. Observed in PG9.0–19 Beta 3; its last measured boot default is 12 in PG19 Beta 3, with user context. This is a beta-snapshot fact and can change before PostgreSQL 19 GA.

jit

Allows PostgreSQL to use just-in-time compilation when the build provides a JIT implementation and the plan’s estimated cost crosses the configured thresholds. Enabling it does not force JIT for every query.

jit_above_cost

jit_above_cost — Perform JIT compilation if query is more expensive. Observed in PG11–19 Beta 3; its last measured boot default is 100000 in PG19 Beta 3, with user context. This is a beta-snapshot fact and can change before PostgreSQL 19 GA.

jit_inline_above_cost

jit_inline_above_cost — Perform JIT inlining if query is more expensive. Observed in PG11–19 Beta 3; its last measured boot default is 500000 in PG19 Beta 3, with user context. This is a beta-snapshot fact and can change before PostgreSQL 19 GA.

jit_optimize_above_cost

jit_optimize_above_cost — Optimize JIT-compiled functions if query is more expensive. Observed in PG11–19 Beta 3; its last measured boot default is 500000 in PG19 Beta 3, with user context. This is a beta-snapshot fact and can change before PostgreSQL 19 GA.

join_collapse_limit

join_collapse_limit — Sets the FROM-list size beyond which JOIN constructs are not flattened. Observed in PG9.0–19 Beta 3; its last measured boot default is 8 in PG19 Beta 3, with user context. This is a beta-snapshot fact and can change before PostgreSQL 19 GA.

min_eager_agg_group_size

min_eager_agg_group_size — Sets the minimum average group size required to consider applying eager aggregation. Observed in PG19 Beta 3; its last measured boot default is 8 in PG19 Beta 3, with user context. This is a beta-snapshot fact and can change before PostgreSQL 19 GA.

min_parallel_index_scan_size

min_parallel_index_scan_size — Sets the minimum amount of index data for a parallel scan. Observed in PG10–19 Beta 3; its last measured boot default is 512 KiB (64 × 8kB) in PG19 Beta 3, with user context. This is a beta-snapshot fact and can change before PostgreSQL 19 GA.

min_parallel_relation_size

min_parallel_relation_size — Sets the minimum size of relations to be considered for parallel scan. Observed in PG9.6; its last measured boot default is 8 MiB (1024 × 8kB) in PG9.6, with user context. It was removed in PG10.

min_parallel_table_scan_size

min_parallel_table_scan_size — Sets the minimum amount of table data for a parallel scan. Observed in PG10–19 Beta 3; its last measured boot default is 8 MiB (1024 × 8kB) in PG19 Beta 3, with user context. This is a beta-snapshot fact and can change before PostgreSQL 19 GA.

parallel_setup_cost

parallel_setup_cost — Sets the planner’s estimate of the cost of starting up worker processes for parallel query. Observed in PG9.6–19 Beta 3; its last measured boot default is 1000 in PG19 Beta 3, with user context. This is a beta-snapshot fact and can change before PostgreSQL 19 GA.

parallel_tuple_cost

parallel_tuple_cost — Sets the planner’s estimate of the cost of passing each tuple (row) from worker to leader backend. Observed in PG9.6–19 Beta 3; its last measured boot default is 0.1 in PG19 Beta 3, with user context. This is a beta-snapshot fact and can change before PostgreSQL 19 GA.

plan_cache_mode

plan_cache_mode — Controls the planner’s selection of custom or generic plan. Observed in PG12–19 Beta 3; its last measured boot default is auto in PG19 Beta 3, with user context. This is a beta-snapshot fact and can change before PostgreSQL 19 GA.

random_page_cost

A planner cost constant describing non-sequential page access relative to sequential access. Lowering it makes index and bitmap access paths look cheaper; it does not change storage behavior itself.

recursive_worktable_factor

recursive_worktable_factor — Sets the planner’s estimate of the average size of a recursive query’s working table. Observed in PG15–19 Beta 3; its last measured boot default is 10 in PG19 Beta 3, with user context. This is a beta-snapshot fact and can change before PostgreSQL 19 GA.

seq_page_cost

seq_page_cost — Sets the planner’s estimate of the cost of a sequentially fetched disk page. Observed in PG9.0–19 Beta 3; its last measured boot default is 1 in PG19 Beta 3, with user context. This is a beta-snapshot fact and can change before PostgreSQL 19 GA.