Optimizing queries that reference UNION ALL views

All partitions in a UNION ALL view must have a complete set of indexes defined for optimization to work.

Queries with DISTINCT will tend to run more slowly using a UNION ALL view than a base table.

Sybase IQ includes patented optimizations for UNION ALL views, including:

Should you need to adjust performance for queries that reference UNION ALL views, you might want to set the JOIN_PREFERENCE database option, which affects joins between UNION ALL views. For details of these options, see Chapter 2, “Database Options,” in Reference: Statements and Options.

A UNION can be treated as a partitioned table only if it satisfies all of the following constraints:

See also

“SELECT statement” in Reference: Statements and Options.