Hello,
Our organisation is evaluating StarRocks and we would like to understand more about its vector search capabilities.
So far we have noticed that while this query results in the index being used:
explain SELECT uri
FROM content_metadata
order by approx_cosine_similarity(embedding_float, [0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417,0.04419417]) desc
LIMIT 5;
If we do anything else, such as:
- Getting the comparison vector in a subquery
- Getting the comparison vector from a user defined variable
- Getting the comparison vector from
array_repeat(0.04419417, 512)
rather than spelling out the entire vector as a constant literal as in the original query - Getting the comparison vector from a CTE
then the vector index is not used.
We would appreciate any information about the ability to use the vector index in these use cases.
Thanks!
Alex