29 ms·
Question: How is pgvector applied in this way different from and maybe superior to the PostgreSQL cube extension? https://www.postgresql.org/docs/current/cube
by dventimihasura 4y ago
Question: How is pgvector applied in this way different from and maybe superior to the PostgreSQL cube extension?
https://www.postgresql.org/docs/current/cube.html https://www.postgresql.org/docs/current/cube.html
The cube datatype also stores arrays of numbers (cubes or vectors, same thing) and has functions/operators for computing distance. Granted, they're slightly different, with no direct substitute for cosine distance, but on the unit sphere the cosine distance, inner product, and Euclidean distance have direct correspondences.
- saurik 4y agoI looked into this, and (apparently) the cube extension has a very small hard-coded dimensionality limit that isn't sufficient for this purpose; you can recompile it to support more dimensions, but the way it stores data requires the entire vector to still fit within a single database page (which these vectors will not).
- dventimihasura 4y agoThanks!