Three history dots face one active seat slot; a red barrier blocks a reactivation arrow from entering the occupied slot.

Partial uniqueness protects the active subset

A partial index stores entries only for rows satisfying its predicate. This can reduce index size when the useful subset is small, but it can also enforce a rule that applies only to that subset. For example, a seat may have many historical reservations while allowing at most one active reservation. A partial unique index expresses that rule at the database boundary. ...

October 15, 2027 · 5 min · XB Field Notes
A B-tree entry uses sku 4321 as the search key and stores price 43215 as payload. The heap page’s all-visible bit gates returning the indexed price or visiting the heap. An Index Only Scan can still access the heap.

Covering indexes can avoid heap visits

A covering index contains the values needed by a particular query. PostgreSQL can sometimes return those values through an index-only scan, avoiding heap visits for qualifying rows. The word “sometimes” matters: having the columns is a structural requirement, while visibility information determines whether execution can actually skip the heap. An Index Only Scan label alone does not prove zero table access. ...

October 14, 2027 · 4 min · XB Field Notes
A schematic contrasts direct table-row traversal with adjacent non-covering index entries that each lead to table payload lookups. The five drawn rows are schematic, not the fixture population or a timing result.

Full table scans can win on small tables

An index trades storage and write work for a possible reduction in read work. A full scan can win when the table is small or a predicate selects much of it, but neither row count nor selectivity decides alone. Projection, ordering, caching, row width, and available access paths change the comparison. Start with the query’s actual result contract. ...

September 16, 2027 · 5 min · XB Field Notes
Within a tenant-first B-tree, time values are sorted inside each tenant group. The predicate tenant equals two and happened between 100 and 120 selects the contiguous values 102, 106, 110, 114 and 118 from tenant two only.

Composite indexes match multi-column queries

A composite B-tree index orders tuples by its first key, then by the next key within each first-key group. This structure can make a tenant-specific time range cheap to locate. The useful rule is about how much index space a predicate narrows, not a prohibition against mentioning later columns or writing WHERE conditions in a different textual order. ...

September 15, 2027 · 5 min · XB Field Notes
Rows 100 and 200 have state ready and enter ready_jobs; done row 101 is excluded. Query conditions must imply state equals ready.

Prepared plans must prove a partial-index predicate

A queue with a hundred ready jobs and thousands of completed jobs can benefit from an index containing only ready work. PostgreSQL calls this a partial index: its predicate determines which table rows have entries. The benefit depends on the actual query population and write pattern, not simply on making every index smaller. ...

October 17, 2026 · 4 min · XB Field Notes