selection criteria for a query that specify one or more Boolean predicates. Implementing the criteria, the server selects only rows that satisfy the WHERE clause.
the building blocks of WHERE clauses. Use them stand-alone or combine them with the operators AND and OR to form complex WHERE clauses. Here is an example of a WHERE clause:
"where x > 1 and y in (1 2 3)"
determines whether two predicates joined with an AND or OR are true (satisfy the specification) or false (do not satisfy the specification). The AND operator requires that all predicates be true for the entire expression to be true. For example, the expression p1 AND p2 AND p3 is true only if all three predicates (p1, p2, and p3) are true. In contrast, the OR operator requires only one predicate to be true for the entire expression to be true.
(x
< 5 or y in (1 2 3)) and z = 10
, the following truth
table describes the overall result (truth):
"x < 5 ?" "y in (1 2 3) ?" "z = 10 ?" Result ========= ================ ========== ====== False False False False False False True False False True False False False True True True True False False False True False True True True True False False True True True True
structures associated with tables that permit the server to quickly access rows that
satisfy an indexed predicate. In an example WHERE clause, where
x = 10 and y > 11
, the server selects the best index
on column X to directly retrieve rows that have a value of 10 in the
X column. If no index exists for X, the server must sequentially read
each row in the table searching for X equal to 10.
index on a single column.
composite indexes index two or more columns. The list of columns in an index is sometimes called the index key.
the server capability that enables multiple threads to execute in parallel. Using multiple processors in parallel mode is sometimes called “divide and conquer” processing. The server uses parallelism to evaluate the multiple indexes that are involved in more complicated WHERE clauses.