From: chenqin (@chenqin) <noreply+chenqin@github.com>
To: pgvector/pgvector <noreply+pgvector-pgvector@github.com>
Subject: [pgvector/pgvector] PR #1054: Plan: immutable forward and inverted indexes sharing the GPU worker's ordinals
Date: Sun, 01 Nov 2026 14:52:32 +0000
Message-ID: <gh-pgvector-pgvector-1054@github.com> (raw)
▎ Adds docs/ann-immutable-indexes-plan.md, a proposal for a frozen ann index whose pages hold the forward (TID, vector, attribute) and inverted (postings, bitsets) structures by the same ordinal the cuVS worker uses, so one filtered query can run over all three indexes:
▎
▎ - One ordinal space (rank of key), with a generation id in the metapage and manifest, checked on load and folded into bitmap ids.
▎ - Freeze contract: WITH (frozen = true, key = ...), all-frozen visibility-map check at build, aminsert refusal, guard trigger; new rows via a hot partition and generation switch (links the cuVS plan §8).
▎ - Planner route: indexed predicates parsed into a program sent as operation 22; the worker evaluates, caches by hash and routes as for cached bitmaps, so no filter CPU work returns to PostgreSQL. Index-only projection of id, INCLUDE columns, vector and distance.
▎ - Page layouts by ordinal, ann_index_export feeding the CAGRA builder, a shared ann/filter.c evaluator, and the ordinals-in-replies decision behind a flag.
▎ - Four phases with correctness and performance gates.
▎
▎ Also links the plan from docs/README.md and the open-items note in docs/ann-gpu-filters.md, and fixes the cuVS plan's status line that still called CAGRA deferred.