{"schema": "pgtrue.report/1", "url": "https://pgtrue.postgres.ai/shared/brief/d6f65898-104d-4748-8255-ec4b3cdc84c3", "published": "2026-10-21T05:00:56Z", "publisher": "PostgresAI", "article": {"title": "Problems with large tables in Postgres \u2014 PlanetScale", "url": "https://planetscale.com/blog/dealing-with-large-tables-in-postgres", "date_published": "2026-08-25T00:00:00Z", "author": "Simeon Griggs", "publisher": "PlanetScale"}, "grade": "D+", "axes": [{"axis": "Factual", "summary": "A \u00b7 0 wrong of 19 checked \u00b7 0 caveats"}, {"axis": "Applicable", "summary": "B \u00b7 3 wrong of 16 checked \u00b7 0 caveats"}, {"axis": "Consistent", "summary": "B+ \u00b7 2 wrong of 19 checked \u00b7 0 caveats"}, {"axis": "Transparent", "summary": "A \u00b7 0 wrong of 6 checked \u00b7 0 caveats"}, {"axis": "Safe", "summary": "D \u00b7 1 wrong of 39 checked \u00b7 0 caveats \u00b7 2 unwarned risks \u00b7 partly assessed"}], "findings": [{"anchor": "F1", "url": "https://pgtrue.postgres.ai/shared/brief/d6f65898-104d-4748-8255-ec4b3cdc84c3#F1", "claim": "\u2026the spare disk you need to run squeeze is the size of a partition\u2026", "title": "pg_squeeze needs more spare disk than one partition's size", "explanation": "pg_squeeze documents additional free space around twice the target table-and-index size. README.md:379-382 gives that requirement. Processing one partition reduces the target, but does not remove the multiplier or its indexes. The article's estimate can leave a squeeze unable to finish.", "verdict": "False", "sources": [{"url": "https://github.com/cybertec-postgresql/pg_squeeze/blob/400c5f6ae9bc911073a6824e9a19f4d475fb7331/README.md#L379-L382", "label": "pg_squeeze@REL1_9_4 \u00b7 README.md:379-382"}]}, {"anchor": "F2", "url": "https://pgtrue.postgres.ai/shared/brief/d6f65898-104d-4748-8255-ec4b3cdc84c3#F2", "claim": "\u2026a long query anywhere on the cluster still pins every partition.", "explanation": "Ordinary user-table cleanup normally ignores sessions connected to other databases. procarray.c:1796-1802 checks database identity and explicit exceptions. Shared relations use a broader horizon. An ordinary query in another database does not automatically pin every partition.", "verdict": "Misleading", "sources": [{"url": "https://github.com/postgres/postgres/blob/48b43081e550f9e4b04e1184ed6d3fed4f850691/src/backend/storage/ipc/procarray.c#L1778-L1779", "label": "REL_19_STABLE@48b43081e5 \u00b7 src/backend/storage/ipc/procarray.c:1778-1779"}, {"url": "https://github.com/postgres/postgres/blob/48b43081e550f9e4b04e1184ed6d3fed4f850691/src/backend/storage/ipc/procarray.c#L1796-L1802", "label": "REL_19_STABLE@48b43081e5 \u00b7 src/backend/storage/ipc/procarray.c:1796-1802"}]}, {"anchor": "F3", "url": "https://pgtrue.postgres.ai/shared/brief/d6f65898-104d-4748-8255-ec4b3cdc84c3#F3", "claim": "Vacuum will need to walk the entire table again later.", "title": "A later vacuum need not rescan the entire heap", "explanation": "Vacuum skips heap blocks that need no processing. vacuumlazy.c:1645-1648 uses the visibility map and scan thresholds to select blocks. An old snapshot can leave some tuples unreclaimable without invalidating completed work on other pages. Another full heap scan is possible, rather than mandatory.", "verdict": "Misleading", "sources": [{"url": "https://github.com/postgres/postgres/blob/48b43081e550f9e4b04e1184ed6d3fed4f850691/src/backend/access/heap/vacuumlazy.c#L1645-L1648", "label": "REL_19_STABLE@48b43081e5 \u00b7 src/backend/access/heap/vacuumlazy.c:1645-1648"}, {"url": "https://github.com/postgres/postgres/blob/48b43081e550f9e4b04e1184ed6d3fed4f850691/doc/src/sgml/maintenance.sgml#L390-L392", "label": "REL_19_STABLE@48b43081e5 \u00b7 doc/src/sgml/maintenance.sgml:390-392"}]}, {"anchor": "F4", "url": "https://pgtrue.postgres.ai/shared/brief/d6f65898-104d-4748-8255-ec4b3cdc84c3#F4", "claim": "If a row exceeds ~2KB, oversized values go to TOAST\u2026", "title": "Crossing roughly 2 kB does not guarantee out-of-line storage", "explanation": "Default EXTENDED storage tries inline compression before external storage. storage.sgml:467-470 documents that order. heaptoast.c:162-167 implements separate compression and external-storage stages. A row initially exceeding roughly 2 kB can compress enough to remain inline, without adding an external value to vacuum.", "verdict": "Misleading", "sources": [{"url": "https://github.com/postgres/postgres/blob/48b43081e550f9e4b04e1184ed6d3fed4f850691/doc/src/sgml/storage.sgml#L467-L470", "label": "REL_19_STABLE@48b43081e5 \u00b7 doc/src/sgml/storage.sgml:467-470"}, {"url": "https://github.com/postgres/postgres/blob/48b43081e550f9e4b04e1184ed6d3fed4f850691/src/backend/access/heap/heaptoast.c#L162-L167", "label": "REL_19_STABLE@48b43081e5 \u00b7 src/backend/access/heap/heaptoast.c:162-167"}]}, {"anchor": "F5", "url": "https://pgtrue.postgres.ai/shared/brief/d6f65898-104d-4748-8255-ec4b3cdc84c3#F5", "claim": "\u2026make every write touch more files.", "explanation": "HOT updates can skip ordinary index maintenance. heapam.c:4365-4373 selects TU_None or TU_Summarizing for HOT updates, rather than TU_All. Additional indexes do not make every write update additional index files. This excerpt does not establish HOT eligibility conditions.", "verdict": "Misleading", "sources": [{"url": "https://github.com/postgres/postgres/blob/48b43081e550f9e4b04e1184ed6d3fed4f850691/src/backend/access/heap/heapam.c#L4365-L4373", "label": "REL_19_STABLE@48b43081e5 \u00b7 src/backend/access/heap/heapam.c:4365-4373"}]}, {"anchor": "F6", "url": "https://pgtrue.postgres.ai/shared/brief/d6f65898-104d-4748-8255-ec4b3cdc84c3#F6", "claim": "\u2026you're still not putting a hundreds-of-GB table into cache.", "title": "PostgreSQL has no hundreds-of-GB cache ceiling", "explanation": "Cache capacity depends on configured memory and available RAM. guc_parameters.dat:2711-2718 permits shared_buffers values above hundreds of GiB with default-size blocks. PostgreSQL also uses the operating-system cache. A sufficiently large instance can cache such a table. Sharding is not required to make that capacity possible.", "verdict": "Misleading", "sources": [{"url": "https://github.com/postgres/postgres/blob/48b43081e550f9e4b04e1184ed6d3fed4f850691/src/backend/utils/misc/guc_parameters.dat#L2711-L2718", "label": "REL_19_STABLE@48b43081e5 \u00b7 src/backend/utils/misc/guc_parameters.dat:2711-2718"}, {"url": "https://github.com/postgres/postgres/blob/48b43081e550f9e4b04e1184ed6d3fed4f850691/doc/src/sgml/config.sgml#L1823-L1829", "label": "REL_19_STABLE@48b43081e5 \u00b7 doc/src/sgml/config.sgml:1823-1829"}, {"url": "https://github.com/postgres/postgres/blob/48b43081e550f9e4b04e1184ed6d3fed4f850691/src/backend/utils/misc/guc_parameters.dat#L2711-L2718", "label": "REL_19_STABLE@48b43081e5 \u00b7 src/backend/utils/misc/guc_parameters.dat:2711-2718"}, {"url": "https://github.com/postgres/postgres/blob/48b43081e550f9e4b04e1184ed6d3fed4f850691/doc/src/sgml/config.sgml#L1822-L1828", "label": "REL_19_STABLE@48b43081e5 \u00b7 doc/src/sgml/config.sgml:1822-1828"}]}, {"anchor": "F7", "url": "https://pgtrue.postgres.ai/shared/brief/d6f65898-104d-4748-8255-ec4b3cdc84c3#F7", "claim": "On Postgres 17, the default trigger is 20% of the table.", "title": "PostgreSQL 17 uses the stated 20% scale factor", "explanation": "PostgreSQL 17 defaults autovacuum_vacuum_scale_factor to 0.2. autovacuum.c:3074 adds the base threshold to that fraction of estimated rows. The article's approximation and later formula describe this mechanism.", "verdict": "Accurate", "sources": [{"url": "https://github.com/postgres/postgres/blob/083ac033419f690758508e08c1736089384bbee8/doc/src/sgml/config.sgml#L8794-L8797", "label": "REL_17_11 \u00b7 doc/src/sgml/config.sgml:8794-8797"}, {"url": "https://github.com/postgres/postgres/blob/083ac033419f690758508e08c1736089384bbee8/src/backend/postmaster/autovacuum.c#L3074-L3076", "label": "REL_17_11 \u00b7 src/backend/postmaster/autovacuum.c:3074-3076"}]}, {"anchor": "F8", "url": "https://pgtrue.postgres.ai/shared/brief/d6f65898-104d-4748-8255-ec4b3cdc84c3#F8", "claim": "\u2026autovacuum_vacuum_max_threshold with a default value of 100,000,000.", "title": "PostgreSQL 18 defaults the vacuum threshold cap to 100 million tuples", "explanation": "PostgreSQL 18 documents a default cap of 100 million updated or deleted tuples. autovacuum.c:3122-3124 caps the calculated threshold. The article correctly distinguishes this cap from the uncapped scale-factor calculation.", "verdict": "Accurate", "sources": [{"url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/doc/src/sgml/config.sgml#L9193-L9198", "label": "REL_18_6 \u00b7 doc/src/sgml/config.sgml:9193-9198"}, {"url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/postmaster/autovacuum.c#L3122-L3124", "label": "REL_18_6 \u00b7 src/backend/postmaster/autovacuum.c:3122-3124"}]}, {"anchor": "F9", "url": "https://pgtrue.postgres.ai/shared/brief/d6f65898-104d-4748-8255-ec4b3cdc84c3#F9", "claim": "Postgres 19 adds parallel autovacuum , off by default.", "title": "PostgreSQL 19 parallel autovacuum defaults to disabled", "explanation": "autovacuum_max_parallel_workers defaults to 0. vacuumparallel.c:796-805 applies that limit to autovacuum workers. Parallel workers process eligible index vacuuming and cleanup phases. They do not change the table's vacuum trigger.", "verdict": "Accurate", "sources": [{"url": "https://github.com/postgres/postgres/blob/48b43081e550f9e4b04e1184ed6d3fed4f850691/doc/src/sgml/config.sgml#L9810-L9813", "label": "REL_19_STABLE@48b43081e5 \u00b7 doc/src/sgml/config.sgml:9810-9813"}, {"url": "https://github.com/postgres/postgres/blob/48b43081e550f9e4b04e1184ed6d3fed4f850691/doc/src/sgml/config.sgml#L9818-L9819", "label": "REL_19_STABLE@48b43081e5 \u00b7 doc/src/sgml/config.sgml:9818-9819"}, {"url": "https://github.com/postgres/postgres/blob/48b43081e550f9e4b04e1184ed6d3fed4f850691/src/backend/commands/vacuumparallel.c#L796-L805", "label": "REL_19_STABLE@48b43081e5 \u00b7 src/backend/commands/vacuumparallel.c:796-805"}, {"url": "https://github.com/postgres/postgres/blob/48b43081e550f9e4b04e1184ed6d3fed4f850691/doc/src/sgml/release-19.sgml#L69-L69", "label": "REL_19_STABLE@48b43081e5 \u00b7 doc/src/sgml/release-19.sgml:69-69"}, {"url": "https://github.com/postgres/postgres/blob/48b43081e550f9e4b04e1184ed6d3fed4f850691/doc/src/sgml/config.sgml#L9818-L9819", "label": "REL_19_STABLE@48b43081e5 \u00b7 doc/src/sgml/config.sgml:9818-9819"}]}, {"anchor": "F10", "url": "https://pgtrue.postgres.ai/shared/brief/d6f65898-104d-4748-8255-ec4b3cdc84c3#F10", "claim": "It samples a fixed number of rows no matter how large the table is.", "title": "Large-table ANALYZE sample demand follows the statistics target", "explanation": "analyze.c:2026 sets scalar-statistics sample demand to 300 times the column statistics target. Increasing table size alone does not increase that demand. ref/analyze.sgml:249-253 documents per-column control through ALTER TABLE.", "verdict": "Accurate", "sources": [{"url": "https://github.com/postgres/postgres/blob/48b43081e550f9e4b04e1184ed6d3fed4f850691/src/backend/commands/analyze.c#L2026-L2026", "label": "REL_19_STABLE@48b43081e5 \u00b7 src/backend/commands/analyze.c:2026-2026"}, {"url": "https://github.com/postgres/postgres/blob/48b43081e550f9e4b04e1184ed6d3fed4f850691/doc/src/sgml/ref/analyze.sgml#L249-L253", "label": "REL_19_STABLE@48b43081e5 \u00b7 doc/src/sgml/ref/analyze.sgml:249-253"}]}, {"anchor": "F11", "url": "https://pgtrue.postgres.ai/shared/brief/d6f65898-104d-4748-8255-ec4b3cdc84c3#F11", "claim": "Lower the fillfactor so an update can often stay on the same page\u2026", "title": "Lower fillfactor reserves space for same-page updates", "explanation": "ref/create_table.sgml:1617-1622 documents reserved page space for updated row versions. This improves the chance of same-page placement and HOT updates. It supports the article's conditional recommendation.", "verdict": "Accurate", "sources": [{"url": "https://github.com/postgres/postgres/blob/48b43081e550f9e4b04e1184ed6d3fed4f850691/doc/src/sgml/ref/create_table.sgml#L1617-L1622", "label": "REL_19_STABLE@48b43081e5 \u00b7 doc/src/sgml/ref/create_table.sgml:1617-1622"}]}, {"anchor": "F13", "url": "https://pgtrue.postgres.ai/shared/brief/d6f65898-104d-4748-8255-ec4b3cdc84c3#F13", "claim": "\u2026each shard is its own cluster, with its own WAL and replicas.", "title": "The documented shard contains a PostgreSQL primary and replicas", "explanation": "The topology documentation explicitly defines each shard as a PostgreSQL primary and its replicas. This supports independent PostgreSQL instance state per shard. It does not establish the article's workload-specific performance improvements.", "verdict": "Accurate", "sources": [{"url": "https://planetscale.com/blog/what-is-a-data-topology", "label": "https://planetscale.com/blog/what-is-a-data-topology"}]}, {"anchor": "F14", "url": "https://pgtrue.postgres.ai/shared/brief/d6f65898-104d-4748-8255-ec4b3cdc84c3#F14", "claim": "Postgres 18 added autovacuum_vacuum_max_threshold\u2026", "title": "PostgreSQL 18 introduced autovacuum_vacuum_max_threshold", "explanation": "PostgreSQL 18 introduced autovacuum_vacuum_max_threshold. REL_18_6 records its introduction in release-18.sgml:10261. REL_18_0 documents the parameter in config.sgml:9064.", "verdict": "Accurate", "sources": [{"url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/doc/src/sgml/release-18.sgml#L10261-L10261", "label": "REL_18_6 \u00b7 doc/src/sgml/release-18.sgml:10261-10261"}, {"url": "https://github.com/postgres/postgres/blob/3d6a828938a5fa0444275d3d2f67b64ec3199eb7/doc/src/sgml/config.sgml#L9064-L9064", "label": "REL_18_0 \u00b7 doc/src/sgml/config.sgml:9064-9064"}]}, {"anchor": "F15", "url": "https://pgtrue.postgres.ai/shared/brief/d6f65898-104d-4748-8255-ec4b3cdc84c3#F15", "claim": "To compact a bloated table while reads and writes continue, enable pg_squeeze\u2026", "title": "pg_squeeze supports concurrent cleanup and requires activation", "explanation": "pg_squeeze REL1_9_4 supports cleanup alongside regular reads and writes. README.md:1 describes that behavior. The service documentation requires dashboard activation through shared libraries and a database restart.", "verdict": "Accurate", "sources": [{"url": "https://github.com/cybertec-postgresql/pg_squeeze/blob/400c5f6ae9bc911073a6824e9a19f4d475fb7331/README.md#L1-L3", "label": "pg_squeeze@REL1_9_4 \u00b7 README.md:1-3"}, {"url": "https://planetscale.com/docs/postgres/extensions/pg_squeeze", "label": "https://planetscale.com/docs/postgres/extensions/pg_squeeze"}]}, {"anchor": "F16", "url": "https://pgtrue.postgres.ai/shared/brief/d6f65898-104d-4748-8255-ec4b3cdc84c3#F16", "claim": "A table with ~500 million rows needs ~100 million dead tuples before autovacuum begins.", "title": "The 500-million-row threshold rounds correctly", "explanation": "The default formula gives approximately 100 million dead tuples (derived: 50 + 0.2 \u00d7 500 million). REL_17_11 src/backend/postmaster/autovacuum.c:3074 applies that formula.", "verdict": "Accurate", "sources": [{"url": "https://github.com/postgres/postgres/blob/083ac033419f690758508e08c1736089384bbee8/src/backend/postmaster/autovacuum.c#L3074-L3074", "label": "REL_17_11 \u00b7 src/backend/postmaster/autovacuum.c:3074-3074"}, {"url": "https://github.com/postgres/postgres/blob/083ac033419f690758508e08c1736089384bbee8/src/backend/utils/misc/guc_tables.c#L3354-L3355", "label": "REL_17_11 \u00b7 src/backend/utils/misc/guc_tables.c:3354-3355"}, {"url": "https://github.com/postgres/postgres/blob/083ac033419f690758508e08c1736089384bbee8/src/backend/utils/misc/guc_tables.c#L3891-L3892", "label": "REL_17_11 \u00b7 src/backend/utils/misc/guc_tables.c:3891-3892"}]}, {"anchor": "F17", "url": "https://pgtrue.postgres.ai/shared/brief/d6f65898-104d-4748-8255-ec4b3cdc84c3#F17", "claim": "\u2026a billion-row table triggered autovacuum at 100 million (still a high number) instead of 200 million.", "title": "The billion-row threshold comparison is correct", "explanation": "PostgreSQL 18 caps the calculated dead-tuple threshold at 100 million. Without that cap, the illustrated formula gives approximately 200 million. REL_18_6 src/backend/postmaster/autovacuum.c:3122 applies the cap.", "verdict": "Accurate", "sources": [{"url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/postmaster/autovacuum.c#L3122-L3124", "label": "REL_18_6 \u00b7 src/backend/postmaster/autovacuum.c:3122-3124"}, {"url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/utils/misc/guc_tables.c#L3553-L3554", "label": "REL_18_6 \u00b7 src/backend/utils/misc/guc_tables.c:3553-3554"}]}, {"anchor": "F18", "url": "https://pgtrue.postgres.ai/shared/brief/d6f65898-104d-4748-8255-ec4b3cdc84c3#F18", "claim": "\u2026Same data as 12 monthly partitions ~41.7 million each ~8.3 million dead tuples per partition\u2026", "title": "Both partition estimates round correctly", "explanation": "Each equal partition contains approximately 41.7 million rows (derived: 500 million / 12). Its illustrated threshold is approximately 8.33 million dead tuples (derived: 50 + 0.2 \u00d7 500 million / 12).", "verdict": "Accurate", "sources": [{"url": "https://github.com/postgres/postgres/blob/083ac033419f690758508e08c1736089384bbee8/src/backend/postmaster/autovacuum.c#L3074-L3074", "label": "REL_17_11 \u00b7 src/backend/postmaster/autovacuum.c:3074-3074"}, {"url": "https://github.com/postgres/postgres/blob/083ac033419f690758508e08c1736089384bbee8/src/backend/utils/misc/guc_tables.c#L3354-L3355", "label": "REL_17_11 \u00b7 src/backend/utils/misc/guc_tables.c:3354-3355"}, {"url": "https://github.com/postgres/postgres/blob/083ac033419f690758508e08c1736089384bbee8/src/backend/utils/misc/guc_tables.c#L3891-L3892", "label": "REL_17_11 \u00b7 src/backend/utils/misc/guc_tables.c:3891-3892"}]}, {"anchor": "F19", "url": "https://pgtrue.postgres.ai/shared/brief/d6f65898-104d-4748-8255-ec4b3cdc84c3#F19", "claim": "If that age reaches around 2.1 billion, Postgres goes into read-only mode.", "title": "The protective XID threshold rounds to 2.1 billion", "explanation": "The protective threshold is approximately 2.14 billion XIDs beyond the oldest database horizon (derived: 2^31 \u2212 1 \u2212 3 million). src/backend/access/transam/varsup.c:400 reserves the final 3 million XIDs.", "verdict": "Accurate", "sources": [{"url": "https://github.com/postgres/postgres/blob/48b43081e550f9e4b04e1184ed6d3fed4f850691/src/backend/access/transam/varsup.c#L384-L384", "label": "REL_19_STABLE@48b43081e5 \u00b7 src/backend/access/transam/varsup.c:384-384"}, {"url": "https://github.com/postgres/postgres/blob/48b43081e550f9e4b04e1184ed6d3fed4f850691/src/backend/access/transam/varsup.c#L400-L400", "label": "REL_19_STABLE@48b43081e5 \u00b7 src/backend/access/transam/varsup.c:400-400"}]}, {"anchor": "F20", "url": "https://pgtrue.postgres.ai/shared/brief/d6f65898-104d-4748-8255-ec4b3cdc84c3#F20", "claim": "\u2026Postgres gives you three ways to take a backup.", "title": "The three backup categories match PostgreSQL documentation", "explanation": "doc/src/sgml/backup.sgml:19 lists SQL dumps, filesystem backups, and continuous archiving. The article uses those 3 categories.", "verdict": "Accurate", "sources": [{"url": "https://github.com/postgres/postgres/blob/48b43081e550f9e4b04e1184ed6d3fed4f850691/doc/src/sgml/backup.sgml#L19-L21", "label": "REL_19_STABLE@48b43081e5 \u00b7 doc/src/sgml/backup.sgml:19-21"}]}]}