Queryexpressions can use much of the power of Structured Query Language (SQL). Each query
expressioncombines SQL functions and operators, eld names from the metadata schema, and
literalvalues. There are no query expressions that select objects based on the data stored in the
objectitself; 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,
theobject must have a value for each of the elds mentioned in the query; in other words, there
isan implicit INNER JOIN between the elds in the query.
Aquery may optionally specify that the result set should include not just the OID of each
matchingobject, but also the values from a set of selected elds of each matched object . The
valueretrieved by Query With Select for some eld may be a canonical equivalent of the value
originallystored in that eld. For example, values in numeric elds may have been converted to
standardnumeric format. Trailing spaces at the end of string elds will have been truncated
(Thevalue that is returned will be some value that would match the original data as stored, in
theSQL sense.) To be included in the result set, an object must include values for all queried
eldsand all selected elds. In other words, there is an implicit INNER JOIN between all the
eldsin the query and in the select list.
Thereare signicant limitations on which queries may be executed eciently, or at all. See
Chapter4, “Sun StorageTek 5800 System Query Language,”and Chapter 5, “Programming
Considerationsand Best Practices”s for details of these limitations.
Thereare no ordering guarantees between queries and store operations that are proceeding at
thesame time. If an object is added to the 5800 system while a query is being performed, and the
objectmatches the query, then the object may or may not show up in the query result set.
Fora detailed description of query syntax and query semantics, including a description of
exactlywhat it means for an object to match a query, see Chapter 4, “Sun StorageTek 5800
SystemQuery Language.”
The5800 System Query Integrity Model
Theresult set of any query will only return results that match the query. But will it return ALL
thematching results? That is the concept of query completeness, referred to here as query
integrity.100% query integrity for a result set is dened as a state in which the result set contains
allthe objects in the 5800 system that match that particular query. The 5800 system is not
alwaysin a state of 100% query integrity. Various system events can induce a state in which the
setof 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
applicationcan ask, once all the results from the query result set have been processed, whether
thatset of results constitutes a complete set.
5800SystemOver view
Chapter1 • Sun StorageTek 5800 System Client API 21