Paste into your AI assistant to fix the article, then ask for a re-review.
Show the text
Fix the article with this report, then ask pgTrue for a re-review.
# pgTrue report: B-tree pages, sorted and sparse
Article title: B-tree pages, sorted and sparse
Article URL: https://boringsql.com/posts/index-storage-and-bloat
Report URL: https://pgtrue.postgres.ai/shared/brief/01a1ce2f-c495-7a1c-9a29-9a37b9f15d5c
Audited revision: 2 of 2, 2026-11-12 04:49:11 UTC
Overall letter: A-
## Axes
- Factual: B+ · 1 wrong · 20 checked · 0 caveats · assessed
- Applicable: A · 0 wrong · 0 checked · 0 caveats · partly assessed
- Consistent: A · 0 wrong · 2 checked · 0 caveats · not assessed
- Transparent: A · 0 wrong · 3 checked · 0 caveats · partly assessed
- Safe: A · 0 wrong · 0 checked · 0 caveats · partly assessed
ElephantSeal: A-.
Open conditions: central claim not checked.
## Report metadata
- Report: Technical fact-check, edition 2
- pgTrue version: audited with v1.1.6
- Issued: 2026-11-12
- Edition: Updated after review. Corrections are listed below.
- Submitted: Submitted by the PostgresAI team.
- Author response: No written reply from the author. We re-audited this article 1 time; see Revisions below. Policy: [right-of-reply and corrections policy](/pgtrue/security).
## Findings needing a change (1)
### F1 · Misleading · Factual · Plain REINDEX blocks planning for reads beyond the rebuilt index.
Location: excerpt · section “Rebuilding” · as fetched 2026-11-12 · [open in article](https://boringsql.com/posts/index-storage-and-bloat#:~:text=queries%20that%20would%20use%20it%20are%20blocked)
Article says:
```text
…queries that would use it are blocked…
```
What is true:
Plain REINDEX blocks most newly planned queries against the table. plancat.c:242-256 opens every index before selecting a plan. The 18.6 documentation states this consequence. Some cached plans can continue without the rebuilt index. A maintenance plan that expects other reads to continue can interrupt them.
So what:
Choose REINDEX CONCURRENTLY when reads must continue, including reads expected to use sequential scans or other indexes.
Charitable reading:
The stated index lock is correct. The sentence does not expressly promise that other reads continue.
Review: We tested whether the article merely states a sufficient blocking condition. Its maintenance guidance still understates planning-time blocking. E-52 explicitly documents the broader scope and cached-plan exception. We tested whether the article merely names one blocked query class. PostgreSQL 18.6 explicitly documents broader planning blockage. The omitted scope affects maintenance availability.
Sources:
- [REL_18_6 · doc/src/sgml/ref/reindex.sgml:282-286](https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/doc/src/sgml/ref/reindex.sgml#L282-L286)
Excerpt:
```text
the query planner tries to take an <literal>ACCESS SHARE</literal>
lock on every index of the table, regardless of the query, and so
<command>REINDEX</command> blocks virtually any queries except for some
prepared queries whose plan has been cached and which don't use this very
index. In contrast,
```
- [REL_18_6 · src/backend/optimizer/util/plancat.c:242-256](https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/optimizer/util/plancat.c#L242-L256)
Excerpt:
```text
foreach(l, indexoidlist)
{
Oid indexoid = lfirst_oid(l);
Relation indexRelation;
Form_pg_index index;
IndexAmRoutine *amroutine = NULL;
IndexOptInfo *info;
int ncolumns,
nkeycolumns;
int i;
/*
* Extract info from the relation descriptor for the index.
*/
indexRelation = index_open(indexoid, lmode);
```
- [REL_18_6 · doc/src/sgml/ref/reindex.sgml:282-286](https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/doc/src/sgml/ref/reindex.sgml#L282-L286)
Excerpt:
```text
the query planner tries to take an <literal>ACCESS SHARE</literal>
lock on every index of the table, regardless of the query, and so
<command>REINDEX</command> blocks virtually any queries except for some
prepared queries whose plan has been cached and which don't use this very
index. In contrast,
```
Finding URL: https://pgtrue.postgres.ai/shared/brief/01a1ce2f-c495-7a1c-9a29-9a37b9f15d5c#F1
## Verified accurate claims (19)
### F4 · Accurate · Factual · VACUUM does not merge partially filled B-tree leaves.
Location: excerpt · section “When a leaf empties completely” · as fetched 2026-11-12 · [open in article](https://boringsql.com/posts/index-storage-and-bloat#:~:text=It%20won%27t%20merge%20two%20half%2Dempty%20siblings)
Article says:
```text
It won't merge two half-empty siblings…
```
What is true:
PostgreSQL 18.6 considers whole-page deletion after a leaf becomes empty. README:235-239 explains why moving entries between partially filled pages can make concurrent scans miss tuples. VACUUM does not repack those surviving leaves.
Charitable reading:
The statement concerns merging partially filled leaves, not deleting eligible empty pages.
Review: We checked whether empty-page deletion contradicts the no-merge claim. E-56 distinguishes deletion from merging partially filled pages. We checked whether empty-page deletion contradicts the no-merge claim. README:235-239 distinguishes deletion from merging partially filled pages.
Sources:
- [REL_18_6 · src/backend/access/nbtree/README:235-239](https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/access/nbtree/README#L235-L239)
Excerpt:
```text
We consider deleting an entire page from the btree only when it's become
completely empty of items. (Merging partly-full pages would allow better
space reuse, but it seems impractical to move existing data items left or
right to make this happen --- a scan moving in the opposite direction
might miss the items if so.)
```
- [REL_18_6 · src/backend/access/nbtree/README:235-239](https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/access/nbtree/README#L235-L239)
Excerpt:
```text
We consider deleting an entire page from the btree only when it's become
completely empty of items. (Merging partly-full pages would allow better
space reuse, but it seems impractical to move existing data items left or
right to make this happen --- a scan moving in the opposite direction
might miss the items if so.) Also, we *never* delete the rightmost page
```
Finding URL: https://pgtrue.postgres.ai/shared/brief/01a1ce2f-c495-7a1c-9a29-9a37b9f15d5c#F4
### F5 · Accurate · Factual · Rightmost splits use the leaf fillfactor target.
Location: excerpt · section “Where new keys go” · as fetched 2026-11-12 · [open in article](https://boringsql.com/posts/index-storage-and-bloat#:~:text=a%20split%20there%20leaves%20the%20old%20page%2090%25%20full)
Article says:
```text
…a split there leaves the old page 90% full…
```
What is true:
nbtsplitloc.c:94-98 targets fillfactor on the old page during rightmost splits. The default target is 90 percent. Ordinary splits generally balance free space. nbtsort.c builds replacement indexes from sorted tuples and applies the configured packing target.
Charitable reading:
The demonstration uses the default B-tree fillfactor and increasing new keys.
Review: We tested whether 90 percent is an unconditional split guarantee. The finding correctly describes a configurable target in the default-fillfactor example. We tested whether 90% describes every configuration. The finding already limits it to the default target and describes approximate split packing.
Sources:
- [REL_18_6 · src/backend/access/nbtree/nbtsplitloc.c:94-98](https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/access/nbtree/nbtsplitloc.c#L94-L98)
Excerpt:
```text
* If the page is the rightmost page on its level, we instead try to arrange
* to leave the left split page fillfactor% full. In this way, when we are
* inserting successively increasing keys (consider sequences, timestamps,
* etc) we will end up with a tree whose pages are about fillfactor% full,
* instead of the 50% full result that we'd get without this special case.
```
- [REL_18_6 · src/backend/access/nbtree/nbtsort.c:8-12](https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/access/nbtree/nbtsort.c#L8-L12)
Excerpt:
```text
* We use tuplesort.c to sort the given index tuples into order.
* Then we scan the index tuples in order and build the btree pages
* for each level. We load source tuples into leaf-level pages.
* Whenever we fill a page at one level, we add a link to it to its
* parent level (starting a new parent level if necessary). When
```
Finding URL: https://pgtrue.postgres.ai/shared/brief/01a1ce2f-c495-7a1c-9a29-9a37b9f15d5c#F5
### F6 · Accurate · Factual · bt_page_stats reserves 4 bytes for another item identifier.
Location: excerpt · section “One leaf, before and after” · as fetched 2026-11-12 · [open in article](https://boringsql.com/posts/index-storage-and-bloat#:~:text=bt_page_stats%20reports%204%20fewer%20because,for%20one%20more%20line%20pointer)
Article says:
```text
bt_page_stats reports 4 fewer because it allows for one more line pointer…
```
What is true:
bt_page_stats calls PageGetFreeSpace. bufpage.c:915-919 subtracts one ItemIdData, which occupies 4 bytes. pgstatindex.c:311 instead accumulates PageGetExactFreeSpace. The article correctly explains this accounting difference.
Charitable reading:
The claim explains the difference between two free-space accounting functions.
Review: We compared both accounting functions. PageGetFreeSpace subtracts one item identifier, while pgstatindex accumulates exact free space. This verifies accounting, not measurement provenance. We traced both accounting functions. PageGetFreeSpace subtracts one 4-byte identifier. pgstatindex uses exact free space. The finding does not certify the measurement.
Sources:
- [REL_18_6 · contrib/pageinspect/btreefuncs.c:188-188](https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/contrib/pageinspect/btreefuncs.c#L188-L188)
Excerpt:
```text
stat->free_size = PageGetFreeSpace(page);
```
- [REL_18_6 · src/backend/storage/page/bufpage.c:915-919](https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/storage/page/bufpage.c#L915-L919)
Excerpt:
```text
space = (int) phdr->pd_upper - (int) phdr->pd_lower;
if (space < (int) sizeof(ItemIdData))
return 0;
space -= sizeof(ItemIdData);
```
- [REL_18_6 · contrib/pgstattuple/pgstatindex.c:311-311](https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/contrib/pgstattuple/pgstatindex.c#L311-L311)
Excerpt:
```text
indexStat.free_space += PageGetExactFreeSpace(page);
```
- [REL_18_6 · doc/src/sgml/storage.sgml:891-895](https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/doc/src/sgml/storage.sgml#L891-L895)
Excerpt:
```text
Following the page header are item identifiers
(<type>ItemIdData</type>), each requiring four bytes.
An item identifier contains a byte-offset to
the start of an item, its length in bytes, and a few attribute bits
which affect its interpretation.
```
- [REL_18_6 · configure.ac:260-260](https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/configure.ac#L260-L260)
Excerpt:
```text
8) BLCKSZ=8192;;
```
- [REL_18_6 · doc/src/sgml/storage.sgml:792-792](https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/doc/src/sgml/storage.sgml#L792-L792)
Excerpt:
```text
The first 24 bytes of each page consists of a page header
```
- [REL_18_6 · contrib/pageinspect/btreefuncs.c:188-188](https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/contrib/pageinspect/btreefuncs.c#L188-L188)
Excerpt:
```text
stat->free_size = PageGetFreeSpace(page);
```
- [REL_18_6 · src/backend/storage/page/bufpage.c:915-919](https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/storage/page/bufpage.c#L915-L919)
Excerpt:
```text
space = (int) phdr->pd_upper - (int) phdr->pd_lower;
if (space < (int) sizeof(ItemIdData))
return 0;
space -= sizeof(ItemIdData);
```
- [REL_18_6 · doc/src/sgml/storage.sgml:766-766](https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/doc/src/sgml/storage.sgml#L766-L766)
Excerpt:
```text
entry is an (offset,length) pair. 4 bytes per item.</entry>
```
- [REL_18_6 · src/include/access/nbtree.h:65-69](https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/include/access/nbtree.h#L65-L69)
Excerpt:
```text
BlockNumber btpo_prev; /* left sibling, or P_NONE if leftmost */
BlockNumber btpo_next; /* right sibling, or P_NONE if rightmost */
uint32 btpo_level; /* tree level --- zero for leaf pages */
uint16 btpo_flags; /* flag bits, see below */
BTCycleId btpo_cycleid; /* vacuum cycle ID of latest split */
```
Finding URL: https://pgtrue.postgres.ai/shared/brief/01a1ce2f-c495-7a1c-9a29-9a37b9f15d5c#F6
### F7 · Accurate · Factual · Standard pageinspect functions require superuser privileges.
Location: excerpt · section “Setup” · as fetched 2026-11-12 · [open in article](https://boringsql.com/posts/index-storage-and-bloat#:~:text=pageinspect%20checks%20for%20a%20superuser%20inside%20every%20function)
Article says:
```text
…pageinspect checks for a superuser inside every function…
```
What is true:
The PostgreSQL 18.6 documentation restricts pageinspect functions to superusers. btreefuncs.c:273-276 enforces that restriction inside the function. Granting EXECUTE alone does not bypass this check.
Charitable reading:
The statement describes standard PostgreSQL pageinspect, not provider modifications.
Review: We tested whether an EXECUTE grant bypasses the restriction. E-26 checks superuser status inside the function, consistent with E-27. We checked whether EXECUTE grants bypass the B-tree function's restriction. btreefuncs.c checks superuser directly. The finding excludes provider modifications.
Sources:
- [REL_18_6 · contrib/pageinspect/btreefuncs.c:273-276](https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/contrib/pageinspect/btreefuncs.c#L273-L276)
Excerpt:
```text
if (!superuser())
ereport(ERROR,
(errcode(ERRCODE_INSUFFICIENT_PRIVILEGE),
errmsg("must be superuser to use pageinspect functions")));
```
- [REL_18_6 · doc/src/sgml/pageinspect.sgml:11-13](https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/doc/src/sgml/pageinspect.sgml#L11-L13)
Excerpt:
```text
The <filename>pageinspect</filename> module provides functions that allow you to
inspect the contents of database pages at a low level, which is useful for
debugging purposes. All of these functions may be used only by superusers.
```
Finding URL: https://pgtrue.postgres.ai/shared/brief/01a1ce2f-c495-7a1c-9a29-9a37b9f15d5c#F7
### F8 · Accurate · Factual · REINDEX CONCURRENTLY supports the described replacement process since PostgreSQL 12.
Location: excerpt · section “Rebuilding” · as fetched 2026-11-12 · [open in article](https://boringsql.com/posts/index-storage-and-bloat#:~:text=REINDEX%20CONCURRENTLY%20builds%20a%20fresh,without%20blocking%20reads%20or%20writes)
Article says:
```text
…REINDEX CONCURRENTLY builds a fresh copy of the index next to the old one without blocking reads or writes…
```
What is true:
REL_12_0 includes REINDEX CONCURRENTLY. The 18.6 documentation describes a replacement index and SHARE UPDATE EXCLUSIVE session locks. These locks permit ordinary reads and writes while preventing conflicting schema changes. Concurrent rebuilding performs more work and waits for relevant transactions.
Charitable reading:
The statement concerns ordinary reads and writes. Concurrent rebuilding still prevents conflicting schema changes.
Review: We checked the PostgreSQL 12 syntax separately from PostgreSQL 18.6 locking. Both pins match. The finding preserves the distinction between ordinary operations and conflicting schema changes. We checked the historical syntax and distinguished ordinary DML from schema changes. PostgreSQL 12 supports CONCURRENTLY. PostgreSQL 18.6 documents replacement and compatible locks.
Sources:
- [REL_18_6 · doc/src/sgml/ref/reindex.sgml:391-395](https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/doc/src/sgml/ref/reindex.sgml#L391-L395)
Excerpt:
```text
A new transient index definition is added to the catalog
<literal>pg_index</literal>. This definition will be used to replace
the old index. A <literal>SHARE UPDATE EXCLUSIVE</literal> lock at
session level is taken on the indexes being reindexed as well as their
associated tables to prevent any schema modification while processing.
```
- [REL_18_6 · doc/src/sgml/ref/reindex.sgml:170-172](https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/doc/src/sgml/ref/reindex.sgml#L170-L172)
Excerpt:
```text
index without taking any locks that prevent concurrent inserts,
updates, or deletes on the table; whereas a standard index rebuild
locks out writes (but not reads) on the table until it's done.
```
- [REL_12_0 · doc/src/sgml/ref/reindex.sgml:24-24](https://github.com/postgres/postgres/blob/ad1f2885b8c82e0c2d56d7974f012cbecce17a17/doc/src/sgml/ref/reindex.sgml#L24-L24)
Qualification: Version note: Checked PostgreSQL 12.0 because the article names PostgreSQL 12 as the feature floor.
Excerpt:
```text
REINDEX [ ( VERBOSE ) ] { INDEX | TABLE | SCHEMA | DATABASE | SYSTEM } [ CONCURRENTLY ] <replaceable class="parameter">name</replaceable>
```
Finding URL: https://pgtrue.postgres.ai/shared/brief/01a1ce2f-c495-7a1c-9a29-9a37b9f15d5c#F8
### F9 · Accurate · Factual · Deleted B-tree pages wait for a safe transaction horizon before reuse.
Location: Article · exact quote · [open in article](https://boringsql.com/posts/index-storage-and-bloat#:~:text=no%20scan%20can%20still%20be%20on%20its%20way%20to%20it)
Article says:
```text
…no scan can still be on its way to it…
```
What is true:
nbtpage.c:2646-2647 records the next full transaction ID when deleting a page. Lines 3048-3052 require that ID to become globally removable before recording reusable space. README:397-401 explains why another transaction can advance this boundary.
Charitable reading:
The extra transaction describes the author's run. It is not a universal transaction-count requirement.
Review: We tested whether one additional transaction universally guarantees reuse. The finding makes no such promise. E-33 explains the conservative transaction boundary. We tested whether one extra transaction guarantees reuse. The finding makes no such promise. The source documents a conservative transaction horizon.
Sources:
- [REL_18_6 · src/backend/access/nbtree/nbtpage.c:2646-2647](https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/access/nbtree/nbtpage.c#L2646-L2647)
Excerpt:
```text
safexid = ReadNextFullTransactionId();
BTPageSetDeleted(page, safexid);
```
- [REL_18_6 · src/backend/access/nbtree/nbtpage.c:3048-3052](https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/access/nbtree/nbtpage.c#L3048-L3052)
Excerpt:
```text
if (!GlobalVisCheckRemovableFullXid(heaprel, safexid))
break;
RecordFreeIndexPage(rel, target);
stats->pages_free++;
```
- [REL_18_6 · src/backend/access/nbtree/README:397-401](https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/access/nbtree/README#L397-L401)
Excerpt:
```text
dead, a deleted page is labeled with the next-transaction counter value.
VACUUM can reclaim the page for re-use when the stored XID is guaranteed
to be "visible to everyone". As collateral damage, we wait for snapshots
taken until the next transaction to allocate an XID commits. We also wait
for running XIDs with no snapshots.
```
Finding URL: https://pgtrue.postgres.ai/shared/brief/01a1ce2f-c495-7a1c-9a29-9a37b9f15d5c#F9
### F10 · Accurate · Factual · Verified accurate: “…a DELETE operation stamps xmax on the heap tuple…”
Location: Article · exact quote · [open in article](https://boringsql.com/posts/index-storage-and-bloat#:~:text=a%20DELETE%20operation%20stamps%20xmax%20on%20the%20heap%20tuple)
Article says:
```text
…a DELETE operation stamps xmax on the heap tuple…
```
What is true:
heapam.c:3123-3132 updates the heap tuple's transaction information and sets xmax. Ordinary deletion leaves index tuple removal for later cleanup. The article correctly separates deletion from VACUUM's index cleanup.
Review: We checked tuple metadata changes and deferred index deletion separately. E-34 sets xmax, and E-60 explains why index tuples remain. We checked ordinary heap deletion and deferred index cleanup. heapam.c sets xmax. nodeModifyTable.c explains why immediate index-tuple deletion cannot occur.
Sources:
- [REL_18_6 · src/backend/access/heap/heapam.c:3123-3132](https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/access/heap/heapam.c#L3123-L3132)
Excerpt:
```text
/* store transaction information of xact deleting the tuple */
tp.t_data->t_infomask &= ~(HEAP_XMAX_BITS | HEAP_MOVED);
tp.t_data->t_infomask2 &= ~HEAP_KEYS_UPDATED;
tp.t_data->t_infomask |= new_infomask;
tp.t_data->t_infomask2 |= new_infomask2;
HeapTupleHeaderClearHotUpdated(tp.t_data);
HeapTupleHeaderSetXmax(tp.t_data, new_xmax);
HeapTupleHeaderSetCmax(tp.t_data, cid, iscombo);
/* Make sure there is no forward chain link in t_ctid */
tp.t_data->t_ctid = tp.t_self;
```
- [REL_18_6 · src/backend/executor/nodeModifyTable.c:1808-1809](https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/executor/nodeModifyTable.c#L1808-L1809)
Excerpt:
```text
* take care of it later. We can't delete index tuples immediately
* anyway, since the tuple is still visible to other transactions.
```
Finding URL: https://pgtrue.postgres.ai/shared/brief/01a1ce2f-c495-7a1c-9a29-9a37b9f15d5c#F10
### F11 · Accurate · Factual · VACUUM FULL rebuilds the table's indexes during its heap rewrite.
Location: Article · exact quote · [open in article](https://boringsql.com/posts/index-storage-and-bloat#:~:text=VACUUM%20FULL%20%2C%20which%20rebuilds,table%20as%20a%20side%20effect)
Article says:
```text
…VACUUM FULL , which rebuilds every index on the table as a side effect…
```
What is true:
VACUUM FULL writes a replacement heap under ACCESS EXCLUSIVE. cluster.c:1515 calls reindex_relation during that rewrite. Targeting one bloated index with REINDEX avoids this table-wide heap rewrite.
Charitable reading:
The recommendation concerns reclaiming one bloated index rather than rewriting an entire table.
Review: We checked whether VACUUM FULL only rewrites the heap. E-35 explicitly rebuilds indexes, and E-36 establishes the replacement file and exclusive table lock. We checked whether the heap rewrite also rebuilds indexes. cluster.c calls reindex_relation. The VACUUM documentation confirms the rewrite and ACCESS EXCLUSIVE lock.
Sources:
- [REL_18_6 · src/backend/commands/cluster.c:1511-1515](https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/commands/cluster.c#L1511-L1515)
Excerpt:
```text
/* Report that we are now reindexing relations */
pgstat_progress_update_param(PROGRESS_CLUSTER_PHASE,
PROGRESS_CLUSTER_PHASE_REBUILD_INDEX);
reindex_relation(NULL, OIDOldHeap, reindex_flags, &reindex_params);
```
- [REL_18_6 · doc/src/sgml/ref/vacuum.sgml:86-90](https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/doc/src/sgml/ref/vacuum.sgml#L86-L90)
Excerpt:
```text
specify parallel workers as zero. <command>VACUUM FULL</command> rewrites
the entire contents of the table into a new disk file with no extra space,
allowing unused space to be returned to the operating system. This form is
much slower and requires an <literal>ACCESS EXCLUSIVE</literal> lock on
each table while it is being processed.
```
Finding URL: https://pgtrue.postgres.ai/shared/brief/01a1ce2f-c495-7a1c-9a29-9a37b9f15d5c#F11
### F12 · Accurate · Factual · The size queries measure the heap and index main forks.
Location: Article · exact quote · [open in article](https://boringsql.com/posts/index-storage-and-bloat#:~:text=SELECT%20pg_relation_size%28%27idx_demo%27%29%20AS%20heap_size%2C%20pg_relation_size%28%27idx_demo_value%27%29%20AS%20index_size%3B)
Article says:
```text
SELECT pg_relation_size('idx_demo') AS heap_size,
pg_relation_size('idx_demo_value') AS index_size;…
```
What is true:
The one-argument pg_relation_size wrapper selects the main fork. dbsize.c:383-388 calculates that fork's size when queried. The calls exclude visibility maps, free-space maps, and separate indexes. Their use matches the article's comparison of heap and B-tree data pages.
Charitable reading:
The labels describe the table heap and index main forks, rather than total storage including auxiliary forks.
Review: We tested whether pg_relation_size includes auxiliary forks or separate indexes. E-37 selects only the main fork. The finding states that limitation. We checked whether pg_relation_size includes auxiliary forks or separate indexes. The one-argument wrapper explicitly selects main. The finding states the correct scope.
Sources:
- [REL_18_6 · src/backend/catalog/system_functions.sql:285-289](https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/catalog/system_functions.sql#L285-L289)
Excerpt:
```text
CREATE OR REPLACE FUNCTION pg_relation_size(regclass)
RETURNS bigint
LANGUAGE sql
PARALLEL SAFE STRICT COST 1
RETURN pg_relation_size($1, 'main');
```
- [REL_18_6 · doc/src/sgml/func.sgml:30160-30161](https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/doc/src/sgml/func.sgml#L30160-L30161)
Excerpt:
```text
forks.) With one argument, this returns the size of the main data
fork of the relation. The second argument can be provided to specify
```
- [REL_18_6 · src/backend/utils/adt/dbsize.c:383-388](https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/utils/adt/dbsize.c#L383-L388)
Excerpt:
```text
size = calculate_relation_size(&(rel->rd_locator), rel->rd_backend,
forkname_to_number(text_to_cstring(forkName)));
relation_close(rel, AccessShareLock);
PG_RETURN_INT64(size);
```
Finding URL: https://pgtrue.postgres.ai/shared/brief/01a1ce2f-c495-7a1c-9a29-9a37b9f15d5c#F12
### F13 · Accurate · Factual · B-tree pages combine item identifiers, backward tuple allocation, and sibling links.
Location: Article · exact quote · [open in article](https://boringsql.com/posts/index-storage-and-bloat#:~:text=line%20pointers%2C%20tuples%20packed%20from%20the%20bottom%20up)
Article says:
```text
…line pointers, tuples packed from the bottom up…
```
What is true:
Item identifiers follow the page header and occupy 4 bytes each. PostgreSQL allocates tuple data backward from the free-space boundary. BTPageOpaqueData stores sibling block numbers. nbtsort.c constructs B-tree pages from sorted tuples.
Charitable reading:
The description concerns ordinary data pages rather than the special contents of the metapage.
Review: We checked item identifiers, tuple allocation direction, and sibling fields separately. The ordinary-page interpretation matches all three definitions. We tested whether metapage exceptions defeat the description. The finding concerns ordinary B-tree pages. The cited layout and sibling fields support it.
Sources:
- [REL_18_6 · doc/src/sgml/storage.sgml:891-895](https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/doc/src/sgml/storage.sgml#L891-L895)
Excerpt:
```text
Following the page header are item identifiers
(<type>ItemIdData</type>), each requiring four bytes.
An item identifier contains a byte-offset to
the start of an item, its length in bytes, and a few attribute bits
which affect its interpretation.
```
- [REL_18_6 · doc/src/sgml/storage.sgml:913-915](https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/doc/src/sgml/storage.sgml#L913-L915)
Excerpt:
```text
The items themselves are stored in space allocated backwards from the end
of unallocated space. The exact structure varies depending on what the
table is to contain. Tables and sequences both use a structure named
```
- [REL_18_6 · src/include/access/nbtree.h:65-69](https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/include/access/nbtree.h#L65-L69)
Excerpt:
```text
BlockNumber btpo_prev; /* left sibling, or P_NONE if leftmost */
BlockNumber btpo_next; /* right sibling, or P_NONE if rightmost */
uint32 btpo_level; /* tree level --- zero for leaf pages */
uint16 btpo_flags; /* flag bits, see below */
BTCycleId btpo_cycleid; /* vacuum cycle ID of latest split */
```
- [REL_18_6 · src/backend/access/nbtree/nbtsort.c:8-12](https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/access/nbtree/nbtsort.c#L8-L12)
Excerpt:
```text
* We use tuplesort.c to sort the given index tuples into order.
* Then we scan the index tuples in order and build the btree pages
* for each level. We load source tuples into leaf-level pages.
* Whenever we fill a page at one level, we add a link to it to its
* parent level (starting a new parent level if necessary). When
```
Finding URL: https://pgtrue.postgres.ai/shared/brief/01a1ce2f-c495-7a1c-9a29-9a37b9f15d5c#F13
### F15 · Accurate · Factual · Verified accurate: “…id integer GENERATED ALWAYS AS IDENTITY PRIMARY KEY…”
Location: excerpt · section “Setup” · as fetched 2026-11-12 · [open in article](https://boringsql.com/posts/index-storage-and-bloat#:~:text=id%20integer%20GENERATED%20ALWAYS%20AS%20IDENTITY%20PRIMARY%20KEY)
Article says:
```text
…id integer GENERATED ALWAYS AS IDENTITY PRIMARY KEY…
```
What is true:
The grammar accepts GENERATED ALWAYS AS IDENTITY. The identity sequence supplies omitted id values. generate_series includes its stop value. The largest initial multiplication, 791,900,000, fits the int4 column arithmetic used by this recipe.
Review: We checked identity syntax, omitted-value behavior, inclusive series bounds, and integer overflow. The arithmetic stays within int4. This does not establish runtime setup or permissions. We checked identity syntax, omitted-value behavior, inclusive series bounds, and integer overflow. The finding verifies these features without claiming complete recipe execution.
Sources:
- [REL_18_6 · doc/src/sgml/ddl.sgml:268-270](https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/doc/src/sgml/ddl.sgml#L268-L270)
Excerpt:
```text
If an <command>INSERT</command> command is executed on the table with the
identity column and no value is explicitly specified for the identity
column, then a value generated by the implicit sequence is inserted. For
```
- [REL_18_6 · src/backend/parser/gram.y:4015-4023](https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/parser/gram.y#L4015-L4023)
Excerpt:
```text
| GENERATED generated_when AS IDENTITY_P OptParenthesizedSeqOptList
{
Constraint *n = makeNode(Constraint);
n->contype = CONSTR_IDENTITY;
n->generated_when = $2;
n->options = $5;
n->location = @1;
$$ = (Node *) n;
```
- [REL_18_6 · src/backend/utils/adt/int.c:1590-1603](https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/utils/adt/int.c#L1590-L1603)
Excerpt:
```text
result = fctx->current;
if ((fctx->step > 0 && fctx->current <= fctx->finish) ||
(fctx->step < 0 && fctx->current >= fctx->finish))
{
/*
* Increment current in preparation for next iteration. If next-value
* computation overflows, this is the final result.
*/
if (pg_add_s32_overflow(fctx->current, fctx->step, &fctx->current))
fctx->step = 0;
/* do when there is more left to send */
SRF_RETURN_NEXT(funcctx, Int32GetDatum(result));
```
Finding URL: https://pgtrue.postgres.ai/shared/brief/01a1ce2f-c495-7a1c-9a29-9a37b9f15d5c#F15
### F17 · Accurate · Factual · PostgreSQL 12 introduced REINDEX CONCURRENTLY
Location: excerpt · section “Rebuilding” · as fetched 2026-11-12 · [open in article](https://boringsql.com/posts/index-storage-and-bloat#:~:text=Available%20since%20PostgreSQL%2012%2C%20REINDEX%20CONCURRENTLY)
Article says:
```text
…Available since PostgreSQL 12, REINDEX CONCURRENTLY…
```
What is true:
PostgreSQL 12.0 introduced REINDEX CONCURRENTLY. REL_12_0 doc/src/sgml/release-12.sgml:2048-2050 records the addition. PostgreSQL 18.6 retains the option.
Charitable reading:
The claim identifies the feature's first major release, rather than promising every later option existed in version 12.
Review: We checked the historical release directly. REL_12_0 records the addition, and REL_18_6 retains the option. We checked the first-release claim directly. REL_12_0 release notes record the addition. The separate PostgreSQL 18.6 citation confirms continued availability.
Sources:
- [REL_12_0 · doc/src/sgml/release-12.sgml:2048-2050](https://github.com/postgres/postgres/blob/ad1f2885b8c82e0c2d56d7974f012cbecce17a17/doc/src/sgml/release-12.sgml#L2048-L2050)
Qualification: Version note: Checked the stated PostgreSQL 12.0 feature floor.
Excerpt:
```text
Add <xref linkend="sql-reindex"/> <literal>CONCURRENTLY</literal>
option to allow reindexing without locking out writes (Michaël
Paquier, Andreas Karlsson, Peter Eisentraut)
```
- [REL_18_6 · doc/src/sgml/ref/reindex.sgml:170-171](https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/doc/src/sgml/ref/reindex.sgml#L170-L171)
Excerpt:
```text
index without taking any locks that prevent concurrent inserts,
updates, or deletes on the table; whereas a standard index rebuild
```
Finding URL: https://pgtrue.postgres.ai/shared/brief/01a1ce2f-c495-7a1c-9a29-9a37b9f15d5c#F17
### F18 · Accurate · Factual · Verified accurate: “…without blocking reads or writes…”
Location: excerpt · section “Rebuilding” · as fetched 2026-11-12 · [open in article](https://boringsql.com/posts/index-storage-and-bloat#:~:text=without%20blocking%20reads%20or%20writes)
Article says:
```text
…without blocking reads or writes…
```
What is true:
REINDEX CONCURRENTLY permits normal reads and writes during the rebuild. REL_18_6 doc/src/sgml/ref/reindex.sgml:170-171 confirms that its locks permit concurrent inserts, updates, and deletes. This guarantee does not eliminate resource contention.
Review: We tested a literal zero-contention interpretation. The finding limits its guarantee to normal reads and writes, consistent with the documented locks. We tested whether schema locks or resource contention refute ordinary read/write availability. They do not. The finding limits the guarantee to normal operations.
Sources:
- [REL_18_6 · doc/src/sgml/ref/reindex.sgml:391-395](https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/doc/src/sgml/ref/reindex.sgml#L391-L395)
Excerpt:
```text
A new transient index definition is added to the catalog
<literal>pg_index</literal>. This definition will be used to replace
the old index. A <literal>SHARE UPDATE EXCLUSIVE</literal> lock at
session level is taken on the indexes being reindexed as well as their
associated tables to prevent any schema modification while processing.
```
- [REL_18_6 · doc/src/sgml/ref/reindex.sgml:170-171](https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/doc/src/sgml/ref/reindex.sgml#L170-L171)
Excerpt:
```text
index without taking any locks that prevent concurrent inserts,
updates, or deletes on the table; whereas a standard index rebuild
```
Finding URL: https://pgtrue.postgres.ai/shared/brief/01a1ce2f-c495-7a1c-9a29-9a37b9f15d5c#F18
### F19 · Accurate · Factual · DELETE leaves index tuple removal to later cleanup
Location: Article · exact quote · [open in article](https://boringsql.com/posts/index-storage-and-bloat#:~:text=At%20the%20moment%20of%20deletion%2C%20nothing%20in%20the%20index%20changes)
Article says:
```text
At the moment of deletion, nothing in the index changes…
```
What is true:
Ordinary DELETE does not immediately remove the corresponding index tuples. REL_18_6 src/backend/executor/nodeModifyTable.c:1808-1809 explains that other transactions can still see the heap tuple. Later cleanup removes obsolete index entries.
Charitable reading:
The statement describes ordinary DELETE processing for the demonstrated table, without additional user-defined side effects.
Review: We checked whether DELETE immediately removes index tuples. E-60 explicitly defers removal because other transactions can still see the row. We checked whether DELETE immediately removes index tuples. nodeModifyTable.c explicitly rejects immediate deletion because other transactions can still see the tuple.
Sources:
- [REL_18_6 · src/backend/executor/nodeModifyTable.c:1808-1809](https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/executor/nodeModifyTable.c#L1808-L1809)
Excerpt:
```text
* take care of it later. We can't delete index tuples immediately
* anyway, since the tuple is still visible to other transactions.
```
Finding URL: https://pgtrue.postgres.ai/shared/brief/01a1ce2f-c495-7a1c-9a29-9a37b9f15d5c#F19
### F20 · Accurate · Factual · The default page and header sizes agree
Location: Article · exact quote · [open in article](https://boringsql.com/posts/index-storage-and-bloat#:~:text=B%2Dtree%20pages%20use%20the%20same%208KB%20skeleton%20%2824%2Dbyte%20header)
Article says:
```text
B-tree pages use the same 8KB skeleton (24-byte header…
```
What is true:
The example uses 8,192-byte pages and a 24-byte fixed header. REL_18_6 configure.ac:260 maps the default 8 kB selection to 8,192 bytes. doc/src/sgml/storage.sgml:792 confirms the header size.
Charitable reading:
The article describes the default build used by its example. We interpret 8KB as 8,192 bytes.
Review: We tested whether the finding universalizes the default block size. It explicitly describes the example. The 8,192-byte page and 24-byte header agree with source. We tested whether configurable page sizes invalidate the claim. The finding specifies the example and default. The source confirms 8,192-byte pages and 24-byte headers.
Sources:
- [REL_18_6 · configure.ac:260-260](https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/configure.ac#L260-L260)
Excerpt:
```text
8) BLCKSZ=8192;;
```
- [REL_18_6 · doc/src/sgml/storage.sgml:792-792](https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/doc/src/sgml/storage.sgml#L792-L792)
Excerpt:
```text
The first 24 bytes of each page consists of a page header
```
Finding URL: https://pgtrue.postgres.ai/shared/brief/01a1ce2f-c495-7a1c-9a29-9a37b9f15d5c#F20
### F21 · Accurate · Factual · The byte totals match the page counts
Location: Article · exact quote · [open in article](https://boringsql.com/posts/index-storage-and-bloat#:~:text=The%20index%20is%20276%20pages%3A,the%20root%2C%20and%20274%20leaves.)
Article says:
```text
…The index is 276 pages: the metapage, the root, and 274 leaves.
```
What is true:
All displayed byte totals match their page counts at 8,192 bytes per page. The index totals are 276, 385, and 243 pages. The heap total is 443 pages. contrib/pgstattuple/pgstatindex.c:350 includes page 0 in index_size.
Charitable reading:
These are physical index-file page totals, including the metapage.
Review: We checked the byte-to-page divisions and possible omission of the metapage. The totals agree, and E-65 explicitly includes page 0. We recalculated the relation-size conversions. The index totals equal 276, 385, and 243 pages. The heap equals 443 pages. pgstatindex includes the metapage.
Sources:
- [REL_18_6 · configure.ac:260-260](https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/configure.ac#L260-L260)
Excerpt:
```text
8) BLCKSZ=8192;;
```
- [REL_18_6 · contrib/pgstattuple/pgstatindex.c:350-354](https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/contrib/pgstattuple/pgstatindex.c#L350-L354)
Excerpt:
```text
(1 + /* include the metapage in index_size */
indexStat.leaf_pages +
indexStat.internal_pages +
indexStat.deleted_pages +
indexStat.empty_pages) * BLCKSZ);
```
Finding URL: https://pgtrue.postgres.ai/shared/brief/01a1ce2f-c495-7a1c-9a29-9a37b9f15d5c#F21
### F22 · Accurate · Factual · All five leaf-density percentages agree
Location: Article · exact quote · [open in article](https://boringsql.com/posts/index-storage-and-bloat#:~:text=4%20%7C%201%20%7C%202260992,0%20%7C%2089.78%20%7C%200)
Article says:
```text
… 4 | 1 | 2260992 | 3 | 1 | 274 | 0 | 0 | 89.78 | 0…
```
What is true:
The five densities agree with 20 bytes per item and 8,152 usable bytes per leaf. Each nonrightmost leaf contributes one high key. Recalculated densities are 89.78%, 18.15%, 53.97%, 64.30%, and 89.83%. contrib/pgstattuple/pgstatindex.c:309 and :360 implement the denominator and percentage.
Charitable reading:
Leaf density includes high keys and line pointers. Its denominator excludes the fixed header and B-tree trailer.
Review: We checked the denominator, line-pointer overhead, and high-key count. All five percentages agree after rounding. Arithmetic consistency does not establish measurement provenance. We recalculated all five densities using 8,152 usable bytes and one high key per nonrightmost leaf. All five percentages match after rounding.
Sources:
- [REL_18_6 · doc/src/sgml/storage.sgml:792-792](https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/doc/src/sgml/storage.sgml#L792-L792)
Excerpt:
```text
The first 24 bytes of each page consists of a page header
```
- [REL_18_6 · contrib/pgstattuple/pgstatindex.c:309-311](https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/contrib/pgstattuple/pgstatindex.c#L309-L311)
Excerpt:
```text
max_avail = BLCKSZ - (BLCKSZ - ((PageHeader) page)->pd_special + SizeOfPageHeaderData);
indexStat.max_avail += max_avail;
indexStat.free_space += PageGetExactFreeSpace(page);
```
- [REL_18_6 · contrib/pgstattuple/pgstatindex.c:360-362](https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/contrib/pgstattuple/pgstatindex.c#L360-L362)
Excerpt:
```text
if (indexStat.max_avail > 0)
values[j++] = psprintf("%.2f",
100.0 - (double) indexStat.free_space / (double) indexStat.max_avail * 100.0);
```
- [REL_18_6 · doc/src/sgml/storage.sgml:766-766](https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/doc/src/sgml/storage.sgml#L766-L766)
Excerpt:
```text
entry is an (offset,length) pair. 4 bytes per item.</entry>
```
- [REL_18_6 · src/include/access/nbtree.h:65-69](https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/include/access/nbtree.h#L65-L69)
Excerpt:
```text
BlockNumber btpo_prev; /* left sibling, or P_NONE if leftmost */
BlockNumber btpo_next; /* right sibling, or P_NONE if rightmost */
uint32 btpo_level; /* tree level --- zero for leaf pages */
uint16 btpo_flags; /* flag bits, see below */
BTCycleId btpo_cycleid; /* vacuum cycle ID of latest split */
```
Finding URL: https://pgtrue.postgres.ai/shared/brief/01a1ce2f-c495-7a1c-9a29-9a37b9f15d5c#F22
### F23 · Accurate · Factual · The modular generator produces the displayed distinct count and bounds
Location: excerpt · section “Setup” · as fetched 2026-11-12 · [open in article](https://boringsql.com/posts/index-storage-and-bloat#:~:text=SELECT%20%28i%20%2A%207919%29%20%25,FROM%20generate_series%281%2C%20100000%29%20AS%20i)
Article says:
```text
…SELECT (i * 7919) % 100003
FROM generate_series(1, 100000) AS i…
```
What is true:
The formula produces 100,000 distinct integer values. Its minimum is 1 and maximum is 100002. Multiplication by 7919 permutes residues modulo 100003 because their greatest common divisor is 1.
Charitable reading:
The distinctness claim applies to the stated input interval of 1 through 100,000.
Explanation: Checked for internal consistency: the evidence is the article itself.
Review: We checked coprimality and the omitted residues rather than assuming permutation proves the displayed bounds. Neither 1 nor 100002 is omitted. We checked coprimality and the omitted residues. The omitted values are 0, 84165, and 92084. The displayed distinct count and bounds follow.
Finding URL: https://pgtrue.postgres.ai/shared/brief/01a1ce2f-c495-7a1c-9a29-9a37b9f15d5c#F23
### F24 · Accurate · Factual · Verified accurate: “… 9 \| (347,113) \| 16 \| 08 00 00 00 00 00 00 00…”
Location: Article · exact quote · [open in article](https://boringsql.com/posts/index-storage-and-bloat#:~:text=9%20%7C%20%28347%2C113%29%20%7C%2016,00%2000%2000%2000%2000)
Article says:
```text
… 9 | (347,113) | 16 | 08 00 00 00 00 00 00 00…
```
What is true:
Key 8 retains ctid (347,113) across the two displayed rows. Its item offset changes from 9 to 2. These quotations establish consistency for key 8, not the other entries.
Explanation: Checked for internal consistency: the evidence is the article itself.
Review: We compared both recorded rows. They establish consistency for key 8. Neither quotation records key 9 or high key 367. We compared repeated keys and distinguished item offsets from heap pointers. The displayed pointers remain consistent. This finding verifies transcript consistency, not successful execution.
Finding URL: https://pgtrue.postgres.ai/shared/brief/01a1ce2f-c495-7a1c-9a29-9a37b9f15d5c#F24
## Notes (not graded) (3)
### F2 · Note · · Note: “Page 1 will only accept new values between 1 and 366…”
Location: Article · exact quote · [open in article](https://boringsql.com/posts/index-storage-and-bloat#:~:text=Page%201%20will%20only%20accept,values%20between%201%20and%20366)
Article says:
```text
Page 1 will only accept new values between 1 and 366…
```
What is true:
Page 1 also accepts 0 and negative integer keys before a split. nbtsearch.c:683-685 treats the first downlink as minus infinity. The example inserts positive keys, and the article elsewhere correctly describes the boundary as everything below 367. This wording does not change the demonstrated reuse behavior.
So what:
Include values below 1 when estimating reusable space in the leftmost leaf before choosing REINDEX.
Explanation: Not graded: no reader would act differently on it.
Review: The lower-bound correction is valid. We tested the positive-key reading and the article's earlier explanation that this leaf accepts everything below 367. The evidence does not establish the claimed unnecessary rebuild consequence. We checked the positive-key example and minus-infinity separator. The boundary correction stands. The evidence does not establish unnecessary rebuilding from this example.
Sources:
- [REL_18_6 · src/backend/access/nbtree/nbtsearch.c:683-685](https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/access/nbtree/nbtsearch.c#L683-L685)
Excerpt:
```text
* CRUCIAL NOTE: on a non-leaf page, the first data key is assumed to be
* "minus infinity": this routine will always claim it is less than the
* scankey. The actual key value stored is explicitly truncated to 0
```
- [REL_18_6 · src/backend/access/nbtree/nbtsearch.c:683-685](https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/access/nbtree/nbtsearch.c#L683-L685)
Excerpt:
```text
* CRUCIAL NOTE: on a non-leaf page, the first data key is assumed to be
* "minus infinity": this routine will always claim it is less than the
* scankey. The actual key value stored is explicitly truncated to 0
```
Finding URL: https://pgtrue.postgres.ai/shared/brief/01a1ce2f-c495-7a1c-9a29-9a37b9f15d5c#F2
### F3 · Note · · BTMetaPageData stores more than the root block and level.
Location: Article · exact quote · [open in article](https://boringsql.com/posts/index-storage-and-bloat#:~:text=only%20records%20where%20the%20root%20is)
Article says:
```text
…only records where the root is…
```
What is true:
BTMetaPageData also stores fast-root information and cleanup metadata. src/include/access/nbtree.h:110-115 defines those fields. The article's root lookup remains correct for its example.
Charitable reading:
The article focuses on the two metapage fields needed to explain its two-level tree.
Explanation: Not graded: knowing this would not change what a reader does.
Review: We tested whether the omitted fields affect the example. They do not. E-20 confirms additional fields, and the finding already treats this as a note. We tested the contextual simplification. BTMetaPageData contains additional fields. The existing note preserves the example's correct root lookup.
Sources:
- [REL_18_6 · src/include/access/nbtree.h:110-115](https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/include/access/nbtree.h#L110-L115)
Excerpt:
```text
BlockNumber btm_fastroot; /* current "fast" root location */
uint32 btm_fastlevel; /* tree level of the "fast" root page */
/* remaining fields only valid when btm_version >= BTREE_NOVAC_VERSION */
/* number of deleted, non-recyclable pages during last cleanup */
uint32 btm_last_cleanup_num_delpages;
```
Finding URL: https://pgtrue.postgres.ai/shared/brief/01a1ce2f-c495-7a1c-9a29-9a37b9f15d5c#F3
### F16 · Note · · pgstattuple grants function execution to pg_stat_scan_tables by default.
Location: excerpt · section “Setup” · as fetched 2026-11-12 · [open in article](https://boringsql.com/posts/index-storage-and-bloat#:~:text=By%20default%2C%20both%20require%20a%20superuser)
Article says:
```text
By default, both require a superuser…
```
What is true:
Installation privileges differ from execution privileges. The pgstattuple installation script grants pgstatindex execution to pg_stat_scan_tables. A member of that role can call the function without becoming a superuser. The article correctly recognizes that pgstattuple access can be granted.
Charitable reading:
Both extension installations require elevated privileges. The following clause already acknowledges grants for pgstattuple.
Explanation: Not graded: knowing this would not change what a reader does.
Review: We tested the distinction between installation and execution privileges. E-47 grants execution to pg_stat_scan_tables. The finding appropriately remains a note. We checked whether installation and execution privileges were conflated. The default role grant exists. The note acknowledges the article's following qualification.
Sources:
- [REL_18_6 · doc/src/sgml/pgstattuple.sgml:17-18](https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/doc/src/sgml/pgstattuple.sgml#L17-L18)
Excerpt:
```text
restricted by default. By default, only the
role <literal>pg_stat_scan_tables</literal> has <literal>EXECUTE</literal>
```
- [REL_18_6 · contrib/pgstattuple/pgstattuple--1.4--1.5.sql:36-37](https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/contrib/pgstattuple/pgstattuple--1.4--1.5.sql#L36-L37)
Excerpt:
```text
REVOKE EXECUTE ON FUNCTION pgstatindex(text) FROM PUBLIC;
GRANT EXECUTE ON FUNCTION pgstatindex(text) TO pg_stat_scan_tables;
```
Finding URL: https://pgtrue.postgres.ai/shared/brief/01a1ce2f-c495-7a1c-9a29-9a37b9f15d5c#F16
## Withdrawn findings (0)
None.
## Section checks
- Introduction · A · 2 verified-accurate · 100% of claims (11 of 11, plus 1 that need data we do not have)
- Setup · A · 3 verified-accurate · 94% of claims (18 of 19, plus 3 that need data we do not have)
- Delete and vacuum · A · 4 verified-accurate · 90% of claims (18 of 20, plus 13 that need data we do not have)
- Leaf contents · A · 3 verified-accurate · 100% of claims (41 of 41, plus 4 that need data we do not have)
- Key routing · A · none · 100% of claims (20 of 20, plus 2 that need data we do not have)
- New keys · A · 1 verified-accurate · 96% of claims (27 of 28, plus 7 that need data we do not have)
- Empty leaves · A · 3 verified-accurate · 90% of claims (20 of 22, plus 11 that need data we do not have)
- Rebuilding · B+ · 1 misleading · 3 verified-accurate · 94% of claims (16 of 17, plus 1 that need data we do not have)
## Claim coverage
- Introduction: 11 of 11 Postgres claims checked, plus 1 that need data we do not have; not counted: 1 product or opinion, 4 not a claim
- Visualizer: 1 of 1 Postgres claims checked, plus 1 that need data we do not have; not counted: 2 product or opinion, 1 not a claim
- Setup: 18 of 19 Postgres claims checked, plus 3 that need data we do not have; not counted: 1 not a claim; not checked: 1 for other reasons
- Delete and vacuum: 18 of 20 Postgres claims checked, plus 13 that need data we do not have; not counted: 3 duplicate, 1 not a claim; not checked: 2 for other reasons
- Leaf contents: 41 of 41 Postgres claims checked, plus 4 that need data we do not have; not counted: 1 duplicate
- Key routing: 20 of 20 Postgres claims checked, plus 2 that need data we do not have; not counted: 1 duplicate, 1 not a claim
- New keys: 27 of 28 Postgres claims checked, plus 7 that need data we do not have; not counted: 4 duplicate; not checked: 1 for other reasons
- Empty leaves: 20 of 22 Postgres claims checked, plus 11 that need data we do not have; not counted: 1 product or opinion; not checked: 2 for other reasons
- Rebuilding: 16 of 17 Postgres claims checked, plus 1 that need data we do not have; not counted: 2 product or opinion, 1 duplicate; not checked: 1 for other reasons
- Footer: no checkable claims; not counted: 2 product or opinion, 2 not a claim
## What we did not check
- We did not execute the SQL recipes or reproduce the displayed measurements.
- We did not verify extension installation and execution privileges on managed database services.
- We did not check the implementations of the linked third-party rebuild tools.
- We did not inspect the article's B-tree diagrams.
- We did not reproduce the PostgreSQL 18.6 measurements or verify that every displayed result came from one session.
- We did not verify the extension privileges of the unnamed managed PostgreSQL service.
- We did not check the SQL recipes' complete setup, permissions, dependencies, or runtime effects.
- We did not read the article's B-tree diagrams.
- We did not complete the claims about heap free-space reuse or physical B-tree file truncation.
- We did not reproduce the PostgreSQL 18.6 session or independently verify its execution history.
- We did not verify the earlier 60,000-row trial.
- We did not execute the SQL recipes or verify their dependencies, permissions, and runtime effects.
- We did not inspect the B-tree diagram images.
- We did not verify concurrent REINDEX disk requirements under active writes.
- reproducibility: benchmark check did not finish
- central claim: evidence check did not finish
- Applicable: we did not complete every applicable check.
- Consistent: we did not complete every applicable check.
- Transparent: we did not complete every applicable check.
- Safe: we did not complete every applicable check.
- Transparent: claims sourced check did not finish.
- Transparent: claims dated check did not finish.
- Transparent: interest disclosed check did not finish.
- Transparent: author dated check did not finish.
- experiments: check did not finish
- production actions: check did not finish
- benchmark: check did not finish
- Script syntax was not checked in this earlier run.
## Notes
- A- — the findings address the article's main subject. What we did not check is listed below. The findings directly check PostgreSQL 18.6 page layout, key routing, deletion, page reuse, split behavior, and rebuilding.
- We did not check everything in this article. What we did not check is listed below, in the words we recorded at the time. None of it moved the letter. We never charge our own limits to the article.
- We held back some findings this audit's coverage rested on, because we could not stand behind their sources. The letter rests on the findings that remain.
- Average of 5 axes: 3.86 · worst of factual, consistent: B+ · result A-
- Some explanatory text is not shown in this edition; the grade and findings are complete.
- Some checks did not happen for this edition, and each one we know of is listed above.
- Checked against: github.com/postgres/postgres REL_18_6 at commit 724edf9bde9d356724ad384a2e196edc3c9f80f7 (pinned target); https://boringsql.com/posts/delete-4tb/ (fetched 2026-11-12T04:49:49.963393Z); https://boringsql.com/posts/hot-updates/ (fetched 2026-11-12T04:49:34.345562Z); https://boringsql.com/posts/inside-the-8kb-page/ (fetched 2026-11-12T04:49:30.809548Z); https://boringsql.com/posts/postgresql-mvcc-byte-by-byte/ (fetched 2026-11-12T04:49:32.486568Z); https://boringsql.com/posts/the-bloat-busters-pg-repack-pg-squeeze/ (fetched 2026-11-12T04:49:44.748077Z); https://boringsql.com/posts/vacuum-at-the-page-level/ (fetched 2026-11-12T04:49:36.215963Z); https://boringsql.com/posts/vacuum-is-lie/ (fetched 2026-11-12T04:49:38.131599Z); https://boringsql.com/tags/deep-dive/ (fetched 2026-11-12T04:49:48.130271Z); https://boringsql.com/tags/internals/ (fetched 2026-11-12T04:49:46.418367Z); https://boringsql.com/visualizers/btree-index/ (fetched 2026-11-12T04:49:40.087264Z).
- Article captured 2026-11-12T04:49:11.214071Z · SHA-256 737b47940fa356249bb936795639b28206f41dcfd8978c497d885c52da458a07 · Text extracted from the article's HTML.
- Policy SHA-256 be548be42f4d25f1d3be5224412da42ea7177456c3bf8867e1ebc94357a77296 · Grading rules SHA-256 6fb334e79d6b9e7ed81d3238cc10d9de602ff87ed65ff2fa781f53bac5798765.
- We did not execute the SQL recipes or reproduce the PostgreSQL 18.6 measurements and session history.
- We did not check the SQL recipes' complete setup, dependencies, permissions, or runtime effects.
- SQL syntax checks were unavailable. Source inspection of individual features does not establish that the complete recipes execute.
- We did not verify extension installation or execution privileges on managed database services.
- We did not check the implementations of the linked third-party rebuild tools.
- We did not inspect the article's B-tree diagram images. We checked their surrounding extracted text.
- We did not independently verify heap free-space reuse or physical B-tree file truncation.
- We did not verify the earlier 60,000-row trial or concurrent REINDEX disk requirements under active writes.
- The linked article listings give November 10, 2026, without a publication time. We represent that date at midnight UTC.
- article target version: bound to the most-cited major; also named 12 (1×)
- withheld: F14 — this finding failed a check this edition requires.
- review: the findings were written by one model and reviewed independently by a different model.
- 8 passages in this edition fell short of our own plain-English rules.
- Built from the article text captured above, one pinned source tree, and 10 fetched pages.
- 21 survived · 2 weakened · 0 withdrawn.
## Edition changes
- F1 · recalibrated.
- F2 · weakened.
- F3 · recalibrated.
- F4 · recalibrated.
- F5 · recalibrated.
- F6 · recalibrated.
- F7 · recalibrated.
- F8 · recalibrated.
- F9 · recalibrated.
- F10 · recalibrated.
- F11 · recalibrated.
- F12 · recalibrated.
- F13 · recalibrated.
- F15 · recalibrated.
- F16 · recalibrated.
- F17 · recalibrated.
- F18 · recalibrated.
- F19 · recalibrated.
- F20 · recalibrated.
- F21 · recalibrated.
- F22 · recalibrated.
- F23 · recalibrated.
- F24 · weakened.
## Revision history
- [Revision 1](https://pgtrue.postgres.ai/shared/brief/01a1ce2f-c495-7a1c-9a29-9a37b9f15d5c?v=1) · 2026-11-12 04:49 UTC · A- · audited with v1.1.6
Article as first submitted. 19 accurate · 1 wrong · 1 caveat.
ElephantSeal: A-. Open: central claim not checked.
Changes: First audit. Open: F1 “Plain REINDEX blocks planning for reads beyond the rebuilt index.” (misleading); F2 “The leftmost leaf also accepts integer keys below 1.” (mostly accurate).
- [Revision 2](https://pgtrue.postgres.ai/shared/brief/01a1ce2f-c495-7a1c-9a29-9a37b9f15d5c?v=3) · this page · 2026-11-12 04:49 UTC · A- · audited with v1.1.6
Same article text, re-audited. 19 accurate · 1 wrong · 0 caveats.
ElephantSeal: A-. Open: central claim not checked.
Changes: No longer reported: “The leftmost leaf also accepts integer keys below 1.”. New: none.