{"Entry":{"collection":"guc","key":"seq_page_cost","name":"seq_page_cost","aliases":[],"metadata":{"baseline":false,"boot_human":"Not specified","boot_val":null,"category":"Query Tuning / Planner Cost Constants","category_zh":"","changed_in":[],"changes":[{"documentation_changed":false,"fields":{},"from":"8.1","status":"added","to":"8.2"},{"documentation_changed":true,"fields":{},"from":"8.4","status":"changed","to":"9.0"},{"documentation_changed":true,"fields":{},"from":"9.1","status":"changed","to":"9.2"}],"content_hash":"652af22974eb6b753e472e4090dfddd43169da1dab0d98310078ab1ec14ab22b","context":"","default_changed_in":[],"default_history":[{"from":"9.0","to":"19","value":"1"}],"editorial":{"advice":{"olap":"Analytical workloads can justify a different CPU-versus-I/O balance, but change seq_page_cost together with the related cost model and validate the full scan/join/aggregate mix.","oltp":"Calibrate seq_page_cost only from a representative workload, not one plan. First correct stale statistics and compare EXPLAIN (ANALYZE, BUFFERS) estimates with reality; use role or tablespace scope where possible.","small":"Keep the upstream value unless repeated evidence shows a systematic modeling error. On small systems, concurrency and cache residency often matter more than fine-grained changes to seq_page_cost."},"mechanism":["seq_page_cost models a sequential page fetch and the conventional base of the planner's arbitrary cost scale. It is one term in estimated path cost and does not allocate resources or change executor behavior directly.","Planner cost units are arbitrary and only their ratios matter. Scaling all cost constants together leaves path ordering unchanged; changing one alters the balance between I/O, row processing, operators, and parallel overhead.","The value is consulted when a plan is built. Statistics, row-count estimates, cache assumptions, tablespace overrides, and enabled plan methods can outweigh a small change in this constant. Its user context permits session- or transaction-local changes; newly performed or newly planned work sees the value."],"pitfalls":["Interpreting the value as elapsed time or a hard resource limit.","Tuning it to repair one query and regressing the wider workload.","Changing cost constants before correcting statistics and cardinality estimates.","Forgetting that only relative values influence path choice."],"references":[{"title":"PostgreSQL 19 Beta 4: seq_page_cost","url":"https://www.postgresql.org/docs/19/runtime-config-query.html#GUC-SEQ-PAGE-COST"},{"title":"PostgreSQL 19 release notes","url":"https://www.postgresql.org/docs/19/release-19.html"}],"related":["random_page_cost","cpu_tuple_cost","effective_cache_size","enable_seqscan","effective_io_concurrency"],"summary":"seq_page_cost — Sets the planner's estimate of the cost of a sequentially fetched disk page. Observed in PG9.0–19 Beta 4; its last measured boot default is 1 in PG19 Beta 4, with user context. This is a beta-snapshot fact and can change before PostgreSQL 19 GA."},"enumvals":[],"first_version":"8.2","group":"Query Tuning","group_slug":"query","imported_at":"2026-09-27T17:57:31.939821+08:00","intro_commit":{},"key":"seq_page_cost","last_version":"20","max_val":"","min_val":"","name":"seq_page_cost","position":350,"present_in":["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":"Sets the planner's estimate of the cost of a disk page fetch that is part of a series of sequential fetches.","short_desc_zh":"","source_rev":"english-manuals:0d33a7232416c9f9082c0cc52c2219d39e7145102c5c67619721f11b5d91b8b8","unit":"","vartype":"real"}},"Definition":{"Collection":"guc","Key":"seq_page_cost","SourceDatabase":"center","Version":"18","SourceTable":"guc","SourceKey":"seq_page_cost","SourceRevision":"english-manuals:0d33a7232416c9f9082c0cc52c2219d39e7145102c5c67619721f11b5d91b8b8","Facts":{"boot_val":"1","category":"Query Tuning / Planner Cost Constants","context":"user","description":"Sets the planner's estimate of the cost of a disk page fetch that is part of a series of sequential fetches. The default is 1.0. This value can be overridden for tables and indexes in a particular tablespace by setting the tablespace parameter of the same name (see ALTER TABLESPACE).","doc":{"anchor":"GUC-SEQ-PAGE-COST","file":"runtime-config-query.html","lang":"en","sha256":"33456ca7ef52bf28e93e34b932a411db7a1b95800179add2cf867dc6ec9144bc","slug":"18"},"documented":true,"enumvals":null,"extra_desc":null,"lang":"en","max_val":"1.79769e+308","metadata_version":"18","min_val":"0","name":"seq_page_cost","short_desc":"Sets the planner's estimate of the cost of a sequentially fetched disk page.","source":"pg-settings-source-snapshot","unit":null,"vartype":"real"},"ManualEvidence":{"doc":{"anchor":"GUC-SEQ-PAGE-COST","file":"runtime-config-query.html","lang":"en","sha256":"33456ca7ef52bf28e93e34b932a411db7a1b95800179add2cf867dc6ec9144bc","slug":"18"}},"MeasuredEvidence":{"metadata_version":"18"}},"Text":{"Collection":"guc","Key":"seq_page_cost","SourceDatabase":"pgweb","Version":"18","Locale":"zh-Hans","Title":"seq_page_cost","Summary":"","BodyHTML":"\u003cp\u003e设置规划器对一系列顺序磁盘页面读取中单次读取的代价估计。默认值是 1.0。对于某个表空间内的表和索引，可以通过设置该表空间的同名参数来覆盖此值（见\u003ca href=\"/docs/18/sql-altertablespace.html\" title=\"ALTER TABLESPACE\" rel=\"nofollow\"\u003e\u003cspan\u003eALTER TABLESPACE\u003c/span\u003e\u003c/a\u003e）。\u003c/p\u003e","SourceRevision":"2026-09-11@29c86d9","ContentHash":"ae06c70e016a0d973b4a909e0c9f0c92ff0348c0803457a149bad0e5e3b0191b","Payload":{"carried_from":"","carry_reason":"","doc_html":"\u003cp\u003e设置规划器对一系列顺序磁盘页面读取中单次读取的代价估计。默认值是 1.0。对于某个表空间内的表和索引，可以通过设置该表空间的同名参数来覆盖此值（见\u003ca href=\"/docs/18/sql-altertablespace.html\" title=\"ALTER TABLESPACE\"\u003e\u003cspan class=\"refentrytitle\"\u003eALTER TABLESPACE\u003c/span\u003e\u003c/a\u003e）。\u003c/p\u003e","doc_same_as":""}},"RequestedLocale":"zh-Hans","Fallback":false,"Versions":["10","11","12","13","14","15","16","17","18","19","20","8.2","8.3","8.4","9.0","9.1","9.2","9.3","9.4","9.5","9.6"],"Locales":["en","zh-Hans"],"Signatures":null,"Spellings":null,"SQLState":null,"Evidence":null}
