Can dimensions be skipped in queries against R/R*/X-Trees?
-
28-06-2021 - |
Question
Let's say we have a 4 dimensional tree with dimensions longitude, latitude, altitude and for illustration purposes, price.
Can we query against longitude and latitude and optionally against either altitude and/or price?
Solution
Yes, obviously you can do that. For window queries, just ignore the dimensions or query with an infinite rectangle in that dimension. For range or knn, use a distance function that skips these dimensions.
However, for range/kNN queries, a distance function using both latitude/longitude and e.g. price is nontirival to define. Euclidean distance obviously is not very sensible, as $1 is not the same "distance" as 1 degree in latitude.
The R*-Trees in ELKI should support this out of the box AFAICT. If you query the tree with a projected distance, it will use only these attributes.