An improved normalization methodology enabling better optimization of SQL
queries is described. The normalization methodology effectively handles
three-valued SQL search conditions and operates in reduced memory
environments. A query is examined and selectively normalized by examining
each segment of the query to determine whether it is advantageous to fully
convert that segment to conjunctive normal form (CNF). If full conversion
of the segment to CNF is not advantageous, then only the useful
conjunctive conditions (prime implicates) that can be derived from the
original input are saved. These useful conjuncts (prime implicates) are
unioned with the original statement, resulting in a search condition that
is semantically equivalent to the original expression, but that can be
better exploited by a query optimizer. This enables better optimization of
the original query without the system overhead that would result from full
normalization of the query.