Method for transforming SQL queries
First Claim
1. A computer-implemented method for the transformation of an SQL query comprising a WHERE clause having nested SELECT expressions, the method comprising the following steps:
- a) iteratively transforming the nested SELECT expressions in the WHERE clause of the SQL query into a corresponding and logically equivalent first step expression whereby the first step expression is defined to comprise ThereExists expressions and associated truth-value expressions, b) generating a truth expression having the form “
(search_condition) IS TRUE”
where the first step expression derived from the WHERE clause defines “
search condition”
in the truth expression;
c) transforming the truth expression by iteratively applying a set of 3-valued to 2-valued logic rules to push the IS operator to the bottom of a truth expression tree corresponding to the truth expression and to replace the resulting IS operator expressions with logically equivalent expressions such that a second step expression is defined to be logically equivalent to the truth expression and to be expressed in 2-valued logic; and
d) transforming the second step expression by iteratively applying a set of NOT removal rules to push any NOT expressions to the bottom of a second step expression tree corresponding to the second step expression, to remove the NOT expressions and to remove the ThereExists expressions, whereby the WHERE clause is transformed to an expression in 2-valued logic in which nested SELECT expressions are simplified.
9 Assignments
0 Petitions
Accused Products
Abstract
A computer-implemented method for transforming an SQL query comprising a WHERE clause having nested SELECT expressions. The expression in the WHERE clause being transformed by the iterative application of rules to comprise ThereExists expressions and associated truth-value expressions. Further transforming the expression to form a truth expression having the IS operator and iteratively applying further rules to translate 3-valued logic to 2-valued logic. Carrying out a further transformation to remove NOT expressions from the expression and to remove any ThereExists expressions so as to define an expression in 2-valued logic with simplified SELECT expressions.
-
Citations
32 Claims
-
1. A computer-implemented method for the transformation of an SQL query comprising a WHERE clause having nested SELECT expressions, the method comprising the following steps:
-
a) iteratively transforming the nested SELECT expressions in the WHERE clause of the SQL query into a corresponding and logically equivalent first step expression whereby the first step expression is defined to comprise ThereExists expressions and associated truth-value expressions, b) generating a truth expression having the form “
(search_condition) IS TRUE”
where the first step expression derived from the WHERE clause defines “
search condition”
in the truth expression;
c) transforming the truth expression by iteratively applying a set of 3-valued to 2-valued logic rules to push the IS operator to the bottom of a truth expression tree corresponding to the truth expression and to replace the resulting IS operator expressions with logically equivalent expressions such that a second step expression is defined to be logically equivalent to the truth expression and to be expressed in 2-valued logic; and
d) transforming the second step expression by iteratively applying a set of NOT removal rules to push any NOT expressions to the bottom of a second step expression tree corresponding to the second step expression, to remove the NOT expressions and to remove the ThereExists expressions, whereby the WHERE clause is transformed to an expression in 2-valued logic in which nested SELECT expressions are simplified. - View Dependent Claims (2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28)
-
-
13. A computer-implemented method for the transformation of an SQL query comprising a WHERE clause having nested SELECT expressions, the method comprising the following steps:
-
a) iteratively transforming the nested SELECT expressions in the WHERE clause of the SQL query into a corresponding and logically equivalent first step expression whereby the first step expression is defined to comprise ThereExists expressions and associated truth-value expressions; and
b) transforming the first step expression by iteratively applying a set of NOT removal rules to push any NOT expressions to the bottom of the first step expression tree corresponding to the first step expression, to remove the NOT expressions and to remove the ThereExists expressions, whereby the WHERE clause is transformed to an expression in which nested SELECT expressions are simplified. - View Dependent Claims (14, 29, 30)
-
-
15. A computer-implemented method for the transformation of an SQL query comprising a WHERE clause comprising a condition expression, the method comprising the following steps:
-
a) generating a truth expression having the form “
(search_condition) IS TRUE”
where the WHERE clause condition expression defines “
search_condition”
in the truth expression; and
b) transforming the truth expression by iteratively applying a set of 3-valued to 2-valued logic rules to push the IS operator to the bottom of a truth expression tree corresponding to the truth expression and to replace the resulting IS operator expressions with logically equivalent expressions such that a second step expression is defined to be logically equivalent to the truth expression and to be expressed in 2-valued logic, whereby the WHERE clause is transformed to an expression in 2-valued logic. - View Dependent Claims (16, 31, 32)
-
Specification