{"Entry":{"collection":"guc","key":"geqo_seed","name":"geqo_seed","aliases":[],"metadata":{"baseline":false,"boot_human":"Not specified","boot_val":null,"category":"Query Tuning / Genetic Query Optimizer","category_zh":"","changed_in":[],"changes":[{"documentation_changed":false,"fields":{},"from":"8.4","status":"added","to":"9.0"}],"content_hash":"f027e6b4466a045f22b09058095737c45e4f08e8718e66f2ddd6bc017dd20c96","context":"","default_changed_in":[],"default_history":[{"from":"9.0","to":"19","value":"0"}],"editorial":{"advice":{"olap":"For recurring many-table reports, test geqo_seed with multiple geqo_seed values and compare planning plus execution time. A single lucky seed is not a stable production policy.","oltp":"Keep geqo_seed 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_seed 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 seeds GEQO's random path selection. Changing it explores a different subset of join orders without changing table data or statistics.","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_seed","url":"https://www.postgresql.org/docs/19/runtime-config-query.html#GUC-GEQO-SEED"},{"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_seed — GEQO: seed for random path selection. Observed in PG9.0–19 Beta 4; its last measured boot default is 0 in PG19 Beta 4, with user context. This is a beta-snapshot fact and can change before PostgreSQL 19 GA."},"enumvals":[],"first_version":"9.0","group":"Query Tuning","group_slug":"query","imported_at":"2026-09-27T17:57:31.322639+08:00","intro_commit":{},"key":"geqo_seed","last_version":"20","max_val":"","min_val":"","name":"geqo_seed","position":157,"present_in":["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 initial value of the random number generator used by GEQO to select random paths through the join order search space.","short_desc_zh":"","source_rev":"english-manuals:bd5febf8db1ceb14db7b6fb8e8f839075b851c1c0bfdc85c5fb5af516cec5f43","unit":"","vartype":"real"}},"Definition":{"Collection":"guc","Key":"geqo_seed","SourceDatabase":"center","Version":"18","SourceTable":"guc","SourceKey":"geqo_seed","SourceRevision":"english-manuals:bd5febf8db1ceb14db7b6fb8e8f839075b851c1c0bfdc85c5fb5af516cec5f43","Facts":{"boot_val":"0","category":"Query Tuning / Genetic Query Optimizer","context":"user","description":"Controls the initial value of the random number generator used by GEQO to select random paths through the join order search space. The value can range from zero (the default) to one. Varying the value changes the set of join paths explored, and may result in a better or worse best path being found.","doc":{"anchor":"GUC-GEQO-SEED","file":"runtime-config-query.html","lang":"en","sha256":"33456ca7ef52bf28e93e34b932a411db7a1b95800179add2cf867dc6ec9144bc","slug":"18"},"documented":true,"enumvals":null,"extra_desc":null,"lang":"en","max_val":"1","metadata_version":"18","min_val":"0","name":"geqo_seed","short_desc":"GEQO: seed for random path selection.","source":"pg-settings-source-snapshot","unit":null,"vartype":"real"},"ManualEvidence":{"doc":{"anchor":"GUC-GEQO-SEED","file":"runtime-config-query.html","lang":"en","sha256":"33456ca7ef52bf28e93e34b932a411db7a1b95800179add2cf867dc6ec9144bc","slug":"18"}},"MeasuredEvidence":{"metadata_version":"18"}},"Text":{"Collection":"guc","Key":"geqo_seed","SourceDatabase":"center","Version":"18","Locale":"en","Title":"geqo_seed","Summary":"Controls the initial value of the random number generator used by GEQO to select random paths through the join order search space. The value can range from zero (the default) to one. Varying the value changes the set of join paths explored, and may result in a better or worse best path being found.","BodyHTML":"\u003cp\u003eControls the initial value of the random number generator used by GEQO to select random paths through the join order search space. The value can range from zero (the default) to one. Varying the value changes the set of join paths explored, and may result in a better or worse best path being found.\u003c/p\u003e","SourceRevision":"english-manuals:bd5febf8db1ceb14db7b6fb8e8f839075b851c1c0bfdc85c5fb5af516cec5f43","ContentHash":"1063b74b172dfbb4eb4edfc66125bebbc679cbd5591f9641a7316a09e531c7aa","Payload":{"description":"Controls the initial value of the random number generator used by GEQO to select random paths through the join order search space. The value can range from zero (the default) to one. Varying the value changes the set of join paths explored, and may result in a better or worse best path being found."}},"RequestedLocale":"zh-Hans","Fallback":true,"Versions":["10","11","12","13","14","15","16","17","18","19","20","9.0","9.1","9.2","9.3","9.4","9.5","9.6"],"Locales":["en"],"Signatures":null,"Spellings":null,"SQLState":null,"Evidence":null}
