September 11th, 2024

EAP for Vector Support Refresh – Introducing Vector type

Image new vector old crt

Not even 6 months ago we started the Early Adopter Preview vector data support in Azure SQL, and we got great feedback and a lot of enthusiasm about the feature. Developers are excited to be able to easily build AI-enabled solution using an enterprise ready, secure, scalable and proven platform like Azure SQL, without the need to move data outside the database for increased security and manageability.

The new vector data type

We’re now even more excited to introduce a dedicated, native, data type for storing vectors: the vector data type. Usage of varbinary to store vectors is now deprecated and it will be removed before we move to Public Preview. Having a vector type just makes everything easier. Creating a vector is now as easy as casting from a JSON array:

declare @v vector(3) = cast('[1,2,3]' as vector(3))

and converting a vector back into a JSON array is also straightforward:

declare @a nvarchar(max) = cast(@v as nvarchar(max))

Vector functions that were specifically focused on handling vectors using the varbinary(8000), like ISVECTOR, JSON_ARRAY_TO_VECTOR and VECTOR_TO_JSON_ARRAY will still work for a while, but they are to be considered deprecated, as there is no need for them anymore now that vectors have their own data type.

New functions for vectors

We’re also introducing couple of new functions to facilitate vectors usage, especially if the embedding model that you are using does not return normalized vectors, so that you must use the more expensive cosine distance instead of the more efficient dot product:

  • VECTOR_NORM: returns the norm of the vector (which is a measure of its length or magnitude) in a given norm type.
  • VECTOR_NORMALIZE: returns the normalized vector, which is a vector scaled to have a length of 1 in a given norm type.

How do I test the vector type?

Using the new vector type is still in Early Adopter Preview phase.

If you have been already included in the Early Adopter Preview, and you are already using the vector functions, no action needed on your side. We’ll reach out to you in the next days to provide instructions on how to use the new vector type.

If you have already submitted your request to join the Early Adopter Preview, you’re good. When we’ll reach out to you, we’ll provide the updated information to use the new vector type right away.

If you are interested in joining the Early Adopter Preview to try out the new vector features firsthand, please fill out this form: https://aka.ms/azuresql-vector-eap so that you can be included EAP.

Vector Support EAP Link

Author

Davide Mauri
Principal Product Manager

I started as a developer, I fell in love with Data and Database, in all their forms. I still have a passion for development (C# and Python). My focus has been databases and performance tuning, focusing both on transactional and analytical workloads. For 5 years I helped developers to get the best out of SQL Server, then I moved to Business Intelligence and Data Warehousing for 10 years. Then I moved to IoT and Big Data for a while. Now back to database space, as Product Manager for Azure SQL ...

More about author

Pooja Kamath
Senior Product Manager

4 comments

  • Tobias Ha

    Awesome 🙂 Any news when its offically released? We applied for eary adoptor preview but didnt get a response yet

    • Davide MauriMicrosoft employee Author 3 days ago

      Stay tuned….;)

      We got an impressive number of requests to test this feature so queue is a bit long. Thanks in advance for your patience and great to see such enthusiasm!!!!

  • Farrell, Craig A · Edited

    Very cool new stuff 🙂 When will we be able to try it out? I already applied, but haven’t heard anything back about the early adopter preview.