Conditions
Conditions serve to restrict the number of query matches by placing requirements on the attributes of an object or link in the database.
Conditions are commonly, but not exclusively, used to enforce type restrictions in query matches.
Attribute value conditions restrict matches to only those database entities that match the attribute values specified in the query.
Existence conditions test only to see whether the corresponding object or link has an instance of the specified attribute, but do not require that the attribute have any particular value.
Attribute value conditions can use the comparison operators
=, <,
>, <=,
>=, and <>
Simple conditions can be combined using disjunctive normal form.
An attribute value condition is satisfied if any member of the set of attribute values for the corresponding database entity satisfies the condition.
If an object or link does not have a value for the attribute
listed in an attribute value condition, the condition’s
expression is false
and the condition fails (unless negated by NOT).
The use of set-valued attributes means that different
attribute values for a single object or link may satisfy different
condition tests, yielding the result that
NOT(
is not necessarily equivalent to
attr = value).
attr <> value
Case sensitivity
Proximity ignores case when matching attribute names.
Proximity obeys case when matching attribute values.
Efficiency considerations
It is generally more efficient to include more rather than fewer restrictions in the form of conditions.
Use existence conditions instead of attribute value conditions when they match the same data.
Taking advantage of some of these efficiency improvements may require perfect information about a database’s schema. In practice, we frequently do not have thorough enough information about a database to be able to use efficiency improvements with confidence.