{"schema": "pgtrue.report/1", "url": "https://pgtrue.postgres.ai/shared/brief/b1a851b2-7f6f-4325-8d97-20b57474b31c", "published": "2026-10-21T05:01:05Z", "publisher": "PostgresAI", "article": {"title": "Cutting a Production PostgreSQL Database\u2019s WAL Generation by ~25%: A Diagnostic Story", "url": "https://stormatics.tech/blogs/cutting-postgresql-wal-by-25-percent", "date_published": "2026-08-14T14:34:54Z", "author": "Uche Nnodim", "publisher": "Stormatics"}, "grade": "C+", "axes": [{"axis": "Factual", "summary": "B- \u00b7 3 wrong of 20 checked \u00b7 2 caveats \u00b7 partly assessed"}, {"axis": "Applicable", "summary": "B+ \u00b7 1 wrong of 7 checked \u00b7 0 caveats"}, {"axis": "Consistent", "summary": "A \u00b7 0 wrong of 20 checked \u00b7 0 caveats"}, {"axis": "Transparent", "summary": "C \u00b7 0 wrong of 9 checked \u00b7 1 caveat \u00b7 reproducibility: C (no hardware)"}, {"axis": "Safe", "summary": "D \u00b7 2 wrong of 5 checked \u00b7 0 caveats \u00b7 partly assessed"}], "findings": [{"anchor": "F5", "url": "https://pgtrue.postgres.ai/shared/brief/b1a851b2-7f6f-4325-8d97-20b57474b31c#F5", "claim": "\u202639% of all WAL records were full-page images.", "title": "wal_fpi divided by wal_records is not a percentage of records containing images", "explanation": "wal_fpi counts images. One WAL record can contain multiple images. src/backend/access/transam/xloginsert.c:589 loops over registered blocks, and line 704 increments the image count. A quotient of 0.39 means 0.39 images per record. It establishes neither a 39% record share nor a byte share.", "verdict": "False", "sources": [{"url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/doc/src/sgml/monitoring.sgml#L3246-L3321", "label": "REL_18_6 \u00b7 doc/src/sgml/monitoring.sgml:3246-3321"}, {"url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/access/transam/xloginsert.c#L585-L625", "label": "REL_18_6 \u00b7 src/backend/access/transam/xloginsert.c:585-625"}, {"url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/access/transam/xloginsert.c#L703-L704", "label": "REL_18_6 \u00b7 src/backend/access/transam/xloginsert.c:703-704"}]}, {"anchor": "F1", "url": "https://pgtrue.postgres.ai/shared/brief/b1a851b2-7f6f-4325-8d97-20b57474b31c#F1", "claim": "A no-op guard added to an update that was previously unconditional:\u2026", "title": "The no-op guard compares columns the UPDATE does not assign", "explanation": "The guard tests type, but SET changes username and location. Equal arrays can suppress needed changes to either assigned column. Different arrays can permit unchanged assignments. UPDATE applies only where its condition is true. See doc/src/sgml/ref/update.sgml:192-194.", "verdict": "Dangerous", "sources": [{"url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/doc/src/sgml/ref/update.sgml#L41-L44", "label": "REL_18_6 \u00b7 doc/src/sgml/ref/update.sgml:41-44"}, {"url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/doc/src/sgml/ref/update.sgml#L192-L194", "label": "REL_18_6 \u00b7 doc/src/sgml/ref/update.sgml:192-194"}]}, {"anchor": "F16", "url": "https://pgtrue.postgres.ai/shared/brief/b1a851b2-7f6f-4325-8d97-20b57474b31c#F16", "claim": "\u2026array(SELECT unnest(\"type\") ORDER BY 1) IS DISTINCT FROM array(SELECT unnest($4::text[]) ORDER BY 1)\u2026", "title": "The no-op guard compares a column the UPDATE does not assign", "explanation": "Equal type arrays suppress changes to username or location. Different arrays permit unchanged scalar assignments. PostgreSQL 18.6 documents conditional updates in doc/src/sgml/ref/update.sgml:41. The guard can silently skip intended updates.", "verdict": "Dangerous", "sources": [{"url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/doc/src/sgml/ref/update.sgml#L37-L44", "label": "REL_18_6 \u00b7 doc/src/sgml/ref/update.sgml:37-44"}]}, {"anchor": "F3", "url": "https://pgtrue.postgres.ai/shared/brief/b1a851b2-7f6f-4325-8d97-20b57474b31c#F3", "claim": "\u2026update mechanism lets a row be updated in place, without touching a single index\u2026", "title": "Free page space alone does not permit HOT updates", "explanation": "HOT creates a new tuple version on the same page. Changes to columns referenced by HOT-blocking indexes prevent it. Summarizing indexes can still require updates. src/backend/access/heap/heapam.c:4116-4135 checks both conditions. Lower fillfactor cannot remove the indexed-column restriction.", "verdict": "Misleading", "sources": [{"url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/access/heap/heapam.c#L4116-L4135", "label": "REL_18_6 \u00b7 src/backend/access/heap/heapam.c:4116-4135"}, {"url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/doc/src/sgml/ref/create_table.sgml#L1593-L1606", "label": "REL_18_6 \u00b7 doc/src/sgml/ref/create_table.sgml:1593-1606"}]}, {"anchor": "F4", "url": "https://pgtrue.postgres.ai/shared/brief/b1a851b2-7f6f-4325-8d97-20b57474b31c#F4", "claim": "\u2026leaving zero room for this optimization.", "title": "Default fillfactor does not leave zero opportunity for HOT", "explanation": "Fillfactor 100 reserves no insertion space specifically for updates. HOT updates can still use available page space. doc/src/sgml/storage.sgml:1142-1147 explicitly describes HOT occurring without reducing fillfactor. Treating the default as disabling HOT can prompt unnecessary table rewrites.", "verdict": "Misleading", "sources": [{"url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/doc/src/sgml/storage.sgml#L1142-L1147", "label": "REL_18_6 \u00b7 doc/src/sgml/storage.sgml:1142-1147"}, {"url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/doc/src/sgml/ref/create_table.sgml#L1593-L1606", "label": "REL_18_6 \u00b7 doc/src/sgml/ref/create_table.sgml:1593-1606"}]}, {"anchor": "F7", "url": "https://pgtrue.postgres.ai/shared/brief/b1a851b2-7f6f-4325-8d97-20b57474b31c#F7", "claim": "\u2026AS pct_volume_based\u2026", "title": "Requested checkpoints are not exclusively volume-triggered checkpoints", "explanation": "The requested counter includes checkpoint requests beyond WAL-volume triggers. SQL CHECKPOINT calls RequestCheckpoint in src/backend/tcop/utility.c:955-956. The checkpointer counts requested checkpoints at src/backend/postmaster/checkpointer.c:438-445. The alias pct_volume_based overstates what this ratio establishes.", "verdict": "Misleading", "sources": [{"url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/doc/src/sgml/monitoring.sgml#L3126-L3144", "label": "REL_18_6 \u00b7 doc/src/sgml/monitoring.sgml:3126-3144"}, {"url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/postmaster/checkpointer.c#L438-L445", "label": "REL_18_6 \u00b7 src/backend/postmaster/checkpointer.c:438-445"}, {"url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/tcop/utility.c#L955-L956", "label": "REL_18_6 \u00b7 src/backend/tcop/utility.c:955-956"}]}, {"anchor": "F2", "url": "https://pgtrue.postgres.ai/shared/brief/b1a851b2-7f6f-4325-8d97-20b57474b31c#F2", "claim": "\u2026shifting the checkpoint trigger from a fixed timer to a volume-based one (max_wal_size)\u2026", "explanation": "The recommendation can mean making WAL volume the dominant checkpoint trigger. It omits checkpoint_timeout, which must also be evaluated. PostgreSQL checks elapsed time independently in src/backend/postmaster/checkpointer.c:390. Increasing max_wal_size alone cannot extend an unchanged five-minute timeout.", "verdict": "Mostly accurate", "sources": [{"url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/postmaster/checkpointer.c#L388-L396", "label": "REL_18_6 \u00b7 src/backend/postmaster/checkpointer.c:388-396"}, {"url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/doc/src/sgml/config.sgml#L3698-L3703", "label": "REL_18_6 \u00b7 doc/src/sgml/config.sgml:3698-3703"}, {"url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/doc/src/sgml/config.sgml#L3795-L3800", "label": "REL_18_6 \u00b7 doc/src/sgml/config.sgml:3795-3800"}]}, {"anchor": "F6", "url": "https://pgtrue.postgres.ai/shared/brief/b1a851b2-7f6f-4325-8d97-20b57474b31c#F6", "claim": "\u2026SELECT buffers_clean, buffers_backend, buffers_checkpoint,\u2026", "title": "The statistics queries require a PostgreSQL version qualifier", "explanation": "PostgreSQL 16.4 exposes these checkpoint and backend-write counters in pg_stat_bgwriter. PostgreSQL 18.6 does not. Its view has four columns, and checkpoint counts reside in pg_stat_checkpointer. See src/backend/catalog/system_views.sql:1150-1160. Without a version qualifier, copying either diagnostic can produce a missing-column error.", "verdict": "Mostly accurate", "sources": [{"url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/catalog/system_views.sql#L1150-L1170", "label": "REL_18_6 \u00b7 src/backend/catalog/system_views.sql:1150-1170"}, {"url": "https://github.com/postgres/postgres/blob/2caa85f4aae689e6f6721d7363b4c66a2a6417d6/src/backend/catalog/system_views.sql#L1108-L1120", "label": "REL_16_4 \u00b7 src/backend/catalog/system_views.sql:1108-1120"}]}, {"anchor": "F17", "url": "https://pgtrue.postgres.ai/shared/brief/b1a851b2-7f6f-4325-8d97-20b57474b31c#F17", "claim": "\u2026checkpoints would fire based on how much data had genuinely changed, not on a clock\u2026", "explanation": "Volume-triggered checkpoints can dominate while the timer remains active. The article omits the checkpoint_timeout setting needed to explain longer timer intervals. src/backend/postmaster/checkpointer.c:390 checks elapsed time independently. Changing max_wal_size alone leaves an unchanged five-minute timeout in force.", "verdict": "Mostly accurate", "sources": [{"url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/postmaster/checkpointer.c#L380-L396", "label": "REL_18_6 \u00b7 src/backend/postmaster/checkpointer.c:380-396"}]}, {"anchor": "F8", "url": "https://pgtrue.postgres.ai/shared/brief/b1a851b2-7f6f-4325-8d97-20b57474b31c#F8", "claim": "\u2026bgwriter_lru_maxpages , the setting controlling how many pages the background writer can clean per cycle\u2026", "title": "bgwriter_lru_maxpages caps background-writer writes per round", "explanation": "The parameter caps buffers written during each background-writer round. Its default is 100 buffers. It does not control checkpoint writes. src/backend/storage/buffer/bufmgr.c:3878-3882 stops the scan when the write count reaches the cap.", "verdict": "Accurate", "sources": [{"url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/doc/src/sgml/config.sgml#L2565-L2582", "label": "REL_18_6 \u00b7 doc/src/sgml/config.sgml:2565-2582"}, {"url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/storage/buffer/bufmgr.c#L3878-L3882", "label": "REL_18_6 \u00b7 src/backend/storage/buffer/bufmgr.c:3878-3882"}]}, {"anchor": "F9", "url": "https://pgtrue.postgres.ai/shared/brief/b1a851b2-7f6f-4325-8d97-20b57474b31c#F9", "claim": "We tightened the autovacuum_vacuum_scale_factor on both\u2026", "title": "Reducing the vacuum scale factor lowers the size-dependent threshold", "explanation": "autovacuum_vacuum_scale_factor contributes table size multiplied by the scale factor to the vacuum threshold. Reducing it can trigger vacuum sooner. src/backend/postmaster/autovacuum.c:3100-3142 computes that threshold and applies its maximum. This mechanism does not independently verify the reported improvement.", "verdict": "Accurate", "sources": [{"url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/doc/src/sgml/config.sgml#L9122-L9141", "label": "REL_18_6 \u00b7 doc/src/sgml/config.sgml:9122-9141"}, {"url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/postmaster/autovacuum.c#L3100-L3142", "label": "REL_18_6 \u00b7 src/backend/postmaster/autovacuum.c:3100-3142"}]}, {"anchor": "F10", "url": "https://pgtrue.postgres.ai/shared/brief/b1a851b2-7f6f-4325-8d97-20b57474b31c#F10", "claim": "HOT-update ratio, checked before and after applying fillfactor:\u2026", "title": "The table-statistics formulas use the expected counters", "explanation": "pg_stat_user_tables exposes HOT-update, total-update, live-tuple and dead-tuple statistics. The HOT formula divides HOT updates by total updates. The dead-tuple formula divides dead tuples by live plus dead tuples. src/backend/catalog/system_views.sql:692-697 defines those columns. NULLIF handles zero denominators.", "verdict": "Accurate", "sources": [{"url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/catalog/system_views.sql#L692-L697", "label": "REL_18_6 \u00b7 src/backend/catalog/system_views.sql:692-697"}, {"url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/catalog/system_views.sql#L749-L752", "label": "REL_18_6 \u00b7 src/backend/catalog/system_views.sql:749-752"}, {"url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/doc/src/sgml/func.sgml#L20211-L20218", "label": "REL_18_6 \u00b7 doc/src/sgml/func.sgml:20211-20218"}]}, {"anchor": "F11", "url": "https://pgtrue.postgres.ai/shared/brief/b1a851b2-7f6f-4325-8d97-20b57474b31c#F11", "claim": "\u2026pg_size_pretty(pg_relation_size(indexrelid)) AS index_size\u2026", "title": "The index-size expression measures and formats the main fork", "explanation": "pg_relation_size(indexrelid) returns the index's main-fork size in bytes. pg_size_pretty formats that count with binary-based units. doc/src/sgml/func.sgml:30146-30190 and 30209-30227 define both operations.", "verdict": "Accurate", "sources": [{"url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/doc/src/sgml/func.sgml#L30209-L30227", "label": "REL_18_6 \u00b7 doc/src/sgml/func.sgml:30209-30227"}, {"url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/doc/src/sgml/func.sgml#L30146-L30190", "label": "REL_18_6 \u00b7 doc/src/sgml/func.sgml:30146-30190"}]}, {"anchor": "F12", "url": "https://pgtrue.postgres.ai/shared/brief/b1a851b2-7f6f-4325-8d97-20b57474b31c#F12", "claim": "\u2026FROM pg_stat_user_indexes\u2026", "title": "pg_stat_user_indexes supplies the displayed index identities and scan counts", "explanation": "pg_stat_user_indexes selects user-index rows from pg_stat_all_indexes. indexrelid identifies the index, indexrelname names it, and idx_scan reports recorded scans. src/backend/catalog/system_views.sql:803-810 defines these fields. The query supports investigation without establishing that removal is safe.", "verdict": "Accurate", "sources": [{"url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/catalog/system_views.sql#L803-L828", "label": "REL_18_6 \u00b7 src/backend/catalog/system_views.sql:803-828"}, {"url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/catalog/system_views.sql#L825-L828", "label": "REL_18_6 \u00b7 src/backend/catalog/system_views.sql:825-828"}]}, {"anchor": "F13", "url": "https://pgtrue.postgres.ai/shared/brief/b1a851b2-7f6f-4325-8d97-20b57474b31c#F13", "claim": "\u2026SELECT client_addr, application_name, state, sync_state FROM pg_stat_replication;\u2026", "title": "pg_stat_replication lists directly connected WAL senders", "explanation": "pg_stat_replication exposes one row per WAL sender and includes the selected connection fields. application_name labels the connection. doc/src/sgml/monitoring.sgml:1175-1254 limits this view to directly connected standbys. It does not list downstream standbys.", "verdict": "Accurate", "sources": [{"url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/doc/src/sgml/monitoring.sgml#L1175-L1254", "label": "REL_18_6 \u00b7 doc/src/sgml/monitoring.sgml:1175-1254"}, {"url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/catalog/system_views.sql#L906-L930", "label": "REL_18_6 \u00b7 src/backend/catalog/system_views.sql:906-930"}]}, {"anchor": "F14", "url": "https://pgtrue.postgres.ai/shared/brief/b1a851b2-7f6f-4325-8d97-20b57474b31c#F14", "claim": "Every checkpoint reset that \u201cinsurance copy\u201d mechanism\u2026", "title": "Checkpoint intervals affect repeated full-page-image generation", "explanation": "With full_page_writes enabled, PostgreSQL logs a page image on its first modification after a checkpoint. doc/src/sgml/config.sgml:3386-3408 documents this rule. Longer checkpoint intervals can reduce repeated images of busy pages. The mechanism does not establish a particular percentage saving.", "verdict": "Accurate", "sources": [{"url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/doc/src/sgml/config.sgml#L3386-L3408", "label": "REL_18_6 \u00b7 doc/src/sgml/config.sgml:3386-3408"}]}, {"anchor": "F15", "url": "https://pgtrue.postgres.ai/shared/brief/b1a851b2-7f6f-4325-8d97-20b57474b31c#F15", "claim": "By default, PostgreSQL packs pages completely full\u2026", "title": "The default table fillfactor is 100", "explanation": "Table fillfactor defaults to 100. Lower values reserve part of each page during insertion for future updated row versions. doc/src/sgml/ref/create_table.sgml:1593-1606 documents this behavior.", "verdict": "Accurate", "sources": [{"url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/doc/src/sgml/ref/create_table.sgml#L1593-L1606", "label": "REL_18_6 \u00b7 doc/src/sgml/ref/create_table.sgml:1593-1606"}]}, {"anchor": "F19", "url": "https://pgtrue.postgres.ai/shared/brief/b1a851b2-7f6f-4325-8d97-20b57474b31c#F19", "claim": "\u2026longer checkpoint intervals mean more WAL to replay if the database ever crashes\u2026", "title": "Longer checkpoint intervals can increase crash-recovery work", "explanation": "More frequent checkpoints reduce work required after a crash. PostgreSQL 18.6 documents this tradeoff in doc/src/sgml/wal.sgml:536. Extending intervals can increase recovery work.", "verdict": "Accurate", "sources": [{"url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/doc/src/sgml/wal.sgml#L536-L545", "label": "REL_18_6 \u00b7 doc/src/sgml/wal.sgml:536-545"}]}, {"anchor": "F20", "url": "https://pgtrue.postgres.ai/shared/brief/b1a851b2-7f6f-4325-8d97-20b57474b31c#F20", "claim": "\u2026the setting controlling how many pages the background writer can clean per cycle\u2026", "title": "bgwriter_lru_maxpages limits buffers written per round", "explanation": "bgwriter_lru_maxpages sets the background writer's maximum buffers per round. PostgreSQL 18.6 documents that limit in doc/src/sgml/config.sgml:2573.", "verdict": "Accurate", "sources": [{"url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/doc/src/sgml/config.sgml#L2572-L2578", "label": "REL_18_6 \u00b7 doc/src/sgml/config.sgml:2572-2578"}]}, {"anchor": "F21", "url": "https://pgtrue.postgres.ai/shared/brief/b1a851b2-7f6f-4325-8d97-20b57474b31c#F21", "claim": "This is normal, necessary behavior.", "title": "Full-page images protect data-page consistency", "explanation": "With full_page_writes enabled, PostgreSQL logs the first page modification after each checkpoint as a full-page image. PostgreSQL 18.6 documents its consistency purpose in doc/src/sgml/wal.sgml:541.", "verdict": "Accurate", "sources": [{"url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/doc/src/sgml/wal.sgml#L536-L545", "label": "REL_18_6 \u00b7 doc/src/sgml/wal.sgml:536-545"}]}]}