Skip to content

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.
Note

Fact — official short description: “Sets the planner’s estimate of the fraction of a cursor’s rows that will be retrieved.”

Identity

Type , Valuereal
Upstream pg_settings type
Context , Valueuser
Settable by an ordinary user
Unit , Value—
Raw unit
Range , Value0 – 1
Raw limits in the last observed version
Enum values , Value—
— for non-enum types
Category , ValueQuery Tuning / Other Planner Options
Upstream classification
Latest boot value , Value0.1
0.1

Lifecycle

Fact Value
First observed PG9.0 (research boundary)
Present in PG9.0–19 Beta 3
Removed in No
Introduction commit Not asserted: predates the PG9.0 research boundary
Commit date —
Discussion —

Default history

Measured PG9.0–19 Beta 3 boot defaults
Versions Raw boot_val Unit Human value
PG9.0–19 Beta 3 0.1 — 0.1

How it works

cursor_tuple_fraction tells the planner what fraction of a cursor’s result is expected to be fetched. Lower fractions give more weight to startup cost; 1.0 plans like an ordinary query that consumes the full result.

The estimate can change join order and access paths by preferring a fast first row even when total execution would be slower. It does not stop FETCH after that fraction and is not a row limit.

It is consulted at planning time for cursor plans. Application behavior matters: cursors used for pagination, early exit, or full export have very different appropriate fractions. Its user context permits session- or transaction-local changes; newly performed or newly planned work sees the value.

Tuning advice

Tip

Advice. These are workload-specific starting points and must be validated with measurements.

Workload Guidance
OLTP Keep cursor_tuple_fraction at its upstream default unless representative plans show a repeatable, workload-wide problem. Test a local override first and include planning latency as well as execution latency.
OLAP Analytical SQL can make cursor_tuple_fraction more visible because joins, cursors, or recursion are larger. Benchmark the full statement family and inspect estimates rather than copying a single successful value.
Small nodes On a small host, avoid increasing planning search or memory pressure through cursor_tuple_fraction without a measured benefit. Prefer query-local structure or a scoped role setting over a cluster-wide override.

Pigsty

Values use the fixed 8-vCPU, 32-GiB, 100-GiB SSD fixture and render the current Pigsty templates for PG19 Beta 3; this does not assert current Pigsty support for that historical or beta release.

Template Effective value Versus upstream boot Source expression
OLTP Unmodified — —
OLAP Unmodified — —
CRIT Unmodified — —
TINY Unmodified — —
Caution

Advice — pending human review. Fact from the current Pigsty template projection: OLTP: PG9.0–19 Beta 3 unmodified; OLAP: PG9.0–19 Beta 3 unmodified; CRIT: PG9.0–19 Beta 3 unmodified; TINY: PG9.0–19 Beta 3 unmodified. No Pigsty-specific rationale is inferred from an absent override.

Common pitfalls

  • Treating cursor_tuple_fraction as an executor resource limit rather than a planning assumption or policy.
  • Testing only one parameter set or one data distribution.
  • Expecting an already cached plan to be rewritten automatically.
  • Using a global override to hide stale statistics or fragile SQL structure.

plan_cache_mode · random_page_cost · enable_nestloop · enable_indexscan

References