Query expressions can use much of the power of Structured Query Language (SQL). Each query
expression combines SQL functions and operators, eld names from the metadata schema, and
literal values. There are no query expressions that select objects based on the data stored in the
object itself; all queries apply only to the metadata elds associated with the object. Only
queryable elds can be used in query expressions. For an object to show up in a query result set,
the object must have a value for each of the elds mentioned in the query; in other words, there
is an implicit INNER JOIN between the elds in the query.
A query may optionally specify that the result set should include not just the OID of each
matching object, but also the values from a set of selected elds of each matched object . The
value retrieved by Query With Select for some eld may be a canonical equivalent of the value
originally stored in that eld. For example, values in numeric elds may have been converted to
standard numeric format. Trailing spaces at the end of string elds will have been truncated
(The value that is returned will be some value that would match the original data as stored, in
the SQL sense.) To be included in the result set, an object must include values for all queried
elds and all selected elds. In other words, there is an implicit INNER JOIN between all the
elds in the query and in the select list.
There are signicant limitations on which queries may be executed eciently, or at all. See
Chapter 4, “Sun StorageTek 5800 System Query Language,” and Chapter 5, “Programming
Considerations and Best Practices”
s for details of these limitations.
There are no ordering guarantees between queries and store operations that are proceeding at
the same time. If an object is added to the 5800 system while a query is being performed, and the
object matches the query, then the object may or may not show up in the query result set.
For a detailed description of query syntax and query semantics, including a description of
exactly what it means for an object to match a query, see
Chapter 4, “Sun StorageTek 5800
System Query Language.”
The 5800 System Query Integrity Model
The result set of any query will only return results that match the query. But will it return ALL
the matching results? That is the concept of query completeness, referred to here as query
integrity. 100% query integrity for a result set is dened as a state in which the result set contains
all the objects in the 5800 system that match that particular query. The 5800 system is not
always in a state of 100% query integrity. Various system events can induce a state in which the
set of objects that are available for query is smaller than the total set of objects stored in the
archive. Each query result set supports an operation (isQueryComplete) whereby the customer
application can ask, once all the results from the query result set have been processed, whether
that set of results constitutes a complete set.
5800SystemOverview
Chapter1 • SunStorageTek 5800SystemClientAPI 21