Database Reference
In-Depth Information
retrieval, it is expected that users gradually enhance the similarity evaluation algorithms, adding new
feature extractors, distance functions and experimenting with several combinations. In this sense, a single
multimedia attribute can be employed in queries considering different metrics. Therefore, the presented
SQL extension allows associating several metrics with the same complex attribute, and allows the user
to choose one of them to be employed in each query formulation. When more than one metric is associ-
ated with the same attribute, the DEFAULT keyword must follow the name to be used as the default
one, i.e., the metric that should be employed if none is explicitly provided in a query.
Other SQL extended command is the CREATE INDEX. As the indexes that apply to multimedia search-
ing by similarity depends on the employed metric (see 'Indexing Methods for Multimedia' section), this
information must be provided in order to be possible to create them. This requirement is accomplished
in the SQL extension adding the USING <metric_name> clause to the CREATE INDEX syntax. Note
that this command implicitly adds a corresponding METRIC constraint to the referred attribute. Regard-
ing our example, considering that a metric called Texture was defined for the STILLIMAGE type, the
following command creates an index to execute queries using this metric over the Picture attribute and
sets Texture as its default metric: (see Algorithm 6)
Extending DML Commands
The syntax of the DML commands (SELECT, UPDATE and DELETE) needs new constructions to allow
expressing similarity predicates. In this chapter we only describe the new constructions of the SELECT
command, as the other commands are equivalent. The syntax of the INSERT command does not need
changes (although its implementation does).
The new constructions required in the SELECT command occur in the FROM and the WHERE clauses.
The new construction in the WHERE clause allows expressing every similarity predicate described in
the 'Similarity Queries' section, that is, similarity selection, and similarity join queries. The simplest
expression in a non-similarity selection predicate compares an attribute with a constant value, in the
format attr θ value , or it compares an attribute with another compatible attribute, in the format attr 1 θ
attr 2 . To express a similarity predicate, the attributes must be of complex data types (e.g. a multimedia
data type), the constant value must be an element in the corresponding domain, and the operator θ must
be a similarity operator using a metric defined over the attributes. The syntax to express similarity selec-
tion predicates is: (see Algorithm 7)
Following this syntax, the reserved word NEAR corresponds to the θ operator, and value is employed
to state similarity selections, which can be obtained considering two approaches. The first is expressing
a constant as a path in the file system where the image is stored. For example, to select the five landscapes
with pictures more similar to a given example stored in the example.jpg file, the following command
can be used: (see Algorithm 8)
Algorithm 6.
CREATE INDEX TextureIndex ON Landscapes (Picture)
USING Texture DEFAULT;
 
Search WWH ::




Custom Search