Browse Prior Art Database

Processing UNION and UNION ALL Operators in Relational Data Base Accessing Systems

IP.com Disclosure Number: IPCOM000039667D
Original Publication Date: 1987-Jul-01
Included in the Prior Art Database: 2005-Feb-01
Document File: 1 page(s) / 12K

Publishing Venue

IBM

Related People

Wang, Y: AUTHOR

Abstract

This invention relates to a method for processing the table results from a sequence of relational data base queries with selectively embedded UNION and UNION ALL operators. The method includes the steps of clustering and executing predetermined UNION and UNION ALL operators upon the results in order to eliminate redundant rows. The processing sequences are not commutative. UNION is a well-known set operator which combines two sets into one and every element in the result set is distinct. In relational data base systems, a query generates a table as its result. The results of two queries can be combined together by a UNION operator which removes the duplicated rows and keeps every row in the result table distinct.

This text was extracted from a PDF file.
This is the abbreviated version, containing approximately 52% of the total text.

Page 1 of 1

Processing UNION and UNION ALL Operators in Relational Data Base Accessing Systems

This invention relates to a method for processing the table results from a sequence of relational data base queries with selectively embedded UNION and UNION ALL operators. The method includes the steps of clustering and executing predetermined UNION and UNION ALL operators upon the results in order to eliminate redundant rows. The processing sequences are not commutative. UNION is a well-known set operator which combines two sets into one and every element in the result set is distinct. In relational data base systems, a query generates a table as its result. The results of two queries can be combined together by a UNION operator which removes the duplicated rows and keeps every row in the result table distinct.

The results of two queries can also be combined together by a UNION ALL operator which does not remove the duplicated rows and just merges the results of two queries together. The UNION operator and UNION ALL operator can be mixed together to form a sequence of such above operations. This invention is an efficient way to handle such operations. It was observed that: 1. The two unions in (query-1 UNION query-2) UNION query-3 can be done together, in the sense of merging and removing duplicated rows. It is not needed to do that once for query-1 UNION query-2 and again for (query-1 UNION query-2) UNION query-3. This is also true for query-1 UNION query-2 UNION query-3 UNION query-4... 2. The two UNION ALL operators in (quer...