Method and apparatus for a complete SQL subquery elimination process
First Claim
Patent Images
1. A method for the transformation of a nested SQL query to eliminate all subqueries of the nested SQL query, the method comprising the steps, performed by a computer processor, of:
- representing in a memory a nested SQL language query including at least one subquery in a first dataflow tree diagram with nodes of expressional operators and relational operators;
eliminating each of said subqueries of said representing step according to a plurality of predetermined transformation rules being selected from a group of SQL transformation rules including the normalization rules NR1, NR2, NR3, NR4, NR5, NR6, NR7, said eliminating step transforming said nested SQL language query of said first dataflow tree diagram in the memory to a normalized and syntactically transformed equivalent second dataflow tree diagram, so that said relational operators in the second dataflow tree depend from one another and each of said relational operators are not isolated between expressional operators.
5 Assignments
0 Petitions
Accused Products
Abstract
A method for subquery elimination for a relational model database based on the SQL language running a database management system (DBMS) under the TANDEM NONSTOP (tm) operating kernel. A series of seven transformation rules are applied to eliminate nested queries in the SQL language. The method and teachings of the present invention generalizes to all types of nested subqueries in SQL, allowing for more efficient computations, allocation and maintenance of system resources.
-
Citations
25 Claims
-
1. A method for the transformation of a nested SQL query to eliminate all subqueries of the nested SQL query, the method comprising the steps, performed by a computer processor, of:
-
representing in a memory a nested SQL language query including at least one subquery in a first dataflow tree diagram with nodes of expressional operators and relational operators; eliminating each of said subqueries of said representing step according to a plurality of predetermined transformation rules being selected from a group of SQL transformation rules including the normalization rules NR1, NR2, NR3, NR4, NR5, NR6, NR7, said eliminating step transforming said nested SQL language query of said first dataflow tree diagram in the memory to a normalized and syntactically transformed equivalent second dataflow tree diagram, so that said relational operators in the second dataflow tree depend from one another and each of said relational operators are not isolated between expressional operators. - View Dependent Claims (12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25)
-
-
2. A method for the transformation of a nested SQL language query to eliminate all subqueries of the nested SQL query, the method comprising the steps, performed by a computer processor, of:
-
representing in a memory a nested SQL language query in a dataflow tree diagram with nodes of expressional operators and relational operators; and transforming said SQL language dataflow tree diagram in the memory according to a plurality of predetermined rules of transformation being selected from a group of SQL transformation rules including the normalization rules NR3, NR4, NR5, NR6, NR7, so that said relational operators in the transformed dataflow tree depend from one another and are not isolated between expressional operators, and at least one of the normalization rules eliminates all subqueries inside a relational node, wherein each of the subqueries is allowed to reference values generated by a child of the node.
-
-
3. A method for the transformation of a nested SQL language query by a computer processor running a database management system to eliminate all nested subqueries, the method comprising the steps, performed by a computer processor, of;
-
representing in a memory a nested SQL language query in a dataflow tree diagram with nodes of expressional operators and relational operators; and transforming said SQL language dataflow tree diagram in the memory according to a plurality of predetermined rules of transformation being selected from a group of SQL transformation rules including the normalization rules NR3, NR4, NR5, NR6, NR7, so that said relational operators in the transformed dataflow tree depend from one another and are not isolated between expressional operators, and at least one of the normalization rules eliminates all subqueries inside a relational node, wherein each of the subqueries is allowed to reference values generated by the node.
-
-
4. A method for the transformation of a nested SQL language query to eliminate all nested subqueries, the method comprising the steps, performed by a computer processor, of;
-
representing in a memory a nested SQL language query in a dataflow tree diagram with nodes of expressional operators and relational operators; and transforming said SQL language dataflow tree diagram in the memory according to a plurality of predetermined rules of transformation being selected from a group of SQL transformation rules including the normalization rules NR3, NR4, NR5, NR6, NR7, so that said relational operators in the transformed dataflow tree depend from one another and are not isolated between expressional operators, and at least one of the normalization rules eliminates each of the subqueries inside an "input" node, where an input node is defined as a node that passes a result of at least one of the subqueries down to its child node.
-
-
5. An apparatus for the elimination of SQL subqueries, comprising:
-
a parser provided to convert a nested SQL language query to a dataflow tree diagram with nodes of expessional operators and relational operators; and a subquery transformer provided to transform the dataflow tree diagram to a transformed dataflow tree diagram in which no expression node has a relational node as its child, the transformation proceeding in accordance with at least one rule selected from the group of SQL transformation rules NR3, NR4, NR5, NR6, and NR7. - View Dependent Claims (6, 7, 8, 9, 10, 11)
-
Specification