4 ms·
Side observation, not meant as a criticism of this project at all (which seems to be consistently doing things the PostgreSQL way, I commend that). The Postgre
by simonw 6y ago
Side observation, not meant as a criticism of this project at all (which seems to be consistently doing things the PostgreSQL way, I commend that).
The PostgreSQL world really loves operators - this extension uses <#>, <-> and <=> for example
I've been working with PostgreSQL JSON queries a bit recently which is also really operator heavy: https://www.postgresql.org/docs/13/functions-json.html https://www.postgresql.org/docs/13/functions-json.html - ->, ->>, #>, #>>
I have a really hard time remember what any of these do - I personally much prefer to use function equivalents like json_extract_path() if they are available.
- eloff 6y agoI agree, I never remember the syntax for the json operators either. I'd rather functions which are readable if you don't remember what they do. Operators need to be looked up. This emphasis on terseness over readability was one of the reasons I abandoned perl long ago.
- jononor 6y agoYeah, I would love to be able to use functions for these vector distance operations instead of the very magical operators...
- megous 6y agohttps://github.com/ankane/pgvector/blob/master/vector--0.1.0.sql#L108 https://github.com/ankane/pgvector/blob/master/vector--0.1.0... Nothing stops you. All operators are implemented just as procedure calls.
- PeterisP 6y agoJSON query operators are somewhat unusual because it's very common to need to chain many operators in a row, which would be very verbose if named functions would be used instead - the vector similarity is different in this regard, and that terseness isn't necessary.