# segment_size

> segment_size — Shows the number of pages per disk file. Observed in PG9.0–19 Beta 3; its last measured boot default is 1 GiB (131072 × 8kB) in PG19 Beta 3, with internal context. This is a beta-snapshot fact and can change before PostgreSQL 19 GA.
---

> [!NOTE]
> **Fact — official short description:** “Shows the number of pages per disk file.”

## Identity {#identity}

| Field | Value | Meaning |
| --- | --- | --- |
| Type | `integer` | Upstream pg_settings type |
| Context | `internal` | Internal/preset and not user-settable |
| Unit | `8kB` | Raw unit |
| Range | `131072` – `131072` | Raw limits in the last observed version |
| Enum values | — | — for non-enum types |
| Category | Preset Options | Upstream classification |
| Latest boot value | `131072` | 1 GiB (131072 × 8kB) |
{.fields meta="-"}

## Lifecycle {#lifecycle}

| Fact | Value |
| --- | --- |
| First observed | PG9.0 (research boundary) |
| Present in | PG9.0–19 Beta 3 |
| Removed in | No |
| Introduction commit | Not asserted: predates the PG9.0 research boundary |
| Commit date | — |
| Discussion | — |

## Default history {#default-history}

| Versions | Raw `boot_val` | Unit | Human value |
| --- | --- | --- | --- |
| PG9.0–19 Beta 3 | `131072` | `8kB` | 1 GiB (131072 × 8kB) |
{.full-width caption="Measured PG9.0–19 Beta 3 boot defaults"}

## How it works {#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.

## Tuning advice {#tuning-advice}

> [!TIP]
> **Advice.** These are workload-specific starting points and must be validated with measurements.

| Workload | Guidance |
| --- | --- |
| 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. |
| OLAP | Not tunable. Use segment_size to verify format, build, or resource assumptions on analytical nodes and keep every read/write candidate compatible. |
| Small nodes | Not tunable. Preserve it in inventory and incident reports; do not custom-build or rebuild merely to change it without a demonstrated compatibility need. |
{.full-width}

## Pigsty {#pigsty}

Values use the fixed 8-vCPU, 32-GiB, 100-GiB SSD fixture and render the current Pigsty templates for PG19 Beta 3; this does not assert current Pigsty support for that historical or beta release.

| Template | Effective value | Versus upstream boot | Source expression |
| --- | --- | --- | --- |
| OLTP | Unmodified | — | — |
| OLAP | Unmodified | — | — |
| CRIT | Unmodified | — | — |
| TINY | Unmodified | — | — |
{.full-width}

> [!CAUTION]
> **Advice — pending human review.** Fact from the current Pigsty template projection: OLTP: PG9.0–19 Beta 3 unmodified; OLAP: PG9.0–19 Beta 3 unmodified; CRIT: PG9.0–19 Beta 3 unmodified; TINY: PG9.0–19 Beta 3 unmodified. No Pigsty-specific rationale is inferred from an absent override.

## Common pitfalls {#common-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.

## Related parameters {#related-parameters}

[`block_size`](/parameters/block-size/) · [`wal_block_size`](/parameters/wal-block-size/) · [`wal_segment_size`](/parameters/wal-segment-size/) · [`data_checksums`](/parameters/data-checksums/) · [`server_version_num`](/parameters/server-version-num/) · [`data_directory_mode`](/parameters/data-directory-mode/)

## References {#references}

- [PostgreSQL 19 Beta 3 — segment_size](https://www.postgresql.org/docs/19/runtime-config-preset.html#GUC-SEGMENT-SIZE)
- [PostgreSQL 19 release notes](https://www.postgresql.org/docs/19/release-19.html)
- [Machine-readable GUC export](/data/guc.jsonl)
