{"schema": "pgtrue.report/1", "url": "https://pgtrue.postgres.ai/shared/brief/edad7c8b-c114-46fa-9239-a236f691c491", "published": "2026-10-19T06:48:42Z", "publisher": "PostgresAI", "article": {"title": "What Are \u201cDirty Pages\u201d in PostgreSQL?", "url": "https://stormatics.tech/blogs/what-are-dirty-pages-in-postgresql", "date_published": "2025-10-31T07:52:18Z", "author": "Umair Shahid", "publisher": "Stormatics"}, "grade": "B", "axes": [{"axis": "Factual", "summary": "B- \u00b7 3 wrong of 13 checked \u00b7 0 caveats"}, {"axis": "Applicable", "summary": "B+ \u00b7 1 wrong of 9 checked \u00b7 0 caveats"}, {"axis": "Consistent", "summary": "A \u00b7 0 wrong of 13 checked \u00b7 0 caveats"}, {"axis": "Transparent", "summary": "0 wrong \u00b7 0 caveats \u00b7 1 checked"}, {"axis": "Safe", "summary": "B+ \u00b7 0 wrong of 19 checked \u00b7 0 caveats \u00b7 2 unwarned risks \u00b7 partly assessed"}], "findings": [{"anchor": "F1", "url": "https://pgtrue.postgres.ai/shared/brief/edad7c8b-c114-46fa-9239-a236f691c491#F1", "claim": "\u2026Use pg_stat_bgwriter to monitor: buffers_checkpoint (dirty pages written during checkpoints). buffers_clean (BGWriter writes). buffers_backend (back\u2010end writes).", "title": "pg_stat_bgwriter lacks buffers_checkpoint and buffers_backend in PostgreSQL 18", "explanation": "PostgreSQL 18 exposes neither recommended counter in pg_stat_bgwriter. src/backend/catalog/system_views.sql:1150-1155 defines four columns, including buffers_clean. Queries selecting buffers_checkpoint or buffers_backend from this view fail.", "verdict": "False", "sources": [{"url": "https://github.com/postgres/postgres/blob/3d6a828938a5fa0444275d3d2f67b64ec3199eb7/src/backend/catalog/system_views.sql#L1150-L1155", "label": "REL_18_0 \u00b7 src/backend/catalog/system_views.sql:1150-1155"}, {"url": "https://github.com/postgres/postgres/blob/3d6a828938a5fa0444275d3d2f67b64ec3199eb7/doc/src/sgml/monitoring.sgml#L3059-L3063", "label": "REL_18_0 \u00b7 doc/src/sgml/monitoring.sgml:3059-3063"}]}, {"anchor": "F2", "url": "https://pgtrue.postgres.ai/shared/brief/edad7c8b-c114-46fa-9239-a236f691c491#F2", "claim": "Raise checkpoint_completion_target to 0.7\u20130.9 so checkpoints spread writes evenly.", "title": "Setting checkpoint_completion_target to 0.7 lowers the default and concentrates writes", "explanation": "PostgreSQL 18 defaults checkpoint_completion_target to 0.9. src/backend/utils/misc/guc_tables.c:4114-4121 defines that default. doc/src/sgml/config.sgml:3655-3662 warns that reducing it increases checkpoint I/O intensity. Following the suggested 0.7 endpoint can reverse the intended pacing change.", "verdict": "Misleading", "sources": [{"url": "https://github.com/postgres/postgres/blob/3d6a828938a5fa0444275d3d2f67b64ec3199eb7/doc/src/sgml/config.sgml#L3655-L3660", "label": "REL_18_0 \u00b7 doc/src/sgml/config.sgml:3655-3660"}, {"url": "https://github.com/postgres/postgres/blob/3d6a828938a5fa0444275d3d2f67b64ec3199eb7/src/backend/utils/misc/guc_tables.c#L4114-L4121", "label": "REL_18_0 \u00b7 src/backend/utils/misc/guc_tables.c:4114-4121"}]}, {"anchor": "F10", "url": "https://pgtrue.postgres.ai/shared/brief/edad7c8b-c114-46fa-9239-a236f691c491#F10", "claim": "\u2026back\u2010end processes are writing pages (visible in pg_stat_bgwriter )\u2026", "title": "PostgreSQL 18 pg_stat_bgwriter lacks the requested backend-write counters", "explanation": "PostgreSQL 18 pg_stat_bgwriter has four columns and no buffers_backend or buffers_checkpoint. src/backend/catalog/system_views.sql:1150 defines the complete view. Queries using those names fail. pg_stat_io exposes writes and backend_type.", "verdict": "Misleading", "sources": [{"url": "https://github.com/postgres/postgres/blob/3d6a828938a5fa0444275d3d2f67b64ec3199eb7/src/backend/catalog/system_views.sql#L1150-L1155", "label": "REL_18_0 \u00b7 src/backend/catalog/system_views.sql:1150-1155"}, {"url": "https://github.com/postgres/postgres/blob/3d6a828938a5fa0444275d3d2f67b64ec3199eb7/src/backend/catalog/system_views.sql#L1171-L1193", "label": "REL_18_0 \u00b7 src/backend/catalog/system_views.sql:1171-1193"}]}, {"anchor": "F11", "url": "https://pgtrue.postgres.ai/shared/brief/edad7c8b-c114-46fa-9239-a236f691c491#F11", "claim": "Raise checkpoint_completion_target to 0.7\u20130.9\u2026", "title": "The proposed checkpoint range can lower the PostgreSQL 18 default", "explanation": "PostgreSQL 18 defaults checkpoint_completion_target to 0.9. doc/src/sgml/config.sgml:3647 warns against reducing it because checkpoints finish faster. Choosing 0.7 from the proposed range concentrates checkpoint writes instead of spreading them further.", "verdict": "Misleading", "sources": [{"url": "https://github.com/postgres/postgres/blob/3d6a828938a5fa0444275d3d2f67b64ec3199eb7/doc/src/sgml/config.sgml#L3647-L3667", "label": "REL_18_0 \u00b7 doc/src/sgml/config.sgml:3647-3667"}, {"url": "https://github.com/postgres/postgres/blob/3d6a828938a5fa0444275d3d2f67b64ec3199eb7/doc/src/sgml/config.sgml#L3647-L3667", "label": "REL_18_0 \u00b7 doc/src/sgml/config.sgml:3647-3667"}]}, {"anchor": "F4", "url": "https://pgtrue.postgres.ai/shared/brief/edad7c8b-c114-46fa-9239-a236f691c491#F4", "claim": "\u2026Start with 25 % of RAM\u2026", "title": "A 25% shared_buffers starting point matches PostgreSQL documentation", "explanation": "doc/src/sgml/config.sgml:1731-1733 recommends 25% of RAM initially on dedicated servers with at least 1GB. src/backend/utils/misc/guc_tables.c:2369-2377 defines shared_buffers as the shared buffer count. The article's starting-point recommendation agrees.", "verdict": "Accurate", "sources": [{"url": "https://github.com/postgres/postgres/blob/3d6a828938a5fa0444275d3d2f67b64ec3199eb7/doc/src/sgml/config.sgml#L1731-L1733", "label": "REL_18_0 \u00b7 doc/src/sgml/config.sgml:1731-1733"}, {"url": "https://github.com/postgres/postgres/blob/3d6a828938a5fa0444275d3d2f67b64ec3199eb7/src/backend/utils/misc/guc_tables.c#L2369-L2377", "label": "REL_18_0 \u00b7 src/backend/utils/misc/guc_tables.c:2369-2377"}, {"url": "https://github.com/postgres/postgres/blob/3d6a828938a5fa0444275d3d2f67b64ec3199eb7/doc/src/sgml/config.sgml#L1708-L1751", "label": "REL_18_0 \u00b7 doc/src/sgml/config.sgml:1708-1751"}]}, {"anchor": "F5", "url": "https://pgtrue.postgres.ai/shared/brief/edad7c8b-c114-46fa-9239-a236f691c491#F5", "claim": "\u2026Lower bgwriter_delay (e.g., 100 ms) to wake BGWriter more often.", "title": "100ms shortens the background writer's active-cycle sleep", "explanation": "bgwriter_delay defaults to 200ms in src/backend/utils/misc/guc_tables.c:3208-3216. Setting 100ms shortens the configured sleep between active rounds. doc/src/sgml/config.sgml:2485-2489 describes this cycle. The setting does not guarantee a particular number of writes.", "verdict": "Accurate", "sources": [{"url": "https://github.com/postgres/postgres/blob/3d6a828938a5fa0444275d3d2f67b64ec3199eb7/src/backend/utils/misc/guc_tables.c#L3208-L3216", "label": "REL_18_0 \u00b7 src/backend/utils/misc/guc_tables.c:3208-3216"}, {"url": "https://github.com/postgres/postgres/blob/3d6a828938a5fa0444275d3d2f67b64ec3199eb7/doc/src/sgml/config.sgml#L2485-L2489", "label": "REL_18_0 \u00b7 doc/src/sgml/config.sgml:2485-2489"}]}, {"anchor": "F6", "url": "https://pgtrue.postgres.ai/shared/brief/edad7c8b-c114-46fa-9239-a236f691c491#F6", "claim": "Increase bgwriter_lru_maxpages (e.g., 200\u20131000) and bgwriter_lru_multiplier (e.g., 3\u20134)\u2026", "title": "The two LRU controls can increase background cleaning", "explanation": "bgwriter_lru_maxpages limits buffer writes per round. doc/src/sgml/config.sgml:2513-2517 sets its default at 100 buffers. src/backend/storage/buffer/bufmgr.c:3754-3833 multiplies estimated allocation demand by bgwriter_lru_multiplier. Increasing these settings permits more cleaning without guaranteeing additional writes.", "verdict": "Accurate", "sources": [{"url": "https://github.com/postgres/postgres/blob/3d6a828938a5fa0444275d3d2f67b64ec3199eb7/doc/src/sgml/config.sgml#L2513-L2517", "label": "REL_18_0 \u00b7 doc/src/sgml/config.sgml:2513-2517"}, {"url": "https://github.com/postgres/postgres/blob/3d6a828938a5fa0444275d3d2f67b64ec3199eb7/src/backend/storage/buffer/bufmgr.c#L3754-L3833", "label": "REL_18_0 \u00b7 src/backend/storage/buffer/bufmgr.c:3754-3833"}]}, {"anchor": "F8", "url": "https://pgtrue.postgres.ai/shared/brief/edad7c8b-c114-46fa-9239-a236f691c491#F8", "claim": "Increase max_wal_size so checkpoints aren\u2019t triggered too often.", "title": "Increasing max_wal_size increases the WAL checkpoint distance", "explanation": "src/backend/access/transam/xlog.c:2167-2198 calculates checkpoint distance from max_wal_size and checkpoint_completion_target. Raising max_wal_size increases that distance with other settings unchanged. src/backend/utils/misc/guc_tables.c:2961-2970 identifies its checkpoint-trigger role.", "verdict": "Accurate", "sources": [{"url": "https://github.com/postgres/postgres/blob/3d6a828938a5fa0444275d3d2f67b64ec3199eb7/src/backend/utils/misc/guc_tables.c#L2961-L2970", "label": "REL_18_0 \u00b7 src/backend/utils/misc/guc_tables.c:2961-2970"}, {"url": "https://github.com/postgres/postgres/blob/3d6a828938a5fa0444275d3d2f67b64ec3199eb7/src/backend/access/transam/xlog.c#L2167-L2198", "label": "REL_18_0 \u00b7 src/backend/access/transam/xlog.c:2167-2198"}]}, {"anchor": "F9", "url": "https://pgtrue.postgres.ai/shared/brief/edad7c8b-c114-46fa-9239-a236f691c491#F9", "claim": "Adjust autovacuum_vacuum_cost_limit and autovacuum_vacuum_scale_factor based on workload.", "title": "Autovacuum cost and scale settings control different tuning dimensions", "explanation": "autovacuum_vacuum_scale_factor contributes to vacuum eligibility in doc/src/sgml/config.sgml:9010-9013. autovacuum_vacuum_cost_limit controls vacuum's cost allowance. src/backend/postmaster/autovacuum.c:1714-1758 distributes that allowance among participating workers. The workload-based adjustment advice agrees with these roles.", "verdict": "Accurate", "sources": [{"url": "https://github.com/postgres/postgres/blob/3d6a828938a5fa0444275d3d2f67b64ec3199eb7/doc/src/sgml/config.sgml#L9010-L9013", "label": "REL_18_0 \u00b7 doc/src/sgml/config.sgml:9010-9013"}, {"url": "https://github.com/postgres/postgres/blob/3d6a828938a5fa0444275d3d2f67b64ec3199eb7/src/backend/postmaster/autovacuum.c#L1714-L1758", "label": "REL_18_0 \u00b7 src/backend/postmaster/autovacuum.c:1714-1758"}]}, {"anchor": "F13", "url": "https://pgtrue.postgres.ai/shared/brief/edad7c8b-c114-46fa-9239-a236f691c491#F13", "claim": "\u2026checkpoint_timeout interval\u2026", "title": "checkpoint_timeout can trigger a checkpoint", "explanation": "The checkpointer compares elapsed_secs with CheckPointTimeout. src/backend/postmaster/checkpointer.c:350 sets do_checkpoint and CHECKPOINT_CAUSE_TIME when the interval expires.", "verdict": "Accurate", "sources": [{"url": "https://github.com/postgres/postgres/blob/3d6a828938a5fa0444275d3d2f67b64ec3199eb7/src/backend/postmaster/checkpointer.c#L350-L429", "label": "REL_18_0 \u00b7 src/backend/postmaster/checkpointer.c:350-429"}]}, {"anchor": "F14", "url": "https://pgtrue.postgres.ai/shared/brief/edad7c8b-c114-46fa-9239-a236f691c491#F14", "claim": "\u2026to handle more dirty pages per cycle if you have a high write workload\u2026", "title": "Higher background-writer limits permit more cleaning per round", "explanation": "bgwriter_lru_multiplier scales estimated allocation demand. bgwriter_lru_maxpages caps successful writes per round. src/backend/storage/buffer/bufmgr.c:3777 implements both controls. Increasing them can permit more dirty-buffer writes when sufficient demand exists.", "verdict": "Accurate", "sources": [{"url": "https://github.com/postgres/postgres/blob/3d6a828938a5fa0444275d3d2f67b64ec3199eb7/src/backend/storage/buffer/bufmgr.c#L3754-L3833", "label": "REL_18_0 \u00b7 src/backend/storage/buffer/bufmgr.c:3754-3833"}, {"url": "https://github.com/postgres/postgres/blob/3d6a828938a5fa0444275d3d2f67b64ec3199eb7/src/backend/storage/buffer/bufmgr.c#L3777-L3856", "label": "REL_18_0 \u00b7 src/backend/storage/buffer/bufmgr.c:3777-3856"}]}, {"anchor": "F16", "url": "https://pgtrue.postgres.ai/shared/brief/edad7c8b-c114-46fa-9239-a236f691c491#F16", "claim": "Increase bgwriter_lru_maxpages (e.g., 200\u20131000)\u2026", "title": "200\u20131000 buffers increases the default per-round limit", "explanation": "REL_18_0 src/backend/utils/misc/guc_tables.c:3219\u20133226 defaults bgwriter_lru_maxpages to 100 buffers per round. The article\u2019s 200\u20131000 range raises that limit.", "verdict": "Accurate", "sources": [{"url": "https://github.com/postgres/postgres/blob/3d6a828938a5fa0444275d3d2f67b64ec3199eb7/src/backend/utils/misc/guc_tables.c#L3219-L3226", "label": "REL_18_0 \u00b7 src/backend/utils/misc/guc_tables.c:3219-3226"}]}, {"anchor": "F17", "url": "https://pgtrue.postgres.ai/shared/brief/edad7c8b-c114-46fa-9239-a236f691c491#F17", "claim": "\u2026bgwriter_lru_multiplier (e.g., 3\u20134)\u2026", "title": "A multiplier of 3\u20134 exceeds the default of 2", "explanation": "REL_18_0 src/backend/utils/misc/guc_tables.c:4041\u20134048 defaults bgwriter_lru_multiplier to 2.0. Both suggested values increase that multiplier.", "verdict": "Accurate", "sources": [{"url": "https://github.com/postgres/postgres/blob/3d6a828938a5fa0444275d3d2f67b64ec3199eb7/src/backend/utils/misc/guc_tables.c#L4041-L4048", "label": "REL_18_0 \u00b7 src/backend/utils/misc/guc_tables.c:4041-4048"}]}]}