Pgvector v0.5.0 is being released in the next 2 weeks with HNSW index support, which is a huge improvement over previous indexes both in terms of recall and maintenance requirements. With the rise of AI / embeddings based solutions, is there a plan to get this into Cloud SQL when it is released? I believe that the extension right now is v0.4.2 when you enable it.
pgvector v0.5.0 has been released in the meantime. We would be very interested in getting support for the new pgvector version in CloudSQL. As the current IVFFlat index does not fulfill our performance requirements, potentially leading us away from CloudSQL for this specific use case.
@ms4446 thanks for the note on pgvector v0.5.0 availability for AlloyDB. I have AlloyDB Omni installed on my system: could you please provide the command to run to upgrade the extension to v0.5.0? Thank you!
Extract the downloaded archive. Ensure it contains the necessary files for installation, typically a .sql file and possibly a shared library (*.so file), depending on pgvector’s distribution format.
Create a Custom Docker Image
Start with a base Docker image. Verify if alloydb/omni is available and suitable for customization.
Copy the pgvector installation files into the Docker image. For example, place them in /opt/pgvector. Note: The actual installation of the pgvector extension (running SQL commands) should occur within the running database environment, not during the Docker image build process.
Build and Run the Custom Docker Image
Use the docker build command to build your custom Docker image, specifying the path to your Dockerfile.
Run the image using the docker run command, including necessary environment variables and mounting volumes as needed.
Load the pgvector Extension in AlloyDB Omni
Connect to your AlloyDB Omni instance using psql or a similar tool.
Execute the SQL command to load the pgvector extension. Ensure the extension name is correct (e.g., pgvector) :
CREATE EXTENSION IF NOT EXISTS pgvector;
Verify the Update
Confirm the extension’s presence with:
SELECT * FROM pg_extension WHERE extname = 'pgvector';
Check the installed version of pgvector:
SELECT extversion FROM pg_extension WHERE extname = 'pgvector';
Additional Notes
Replace <version> with the actual version number of pgvector you downloaded.
Adjust configurations as per your specific setup and requirements.
Refer to the pgvector documentation for detailed usage and feature information.
Consult the AlloyDB Omni documentation for specific instructions related to AlloyDB Omni.
Conduct thorough testing after installation to confirm functionality.