Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

issue while executing query #5

Open
nitishxp opened this issue Nov 29, 2018 · 2 comments
Open

issue while executing query #5

nitishxp opened this issue Nov 29, 2018 · 2 comments

Comments

@nitishxp
Copy link

nitishxp commented Nov 29, 2018

[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
Copy link
Author

@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

@vearutop
Copy link
Owner

vearutop commented Dec 2, 2018

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(..)).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants