face-postgre icon indicating copy to clipboard operation
face-postgre copied to clipboard

issue while executing query

Open nitishxp opened this issue 6 years ago • 2 comments

[42883] ERROR: operator does not exist: cube <-> cube

Hi i am getting this error

My query is

**SELECT name FROM vectors WHERE (cube(array[-0.15382039546966553,0.01020173728466034]) <-> vec_low ) **

nitishxp avatar Nov 29 '18 17:11 nitishxp

@vearutop is it necessary to perform

SELECT name FROM vectors WHERE sqrt(power(CUBE(array[{}]) <-> vec ,2) when i am finding that i am able to save 128 dimension in cube?

Thanks

nitishxp avatar Nov 29 '18 17:11 nitishxp

You are likely missing cube extension (https://github.com/vearutop/face-postgre/blob/master/db.py#L6) if you receive such error.

By default cube extension is limited to 100 floats in a vector, if you have a patched PostgreSQL version that allows 128 dimensions you can simplify query to SELECT name FROM vectors WHERE CUBE(array[{}]) <-> vec. No need to sqrt(power(..)).

vearutop avatar Dec 02 '18 21:12 vearutop