Repository navigation
·
1 commit
to main
since this release
Immutable
release. Only release title and notes can be modified.
Highlights
This release follows 0.1.0 with new features, faster queries, a more
compact index and bug fixes. It is still alpha quality. The on-disk
format changed, so every prism index has to be rebuilt with REINDEX
after the upgrade.
- Wider vectors. PRISM indexes vectors of up to 8192 dimensions, up
from 1968. Up to 1968 any dimension works. Above that the dimension
must be a power of two times an odd factor of at most 8, such as
2048, 3072, 4096, 6144 or 8192. Inner-product indexes stop lower
(see Known issues). The README's "Dimensions" section has the
details. - A more compact index. A posting list's codes now run on from one
page to the next. Before, each group of codes had to fit whole on a
page, which could leave up to half of the page empty. Each list also
stores its reference vector as float16, half the size. Fewer pages
per list means fewer pages read per query. - Faster queries. Fastscan scoring now applies at every dimension. It
used to stop at 944. Queries with a largeLIMITno longer slow
down out of proportion to theLIMIT
(#369, #373). l2_normandvector_dimstake pgvector's names, so the same query
works on pgvector and pg_vectorsearch columns.
New index option:
posting_reference_format(float16orfloat32, default
float16) sets how each posting list stores its reference vector.
The build or a split fails if an element of a reference is beyond
65504, float16's largest value. Usefloat32then. Vectors with an
L2 norm up to 65504, and every cosine index, are always safe.
Breaking changes & upgrade notes
- Indexes must be rebuilt. The on-disk index format changed (0x06 -> 0x07),
so indexes built by earlier versions are rejected at open and have to be
recreated. vec32_normis renamed tol2_norm, for bothvec32andvec16.
vec32_dims(vec16)is renamed tovec16_dims.vec32_dims(vec32)
keeps its name. Queries that call the old names must change. Views
and indexes that use them keep working, because a rename keeps the
function's OID.vec16refuses a value float16 cannot hold (beyond about ±65504) with
an "out of range" error, as pgvector'shalfvecdoes.
Upgrade from 0.1.0 with ALTER EXTENSION pg_vectorsearch UPDATE. Run it
in a new session that has not used the extension yet. The 0.2.0 library
refuses to load next to the 0.1.0 one. Then REINDEX each prism index.
Known issues
- A
WHEREfilter can return fewer rows thanLIMITwhen the rows
that pass are not spread through the candidates the scan ranked. The
scan does not go back for more
(#188). - The number of rows an ordered scan can return is capped by a buffer
sized fromwork_mem. A largerLIMIT, or noLIMITat all, is
silently truncated to what fits (or to the table's estimated row
count, if smaller). Raisework_memto return more rows. prism_rebalanceleaves the posting lists it replaced on disk. Only
REINDEXreclaims that space
(#224).- Setting
prism.leaf_refine_thresholdabove 0 can build an index with
much lower recall. Leave it at 0
(#183). - An inner-product index is limited to 1968 dimensions on a
vec32
column and 3584 on avec16column.CREATE INDEXfails above
that. Use L2 or cosine for wider vectors. Normalized embeddings rank
the same under cosine. prismrefuses unlogged tables and expression indexes.
Thanks
- @pavanmanishd for reporting and fixing two slowdowns in queries with
a largeLIMIT
(#371, #372) - @andreespirela for adding support for vectors of up to 8192
dimensions (#370) - @rebasedming for fixing memory growth in parallel index builds on
toasted vectors (#417)
Changes
- Indexes on vectors of up to 8192 dimensions
(25e4dea) - Posting-list codes continue across pages, so pages are filled and
fastscan works at every dimension
(526c1bd) - Posting lists store their reference vector as float16, with the
posting_reference_formatindex option to keep float32
(ae2a75f) - Faster queries with a large
LIMIT. Collecting and deduplicating
the candidates no longer grows faster than theLIMITdoes
(5876aaf,
e7595f6) - Faster searches from less per-page overhead in the centroid search
and the fastscan posting scan
(9f90dda,
136c4a2) - Faster
vec32andvec16distance operators on ARM (NEON)
(29870c9) - Fixed wrong results from a scan after another session converted a
posting list to the fastscan layout
(d9281db) - Fixed a scan missing a row that had been HOT-updated, and a split
dropping rows that an older snapshot still needed
(1ffa59f) - Fixed a scan left open across a
prism_rebalance, such as a cursor,
reading freed memory
(32f0091) - Fixed parallel index builds on toasted vectors growing memory
without bound
(93567fd) - The
prism_*inspection and maintenance functions error on an index
that is not aprismindex instead of misreading it
(ca2ea61) - Fixed a role with no privileges on a table being able to block
VACUUMand DDL on it by calling a maintenance procedure
(4bd921d)