Configuration parameter

geqo_generations — PostgreSQL configuration parameter

Category Query Planning

Controls the number of generations used by GEQO, that is the number of iterations of the algorithm.

At a glance

Property Value
Parameter geqo_generations
Category Query Planning
Default (see documentation)
Value type integer
Change scope Per-session (SET)
Available in PostgreSQL 12, 13, 14, 15, 16, 17, 18, 19 (added in 12)

What it does

Controls the number of generations used by GEQO, that is the number of iterations of the algorithm. It must be at least one, and useful values are in the same range as the pool size. If it is set to zero (the default setting) then a suitable value is chosen based on geqo_pool_size.

(Description quoted from the official PostgreSQL documentation.)

How to apply a change

Can be set per session with SET, per role/database with ALTER ROLE/DATABASE ... SET, or globally in postgresql.conf.

Inspect the current value and source with SHOW geqo_generations; or SELECT name, setting, unit, context, source FROM pg_settings WHERE name = 'geqo_generations';.

Tuning guidance

This parameter is rarely a performance lever. Leave it at the default unless you have a specific, documented reason to change it, change it on one session or one role/database first, and confirm the effect with pg_settings and your own measurements before rolling it out cluster-wide.

Reference

PostgreSQL documentation — geqo_generations.

Keep going

Related & next steps

Was this helpful?

← All configuration parameters