Describes the union of the two or more derived tables.
(union derived_table1 ... derived_tableN
)
is the derived tables to be united.
A derived table that is the union of the specified operands.
select * from t1 union select * from t2 union select * from t3
(union (t_scan t1) (t_scan t2) (t_scan t3) )
Returns the union of the three full table scans.
select 1,2 union select * from t2
(union ( ) (tscan t2) )
Since the first side of the union is not an optimizable query, the first union operand is empty.
The specified derived tables in the abstract plan are matched against the positionally corresponding tables specified in the query.
The union operator describes the processing for:
union, which removes duplicate values and
union all, which preserves duplicate values
The union operator in an abstract query plan must have the same number of union sides as the SQL query and the order of the operands for the abstract plan must match the order of tables in the query.
The sort step and worktable required to process union queries are not represented in abstract plans.
If union queries list nonoptimizable elements, an empty operand is required. A select query that has no from clause is shown in example