An apparatus and method optimize a UNION-type query, where the query has
common components on both sides of the UNION-type operator. The
UNION-type expression is analyzed to determine if the expression can be
optimized, and if so, common portions on both sides of the UNION-type
expression are extracted and the expression is reformulated so the common
portions on both sides of the union expression are only run one time.