Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Upgrade pgvector to 0.7.0.
This PR is based on Heikki's PR #6753 and just uses pgvector 0.7.0 instead of 0.6.0
I have now done all planned manual tests.
The pull request is ready to be reviewed and merged and can be deployed in production together / after swap enablement.
See (neondatabase/autoscaling#800)
Fixes #6516
Fixes #7780
Documentation input for usage recommendations
maintenance_work_mem
In Neon
maintenance_work_mem
is very small by default (depends on configured RAM for your compute but can be as low as 64 MB).To optimize pgvector index build time you may have to bump it up according to your working set size (size of tuples for vector index creation).
You can do so in the current session using
SET maintenance_work_mem='10 GB';
The target value you choose should fit into the memory of your compute size and not exceed 50-60% of available RAM.
The value above has been successfully used on a 7CU endpoint.
max_parallel_maintenance_workers
max_parallel_maintenance_workers is also small by default (2). For efficient parallel pgvector index creation you have to bump it up with
SET max_parallel_maintenance_workers = 7
to make use of all the CPUs available, assuming you have configured your endpoint to use 7CU.
ID input for changelog
pgvector extension in Neon has been upgraded from version 0.5.1 to version 0.7.0.
Please see https://github.com/pgvector/pgvector/ for documentation of new capabilities in pgvector version 0.7.0
If you have existing databases with pgvector 0.5.1 already installed there is a slight difference in behavior in the following corner cases even if you don't run
ALTER EXTENSION UPDATE
:L2 distance from NULL::vector
For the following script, comparing the NULL::vector to non-null vectors the resulting output changes:
and now the output is
For the following script
the output now is
changed error messages
If you provide invalid literals for datatype vector you may get improved/changed error messages, for example: