Skip to content

2.29.0.0-b155

@pao214 pao214 tagged this 07 Nov 18:35
Summary:
To improve the default user experience, automatically set default values for two dependent GUCs when the CBO is enabled or disabled.

**Behavior:**

This change provides new default values for CBO-related GUCs only if they are **NOT** explicitly set by the user (e.g., in postgresql.conf, via ALTER ROLE/DATABASE, or with a session SET command, etc).

When yb_enable_cbo is set to on:

- yb_enable_bitmapscan defaults to on (enable bitmap scan)
- yb_parallel_range_rows defaults to 10000 (enable parallel query)

When yb_enable_cbo is set to off (or legacy):

The GUCs above are reset to their built-in defaults
- yb_enable_bitmapscan defaults to off
- yb_parallel_range_rows defaults to 0

**Implementation:**

This is implemented using the PGC_S_DYNAMIC_DEFAULT GUC source. This is a critical design choice because it means these settings have the lowest possible priority. Any explicit value set by a user will always take precedence and will not be overridden by this logic.
Jira: DB-18844

Test Plan:
Jenkins

./yb_build.sh --cxx-test pg_cbo_dependent_flags-test

Backport-through: 2025.2

Close: #29081

Reviewers: smishra, gkukreja, mtakahara, yguan, sanketh

Reviewed By: gkukreja, mtakahara

Subscribers: mtakahara, jason, yql

Differential Revision: https://phorge.dev.yugabyte.com/D47999
Assets 2
Loading