-- pg_turbovec v1.26.0 -- Phase G-2d(a): partitioned/merge parallel -- build for the graph index kind. -- -- This file is a *reference mirror*. The authoritative install script -- is generated by `cargo pgrx schema`. -- -- NO wire-format change (stays VERSION 6, byte-identical on-disk CSR). -- Existing v4/v5/v6 indexes all decode unchanged. NO REINDEX. -- -- New SQL surface (additive, minor bump): one new GUC, -- `turbovec.graph_build_partitions` (int; default 0 = auto). No new -- operators, types, functions, or opclasses. -- -- What it does (build-time only): the single-pass Vamana build for -- WITH (graph = true) indexes is serial by necessity and did not -- complete at 5M rows. This adds -- a structurally-parallel build: partition the corpus into P shards -- (contiguous ranges of the deterministic shuffled insertion order), -- build each shard's sub-graph in parallel across the bounded rayon -- pool, then stitch via a parallel cross-shard refinement pass -- (greedy-search the merged graph from a global medoid entry + -- RobustPrune per node) and a deterministic parallel reverse-edge -- pass. It emits the IDENTICAL on-disk CSR shape a single-pass build -- does -- no persisted bridge edges, no wire change. -- -- Measured: recall parity (partitioned matches or BEATS single-pass: -- 0.958 -> 0.996 R@10 in a findable regime), ~8x parallel build -- speedup (P=16, 200k rows, 8-core box), bit-identical determinism -- across (corpus, seed, P) and across rayon pool sizes. -- -- turbovec.graph_build_partitions: auto (default) derives P from -- corpus size + build-pool budget (single-pass below a threshold); -- 0/1 forces single-pass; N forces N shards. -- -- Migration: `ALTER EXTENSION pg_turbovec UPDATE TO '1.26.0';`. No -- REINDEX -- existing graph indexes are unaffected; the parallel build -- only changes how NEW graph indexes are constructed, to the identical -- on-disk shape.