-- pg_turbovec v1.27.0 -- Phase Q-0: de-duplicate the on-disk codes -- storage (drop the persisted SIMD-blocked chain). -- -- This file is a *reference mirror*. The authoritative install script -- is generated by `cargo pgrx schema`. -- -- WIRE-FORMAT CHANGE -- REINDEX REQUIRED for all pre-v7 indexes. -- -- Every prior version persisted each vector's quantized codes TWICE: -- the row-major bit-plane `packed_codes` chain AND the SIMD-`blocked` -- chain (the output of `pack::repack(packed_codes, ...)`). That -- doubled the dominant O(n) storage term. Since the blocked layout is -- a PURE FUNCTION of the packed codes, v7 drops the blocked chain -- entirely and recomputes it once per backend at index-open via -- `pack::repack` (the same one-time compute a pre-Phase-P index -- already paid on first scan; per-query cost is unchanged). This -- roughly HALVES the per-vector on-disk footprint -- clearing the -- storage blocker for large single-node indexes. -- -- This is NOT additive. A v7 relfile has no blocked chain, so it is -- not byte-compatible with any prior version FOR ANY KIND -- (single-vector, ColBERT, or graph). Unlike the v4->v5->v6 additive -- per-kind bumps, EVERY kind now emits wire version 7 (the `kind` byte -- still discriminates single/colbert/graph). A pre-v7 index (v1..v6) -- is detected by `MetaPageData::is_legacy_v6()` (version < 7) and -- `ambeginscan` (and amgettuple's first fetch) raises a clear ERROR -- that NAMES the index with a `HINT: REINDEX INDEX ;` -- never -- silent corruption. -- -- No SQL surface change (no operators, types, functions, GUCs, or -- opclasses added or removed) -- this is a storage-layout change only. -- Scan results (recall, ordering) are IDENTICAL to before for a -- freshly-built index: the blocked layout recomputed from the packed -- codes is bit-identical to the layout that used to be persisted. -- -- Migration: -- 1. `ALTER EXTENSION pg_turbovec UPDATE TO '1.27.0';` -- 2. `REINDEX INDEX ;` -- once per turbovec index, ANY kind. -- Until an index is REINDEXed under v7, scans against it ERROR with -- the REINDEX hint (they do NOT return wrong results). See -- docs/UPGRADING.md.