{"Entry":{"collection":"guc","key":"segment_size","name":"segment_size","aliases":[],"metadata":{"baseline":false,"boot_human":"Not specified","boot_val":null,"category":"Preset Options","category_zh":"","changed_in":[],"changes":[{"documentation_changed":false,"fields":{},"from":"8.3","status":"added","to":"8.4"}],"content_hash":"b1fddbabd52caecdcab1890c181570000aa10155e1fd366df10beb88b4fb8571","context":"","default_changed_in":[],"default_history":[{"from":"9.0","to":"19","value":"1 GiB (131072 × 8kB)"}],"editorial":{"advice":{"olap":"Not tunable. Use segment_size to verify format, build, or resource assumptions on analytical nodes and keep every read/write candidate compatible.","oltp":"Not tunable. Record segment_size as a deployment/capability fact; if it is unexpected, fix the binary, initdb, or database-creation process rather than trying SET.","small":"Not tunable. Preserve it in inventory and incident reports; do not custom-build or rebuild merely to change it without a demonstrated compatibility need."},"mechanism":["Shows the number of pages per disk file. It is read-only and cannot be changed with SET or configuration-file edits.","It reports the number of database pages per relation segment; together with block_size it determines the file-segmentation boundary.","Interpret it with block_size, wal_block_size, wal_segment_size. Applications and operations tooling may read segment_size for capability or environment detection, but cannot SET it; cross-cluster comparisons must account for build, initdb, and current-database differences."],"pitfalls":["Trying to change read-only segment_size with SET or a configuration file.","Assuming every cluster, database, or vendor build reports the same value.","Ignoring the value in file-format or feature-compatibility checks.","Treating reported metadata as a performance target instead of an environment fact."],"references":[{"title":"PostgreSQL 19 Beta 4: segment_size","url":"https://www.postgresql.org/docs/19/runtime-config-preset.html#GUC-SEGMENT-SIZE"},{"title":"PostgreSQL 19 release notes","url":"https://www.postgresql.org/docs/19/release-19.html"}],"related":["block_size","wal_block_size","wal_segment_size","data_checksums","server_version_num","data_directory_mode"],"summary":"segment_size — Shows the number of pages per disk file. Observed in PG9.0–19 Beta 4; its last measured boot default is 1 GiB (131072 × 8kB) in PG19 Beta 4, with internal context. This is a beta-snapshot fact and can change before PostgreSQL 19 GA."},"enumvals":[],"first_version":"8.4","group":"Preset Options","group_slug":"preset","imported_at":"2026-09-27T17:57:31.93241+08:00","intro_commit":{},"key":"segment_size","last_version":"20","max_val":"","min_val":"","name":"segment_size","position":347,"present_in":["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":"Reports the number of blocks (pages) that can be stored within a file segment.","short_desc_zh":"","source_rev":"english-manuals:39f0ba5e5380e9d7c152f15b7a91f016dba0e4dd7fdb1f991fc3a13f46043df3","unit":"","vartype":"integer"}},"Definition":{"Collection":"guc","Key":"segment_size","SourceDatabase":"center","Version":"18","SourceTable":"guc","SourceKey":"segment_size","SourceRevision":"english-manuals:39f0ba5e5380e9d7c152f15b7a91f016dba0e4dd7fdb1f991fc3a13f46043df3","Facts":{"boot_val":"131072","category":"Preset Options","context":"internal","description":"Reports the number of blocks (pages) that can be stored within a file segment. It is determined by the value of RELSEG_SIZE when building the server. The maximum size of a segment file in bytes is equal to segment_size multiplied by block_size; by default this is 1GB.","doc":{"anchor":"GUC-SEGMENT-SIZE","file":"runtime-config-preset.html","lang":"en","sha256":"4dbfec727b9cee838adefb8a766217748d91ab90190b452a58cec737459582ce","slug":"18"},"documented":true,"enumvals":null,"extra_desc":null,"lang":"en","max_val":"131072","metadata_version":"18","min_val":"131072","name":"segment_size","short_desc":"Shows the number of pages per disk file.","source":"pg-settings-source-snapshot","unit":"8kB","vartype":"integer"},"ManualEvidence":{"doc":{"anchor":"GUC-SEGMENT-SIZE","file":"runtime-config-preset.html","lang":"en","sha256":"4dbfec727b9cee838adefb8a766217748d91ab90190b452a58cec737459582ce","slug":"18"}},"MeasuredEvidence":{"metadata_version":"18"}},"Text":{"Collection":"guc","Key":"segment_size","SourceDatabase":"center","Version":"18","Locale":"en","Title":"segment_size","Summary":"Reports the number of blocks (pages) that can be stored within a file segment. It is determined by the value of RELSEG_SIZE when building the server. The maximum size of a segment file in bytes is equal to segment_size multiplied by block_size; by default this is 1GB.","BodyHTML":"\u003cp\u003eReports the number of blocks (pages) that can be stored within a file segment. It is determined by the value of RELSEG_SIZE when building the server. The maximum size of a segment file in bytes is equal to segment_size multiplied by block_size; by default this is 1GB.\u003c/p\u003e","SourceRevision":"english-manuals:39f0ba5e5380e9d7c152f15b7a91f016dba0e4dd7fdb1f991fc3a13f46043df3","ContentHash":"94f900eb6121dfe7adfe94ad4ea5a4451c376d0feaa226c94c222debece496c1","Payload":{"description":"Reports the number of blocks (pages) that can be stored within a file segment. It is determined by the value of RELSEG_SIZE when building the server. The maximum size of a segment file in bytes is equal to segment_size multiplied by block_size; by default this is 1GB."}},"RequestedLocale":"zh-Hans","Fallback":true,"Versions":["10","11","12","13","14","15","16","17","18","19","20","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}
