# Thread: Vector-Database to calculate distance

1. Registered User
Join Date
Aug 2012
Posts
2

## Vector-Database to calculate distance

Hy,

I have to build a database in which a huge amount of vectors will be stored.
These vectors have about 20 dimensions.
I will use this database to calculate the distance between a new vector I have in a program of mine and all vectors in my database.
I´m not very experienced in databases so I have a few questions:

- Is there a special choice of database when it comes to storing vectors?
- How would you approach this? (I´m coding C++)

Hope someone has an idea or two for me.
Thx very much.

2. Registered User
Join Date
Feb 2008
Location
Japan
Posts
3,483
What is a definition of distance of two vectors?

If two vectors x and y were expressed by (x1, x2, x3, ... , x20) and (y1, y2, y3, ... , y20),
distance(x, y) = distance( (x1, x2, x3, ... , x20) , (y1, y2, y3, ... , y20) ) = ?

3. Registered User
Join Date
Aug 2012
Posts
2
I´m calculating the euclidean distance...(Euclidean distance - Wikipedia, the free encyclopedia).

But my question was more about what would be the best approach to store the vectors and read them from db?
Which db would be best ...

Thx

Join Date
Nov 2004
Location
out on a limb
Posts
13,692
just thinking aloud..
I wonder if any of the spatial / geographic extensions would be useful here?
such as MySQL :: MySQL 5.0 Reference Manual :: 12.16.1 Introduction to MySQL Spatial Support

5. Registered User
Join Date
Feb 2008
Location
Japan
Posts
3,483
spatial / geographic supports are for geometry on sphere of cube(earth).

I think that it(sphere of cube) is different from vector space.

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•