Database Reference
In-Depth Information
Algorithm 7.
<complex_attr> NEAR [ANY] {<value>|<complex_attr2>}
[STOP AFTER <k>] [RANGE < ξ >]
Algorithm 8.
SELECT * FROM Landscapes
WHERE Picture NEAR 'example.jpg' STOP AFTER 5;
The second approach obtains the value from the database. Then, in order to answer the same query
regarding a landscape stored in the database, the following command can be used. (see Algorithm 9)
It is worth to note that the inner SELECT of the previous command can return more than one tuple
when a non key attribute is used in the WHERE clause. In this case, the result of the inner SELECT can
potentially return a set with several query centers for the similarity predicate. Therefore, the command
turns into an aggregate similarity query and a grip factor must be selected according to Equation 1 pre-
sented in the 'Similarity Queries' section. To specify which grip factor must be used, one of the follow-
ing keywords can be inserted after the keyword NEAR: SUM to ask for g = 1, ALL to ask for g = 2 and
MAX to ask for g = ∞. For example, to retrieve the three pictures whose landscapes looks more similar
to those of Paris, regarding a grip factor of 2, the following command can be issued: (see Algorithm 10)
Algorithm 9.
SELECT * FROM Landscapes
WHERE Picture NEAR
(SELECT Picture
FROM Landscapes WHERE Id = 123) STOP AFTER 5;
Algorithm 10.
SELECT * FROM Landscapes
WHERE Picture NEAR ALL
(SELECT Picture
FROM Landscapes
WHERE place = 'Paris') STOP AFTER 3;
 
Search WWH ::




Custom Search