-- pg_turbovec v1.15.0 -- Phase C follow-up: operator-path allowlist. -- -- This file is a *reference mirror*. The authoritative install -- script is generated by `cargo pgrx schema`. -- -- v1.15.0 brings the in-kernel allowlist pushdown -- previously only -- available via the flat turbovec.knn(..., allowed) FUNCTION -- to the -- normal index-AM ORDER BY emb <=> q LIMIT k operator path, on BOTH -- flat AND IVF indexes (and the out-of-core cell-scoped path): -- -- 1. New session GUC turbovec.allowlist (string, default ''): a CSV -- of heap TIDs (encoded as bigint). When set, the scan ANDs the -- allowed slots into the slot mask it hands the SIMD kernel, so -- the kernel short-circuits 32-vector blocks with no allowed -- slot before any LUT work (the same block-skip knn() gets). On -- an IVF index the allowlist is ANDed with the probed-cell mask, -- scoping the skip to probed cells AND allowed slots. Empty/unset -- GUC is the exact prior behaviour with zero added cost. Set it -- with SET / set_config() around the query; RESET to clear. -- -- 2. New function turbovec.tid_to_bigint(tid) -> bigint: the -- ergonomic encoder for building the allowlist from ctid -- (returns the (block << 32) | offset value the AM stores per -- slot). cargo pgrx schema emits its CREATE FUNCTION into the -- authoritative 1.14.0--1.15.0 upgrade script; this reference -- mirror does not duplicate it. -- -- NOTE: the allowlist is a set of heap TIDs, not an id-column -- the -- index AM keys vectors by heap TID, not by any heap id column. -- turbovec.knn(..., allowed) remains the id-column path. This is a -- pre-materialized id-set channel, NOT arbitrary-WHERE pushdown. See -- docs/FILTERING.md sections 3.5, 6, and 7. -- -- The on-disk relfile format is UNCHANGED (MetaPageData::version = 4); -- the new GUC + function are purely additive, and there is no -- index-AM scan-key reinterpretation (the dangerous amrescan rewrite -- is avoided). There is no on-disk migration. `ALTER EXTENSION -- pg_turbovec UPDATE TO '1.15.0';` resolves cleanly. No REINDEX is -- needed -- existing indexes work unchanged.