{"Entry":{"collection":"guc","key":"geqo_effort","name":"geqo_effort","aliases":[],"metadata":{"baseline":true,"boot_human":"Not specified","boot_val":null,"category":"Query Tuning / Genetic Query Optimizer","category_zh":"","changed_in":[],"changes":[{"documentation_changed":true,"fields":{},"from":"7.4","status":"changed","to":"8.0"},{"documentation_changed":true,"fields":{},"from":"8.1","status":"changed","to":"8.2"},{"documentation_changed":true,"fields":{},"from":"8.3","status":"changed","to":"8.4"}],"content_hash":"2c417e801732b8dd7e39ae68941dbeddac7810aa926044d28a1c68c7564f0f33","context":"","default_changed_in":[],"default_history":[{"from":"9.0","to":"19","value":"5"}],"editorial":{"advice":{"olap":"For recurring many-table reports, test geqo_effort with multiple geqo_seed values and compare planning plus execution time. A single lucky seed is not a stable production policy.","oltp":"Keep geqo_effort at its upstream default unless planning time for many-way joins is measured as a problem. Prefer simplifying generated SQL or fixing join estimates before expanding a randomized search budget globally.","small":"Avoid increasing geqo_effort in ways that consume disproportionate planning CPU on a small host. The default adaptive values are safer than copying a large-system GEQO budget."},"mechanism":["It is a convenience knob from 1 to 10 that derives defaults for pool size and generations; it has no direct step in the genetic algorithm.","GEQO trades bounded planning time for a heuristic search that can miss the best join order. It still costs scan and join paths with the ordinary planner cost model after constructing candidates.","The setting is read during planning, and GEQO's randomized search means plan quality can vary with seed and search budget. Collapse limits can change the number of relations exposed to the join search and therefore whether the threshold is crossed. Its user context permits session- or transaction-local changes; newly performed or newly planned work sees the value."],"pitfalls":["Judging plan quality from one randomized GEQO run.","Changing a GEQO knob without accounting for geqo_threshold and collapse limits.","Spending much more planning CPU for a marginal or unstable execution-time gain.","Assuming GEQO guarantees the globally best join order."],"references":[{"title":"PostgreSQL 19 Beta 4: geqo_effort","url":"https://www.postgresql.org/docs/19/runtime-config-query.html#GUC-GEQO-EFFORT"},{"title":"PostgreSQL 19 release notes","url":"https://www.postgresql.org/docs/19/release-19.html"}],"related":["geqo","geqo_pool_size","geqo_generations","geqo_selection_bias","geqo_threshold"],"summary":"geqo_effort — GEQO: effort is used to set the default for other GEQO parameters. Observed in PG9.0–19 Beta 4; its last measured boot default is 5 in PG19 Beta 4, with user context. This is a beta-snapshot fact and can change before PostgreSQL 19 GA."},"enumvals":[],"first_version":"7.4","group":"Query Tuning","group_slug":"query","imported_at":"2026-09-27T17:57:31.3082+08:00","intro_commit":{},"key":"geqo_effort","last_version":"20","max_val":"","min_val":"","name":"geqo_effort","position":154,"present_in":["7.4","8.0","8.1","8.2","8.3","8.4","9.0","9.1","9.2","9.3","9.4","9.5","9.6","10","11","12","13","14","15","16","17","18","19","20"],"short_desc":"Controls the trade-off between planning time and query plan quality in GEQO.","short_desc_zh":"","source_rev":"english-manuals:8915f6d289dada2fe9267662948966df97577438290d21f2ceea404aeb5661e3","unit":"","vartype":"integer"}},"Definition":{"Collection":"guc","Key":"geqo_effort","SourceDatabase":"center","Version":"18","SourceTable":"guc","SourceKey":"geqo_effort","SourceRevision":"english-manuals:8915f6d289dada2fe9267662948966df97577438290d21f2ceea404aeb5661e3","Facts":{"boot_val":"5","category":"Query Tuning / Genetic Query Optimizer","context":"user","description":"Controls the trade-off between planning time and query plan quality in GEQO. This variable must be an integer in the range from 1 to 10. The default value is five. Larger values increase the time spent doing query planning, but also increase the likelihood that an efficient query plan will be chosen. geqo_effort doesn't actually do anything directly; it is only used to compute the default values for the other variables that influence GEQO behavior (described below). If you prefer, you can set the other parameters by hand instead.","doc":{"anchor":"GUC-GEQO-EFFORT","file":"runtime-config-query.html","lang":"en","sha256":"33456ca7ef52bf28e93e34b932a411db7a1b95800179add2cf867dc6ec9144bc","slug":"18"},"documented":true,"enumvals":null,"extra_desc":null,"lang":"en","max_val":"10","metadata_version":"18","min_val":"1","name":"geqo_effort","short_desc":"GEQO: effort is used to set the default for other GEQO parameters.","source":"pg-settings-source-snapshot","unit":null,"vartype":"integer"},"ManualEvidence":{"doc":{"anchor":"GUC-GEQO-EFFORT","file":"runtime-config-query.html","lang":"en","sha256":"33456ca7ef52bf28e93e34b932a411db7a1b95800179add2cf867dc6ec9144bc","slug":"18"}},"MeasuredEvidence":{"metadata_version":"18"}},"Text":{"Collection":"guc","Key":"geqo_effort","SourceDatabase":"center","Version":"18","Locale":"en","Title":"geqo_effort","Summary":"Controls the trade-off between planning time and query plan quality in GEQO. This variable must be an integer in the range from 1 to 10. The default value is five. Larger values increase the time spent doing query planning, but also increase the likelihood that an efficient query plan will be chosen. geqo_effort doesn't actually do anything directly; it is only used to compute the default values for the other variables that influence GEQO behavior (described below). If you prefer, you can set the other parameters by hand instead.","BodyHTML":"\u003cp\u003eControls the trade-off between planning time and query plan quality in GEQO. This variable must be an integer in the range from 1 to 10. The default value is five. Larger values increase the time spent doing query planning, but also increase the likelihood that an efficient query plan will be chosen. geqo_effort doesn\u0026#39;t actually do anything directly; it is only used to compute the default values for the other variables that influence GEQO behavior (described below). If you prefer, you can set the other parameters by hand instead.\u003c/p\u003e","SourceRevision":"english-manuals:8915f6d289dada2fe9267662948966df97577438290d21f2ceea404aeb5661e3","ContentHash":"90ff671981857cfdebd0a1cf855fd0d05aba3c973c552aa5aa200780175bbb14","Payload":{"description":"Controls the trade-off between planning time and query plan quality in GEQO. This variable must be an integer in the range from 1 to 10. The default value is five. Larger values increase the time spent doing query planning, but also increase the likelihood that an efficient query plan will be chosen. geqo_effort doesn't actually do anything directly; it is only used to compute the default values for the other variables that influence GEQO behavior (described below). If you prefer, you can set the other parameters by hand instead."}},"RequestedLocale":"zh-Hans","Fallback":true,"Versions":["10","11","12","13","14","15","16","17","18","19","20","7.4","8.0","8.1","8.2","8.3","8.4","9.0","9.1","9.2","9.3","9.4","9.5","9.6"],"Locales":["en"],"Signatures":null,"Spellings":null,"SQLState":null,"Evidence":null}
