-
Notifications
You must be signed in to change notification settings - Fork 233
Description
Thank you for your work, but I have some confusion about the underlying logic of sqlite-vec. Specifically:
Column name conflict: If my database table contains a native column named distance, how would the sample query resolve this? Would the returned distance refer to the vector distance or the table's own column?
Query execution order: Assuming the table also has a date column, consider this modified query:
select
rowid,
distance,
date
from vec_examples
where sample_embedding match '[0.890, 0.544, 0.825, 0.961, 0.358, 0.0196, 0.521, 0.175]'
order by date
limit 2;
How would this execute? Does it:
First perform the vector MATCH operation (returning rowid and vector distance), then sort those results by date?
Or does it perform the MATCH to get all columns (including date), sort the full results by date, and then return the top 2 with only rowid and distance projected?
Could you clarify the execution process for these scenarios or point me to any relevant documentation explaining this behavior?