Disclosed is a data processing system implemented method, a data
processing system and an article of manufacture for executing a query
having a union operator. A data processing system implemented method
direct the data processing system to execute a query against a database
having data objects. The query has sub-queries and having a union
operator. The union operator is operable on sub-queries associated with
the query. The database is operatively coupled to the data processing
system. The data processing system implemented method including grouping
the sub-queries of the union operator according to identified structural
similarities, the identified structural similarities being based on an
analysis of the sub-queries, grouping the data objects of the database
according to the grouped sub-queries, replacing the grouped data objects
and any sub-queries associated with the grouped data objects with a
reference to a representative data object and a representative sub-query,
and accessing at least one member of the grouped data objects, the
accessing of the at least one member of the grouped data object being
based on the reference.