Enumerating projections in SQL queries containing outer and full outer joins in the presence of inner joins
First Claim
1. A method of simplifying a query in a computer, the query being performed by the computer to retrieve data from a database stored in a electronic storage device coupled to the computer, the method comprising the steps of:
- (a) accepting the query into the computer; and
(b) replacing a first expression in the query with a second expression, wherein the first expression comprises;
space="preserve" listing-type="equation">δ
.sub.X.sbsb.1 (e.sub.x)⊙
δ
.sub.Y.sbsb.1 (e.sub.y)and the second expression comprises;
space="preserve" listing-type="equation">δ
.sub.X.sbsb.1.sub.Y.sbsb.1 (e.sub.x ⊙
e.sub.y)wherein;
eX =(RX, VX, EX) is a relation, where RX is a non-empty set of real attributes, VX is a non-empty set of virtual attributes, EX, an extension of the relation, also denoted as ext(eX), is a set of tuples, X1 .OR right.RX, and X2 .OR right.X1,eY =(RY, VY, EY) is a relation, where RY is a non-empty set of real attributes, VY is a non-empty set of virtual attributes, EY, an extension of the relation, also denoted as ext(eY), is a set of tuples, Y1 .OR right.RY, and Y2 .OR right.Y1,δ
X (r) is a distinct projection operation of relation r onto attributes X, and⊙
ε
{, ←
, →
, ←
→
}, wherein represents a join operation, ←
→
represents a full outer join operation, ←
represents a left outer join operation, and →
represents a right outer join operation.
0 Assignments
0 Petitions
Accused Products
Abstract
The present invention discloses a method and apparatus for the enumeration of projections (i.e., "SELECT DISTINCT" operations) in SQL queries containing outer and full outer joins in the presence of inner joins without encountering any regression in performance. The present invention removes projections from a given user query by moving the projections to the top of an expression tree representation of the query, wherein the projection removal is performed using algebraic identities rather than rule-based transformations. The present invention also discloses several methods of enumerating different plans or schedules for projection operations and binary operations in the given user query. The present invention can significantly reduce the execution time of a query by selecting the optimal schedule for binary operations and projections between the binary operations. However, the present invention ensures that there is no regression in performance by comparing the cost of the query with the cost of enumerated plans or schedules, thereby ensuring that the optimizations or transformations do not introduce performance penalties.
18 Citations
18 Claims
-
1. A method of simplifying a query in a computer, the query being performed by the computer to retrieve data from a database stored in a electronic storage device coupled to the computer, the method comprising the steps of:
-
(a) accepting the query into the computer; and (b) replacing a first expression in the query with a second expression, wherein the first expression comprises;
space="preserve" listing-type="equation">δ
.sub.X.sbsb.1 (e.sub.x)⊙
δ
.sub.Y.sbsb.1 (e.sub.y)and the second expression comprises;
space="preserve" listing-type="equation">δ
.sub.X.sbsb.1.sub.Y.sbsb.1 (e.sub.x ⊙
e.sub.y)wherein; eX =(RX, VX, EX) is a relation, where RX is a non-empty set of real attributes, VX is a non-empty set of virtual attributes, EX, an extension of the relation, also denoted as ext(eX), is a set of tuples, X1 .OR right.RX, and X2 .OR right.X1, eY =(RY, VY, EY) is a relation, where RY is a non-empty set of real attributes, VY is a non-empty set of virtual attributes, EY, an extension of the relation, also denoted as ext(eY), is a set of tuples, Y1 .OR right.RY, and Y2 .OR right.Y1, δ
X (r) is a distinct projection operation of relation r onto attributes X, and⊙
ε
{, ←
, →
, ←
→
}, wherein represents a join operation, ←
→
represents a full outer join operation, ←
represents a left outer join operation, and →
represents a right outer join operation.
-
-
2. A method of simplifying a query in a computer, the query being performed by the computer to retrieve data from a database stored in a electronic storage device coupled to the computer, the method comprising the steps of:
-
(a) accepting the query into the computer; and (b) replacing a first expression in the query with a second expression, wherein the first expression comprises;
space="preserve" listing-type="equation">π
.sub.X.sbsb.2 δ
.sub.X.sbsb.1 (e.sub.x)⊙
π
.sub.Y.sbsb.2 δ
.sub.Y.sbsb.1 (e.sub.y)and the second expression comprises;
space="preserve" listing-type="equation">π
.sub.X.sbsb.2.sub.Y.sbsb.2 δ
.sub.X.sbsb.1.sub.Y.sbsb.1 (e.sub.X ⊙
e.sub.Y)wherein; eX =(RX, VX, EX) is a relation, where RX is a non-empty set of real attributes, VX is a non-empty set of virtual attributes, EX, an extension of the relation, also denoted as ext(eX), is a set of tuples, X1 .OR right.RX, and X2 .OR right.X1, eY =(RY, VY, EY) is a relation, where RY is a non-empty set of real attributes, VY is a non-empty set of virtual attributes, EY, an extension of the relation, also denoted as ext(eY), is a set of tuples, Y1 .OR right.RY, and Y2 .OR right.Y1, π
X (r) is a projection operation of relation r onto attributes X,δ
X (r) is a distinct projection operation of relation r onto attributes X, and⊙
ε
{, ←
, →
, ←
→
}, wherein represents a join operation, ←
→
represents a full outer join operation, ←
represents a left outer join operation, and →
represents a right outer join operation.
-
-
3. A method of simplifying a query in a computer, the query being performed by the computer to retrieve data from a database stored in a electronic storage device coupled to the computer, the method comprising the steps of:
-
(a) accepting the query into the computer; and (b) replacing a first expression in the query with a second expression, wherein the first expression comprises;
space="preserve" listing-type="equation">π
.sub.X.sbsb.1 (e.sub.x)⊙
δ
.sub.Y.sbsb.1 (e.sub.y)and the second expression comprises;
space="preserve" listing-type="equation">π
.sub.X.sbsb.1.sub.Y.sbsb.1 δ
.sub.V.sbsb.x.sub.X.sbsb.1.sub.Y.sbsb.1 (e.sub.x ⊙
e.sub.y)wherein; eX =(RX VX, EX) is a relation, where RX is a non-empty set of real attributes, VX is a non-empty set of virtual attributes, EX, an extension of the relation, also denoted as ext(eX), is a set of tuples, and X1 .OR right.RX, eY =(RY, VY,EY) is a relation, where RY is a non-empty set of real attributes, VY is a non-empty set of virtual attributes, EY, an extension of the relation, also denoted as ext(eY), is a set of tuples, and Y1 .OR right.RY, π
X (r) is a projection operation of relation r onto attributes X,δ
X (r) is a distinct projection operation of relation r onto attributes X, and⊙
ε
{, ←
, →
, ←
→
}, wherein represents a join operation, ←
→
represents a full outer join operation, ←
represents a left outer join operation, and →
represents a right outer join operation.
-
-
4. A method of simplifying a query in a computer, the query being performed by the computer to retrieve data from a database stored in a electronic storage device coupled to the computer, the method comprising the steps of:
-
(a) accepting the query into the computer; and (b) replacing a first expression in the query with a second expression, wherein the first expression comprises;
space="preserve" listing-type="equation">π
.sub.X.sbsb.2 δ
.sub.X.sbsb.1 (e.sub.x)⊙
π
.sub.Y.sbsb.1 (e.sub.y)and the second expression comprises;
space="preserve" listing-type="equation">π
.sub.X.sbsb.2.sub.Y.sbsb.1 δ
.sub.V.sbsb.y.sub.X.sbsb.1.sub.Y.sbsb.1 (e.sub.X ⊙
e.sub.Y)wherein; eX =(RX, VX, EX) is a relation, where RX is a non-empty set of real attributes, VX is a non-empty set of virtual attributes, EX, an extension of the relation, also denoted as ext(eX), is a set of tuples, X1 .OR right.RX, and X2 .OR right.X1, eY =(RY, VY, EY) is a relation, where RY is a non-empty set of real attributes, VY is a non-empty set of virtual attributes, EY, an extension of the relation, also denoted as ext(eY), is a set of tuples, and Y1 .OR right.RY, π
X (r) is a projection operation of relation r onto attributes X,δ
X (r) is a distinct projection operation of relation r onto attributes X, and⊙
ε
{, ←
, →
, ←
→
}, wherein represents a join operation, ←
→
represents a full outer join operation, ←
represents a left outer join operation, and →
represents a right outer join operation.
-
-
5. A method of simplifying a query in a computer, the query being performed by the computer to retrieve data from a database stored in a electronic storage device coupled to the computer, the method comprising the steps of:
-
(a) accepting the query into the computer; and (b) replacing a first expression in the query with a second expression, wherein the first expression comprises;
space="preserve" listing-type="equation">π
.sub.X.sbsb.2 δ
.sub.X.sbsb.1 (e.sub.x)⊙
δ
.sub.Y.sbsb.1 (e.sub.y)and the second expression comprises;
space="preserve" listing-type="equation">π
.sub.X.sbsb.2.sub.Y.sbsb.1 δ
.sub.X.sbsb.1.sub.Y.sbsb.1 (e.sub.x ⊙
e.sub.Y)wherein; eX =(RX, VX, EX) is a relation, where RX is a non-empty set of real attributes, VX is a non-empty set of virtual attributes, EX, an extension of the relation, also denoted as ext(eX), is a set of tuples, X1 .OR right.RX, and X2 .OR right.X1, eY =(RY, VY, EY) is a relation, where RY is a non-empty set of real attributes, VY is a non-empty set of virtual attributes, EY, an extension of the relation, also denoted as ext(eY), is a set of tuples, and Y1 .OR right.RY, π
X (r) is a projection operation of relation r onto attributes X,δ
X (r) is a distinct projection operation of relation r onto attributes X, and⊙
ε
{, ←
, →
, ←
→
}, wherein represents a join operation, ←
→
represents a full outer join operation, ←
represents a left outer join operation, and →
represents a right outer join operation.
-
-
6. A method of simplifying a query in a computer, the query being performed by the computer to retrieve data from a database stored in a electronic storage device coupled to the computer, the method comprising the steps of:
-
(a) accepting the query into the computer; and (b) applying an identity to the query, wherein the identity comprises;
##EQU5## and wherein;
eX =(RX, VX, EX) is a relation, where RX is a non-empty set of real attributes, VX is a non-empty set of virtual attributes, EX, an extension of the relation, also denoted as ext(eX), is a set of tuples, and X1 .OR right.RX,eY =(RY, VY, EY) is a relation, where RY is a non-empty set of real attributes, VY is a non-empty set of virtual attributes, EY, an extension of the relation, also denoted as ext(eY), is a set of tuples, and Y1 .OR right.RY, pxy is a predicate, sch(pxy) is a schema of pxy, (sch(pxy)∩
RX).OR right.X1,(sch(pxy)∩
RY).OR right.Y1,δ
X (r) is a distinct projection operation of relation r onto attributes X, and⊙
ε
{, ←
, →
, ←
→
}, wherein represents a join operation, ←
→
represents a full outer join operation, ←
represents a left outer join operation, and →
represents a right outer join operation.
-
-
7. An apparatus for simplifying a query in a computer, the query being performed by the computer to retrieve data from a database stored in a electronic storage device coupled to the computer, the apparatus comprising:
-
(a) a computer; (b) means for accepting the query into the computer; and (c) means for replacing a first expression in the query with a second expression, wherein the first expression comprises;
space="preserve" listing-type="equation">δ
.sub.X.sbsb.1 (e.sub.x)⊙
δ
.sub.Y.sbsb.1 (e.sub.y)and the second expression comprises;
space="preserve" listing-type="equation">δ
.sub.X.sbsb.1.sub.Y.sbsb.1 (e.sub.x ⊙
e.sub.y)wherein; eX =(RX, VX, EX) is a relation, where RX is a non-empty set of real attributes, VX is a non-empty set of virtual attributes, EX, an extension of the relation, also denoted as ext(eX), is a set of tuples, X1 .OR right.RX, and X2 .OR right.X1, eY =(RY, VY, EY) is a relation, where RY is a non-empty set of real attributes, VY is a non-empty set of virtual attributes, EY, an extension of the relation, also denoted as ext(eY), is a set of tuples, Y1 .OR right.RY, and Y2 .OR right.Y1, δ
X (r) is a distinct projection operation of relation r onto attributes X, and⊙
ε
{, ←
, →
, ←
→
}, wherein represents a join operation, ←
→
represents a full outer join operation, ←
represents a left outer join operation, and →
represents a right outer join operation.
-
-
8. An apparatus for simplifying a query in a computer, the query being performed by the computer to retrieve data from a database stored in a electronic storage device coupled to the computer, the apparatus comprising:
-
(a) a computer; (b) means for accepting the query into the computer; and (c) means for replacing a first expression in the query with a second expression, wherein the first expression comprises;
space="preserve" listing-type="equation">π
.sub.X.sbsb.2 δ
.sub.X.sbsb.1 (e.sub.x)⊙
π
.sub.Y.sbsb.2 δ
.sub.Y.sbsb.1 (e.sub.y)and the second expression comprises;
space="preserve" listing-type="equation">π
.sub.X.sbsb.2.sub.Y.sbsb.2 δ
.sub.X.sbsb.1.sub.Y.sbsb.1 (e.sub.x ⊙
e.sub.Y)wherein; eX =(RX, VX, EX) is a relation, where RX is a non-empty set of real attributes, VX is a non-empty set of virtual attributes, EX, an extension of the relation, also denoted as ext(eX), is a set of tuples, X1 .OR right.RX, and X2 .OR right.X1, eY =(RY, VY, EY) is a relation, where RY is a non-empty set of real attributes, VY is a non-empty set of virtual attributes, EY, an extension of the relation, also denoted as ext(eY), is a set of tuples, Y1 .OR right.RY, and Y2 .OR right.Y1, π
X (r) is a projection operation of relation r onto attributes X,δ
X (r) is a distinct projection operation of relation r onto attributes X, and represents a full outer join operation, ←
represents a left outer join operation, and →
represents a right outer join operation.
-
-
9. An apparatus for simplifying a query in a computer, the query being performed by the computer to retrieve data from a database stored in a electronic storage device coupled to the computer, the apparatus comprising:
-
(a) a computer; (b) means for accepting the query into the computer; and (c) means for replacing a first expression in the query with a second expression, wherein the first expression comprises;
space="preserve" listing-type="equation">π
.sub.X.sbsb.1 (e.sub.x)⊙
δ
.sub.Y.sbsb.1 (e.sub.y)and the second expression comprises;
space="preserve" listing-type="equation">π
.sub.X.sbsb.1.sub.Y.sbsb.1 δ
.sub.V.sbsb.x.sub.X.sbsb.1.sub.Y.sbsb.1 (e.sub.x ⊙
e.sub.y)wherein; eX =(RX, VX, EX) is a relation, where RX is a non-empty set of real attributes, VX is a non-empty set of virtual attributes, EX, an extension of the relation, also denoted as ext(eX), is a set of tuples, and X1 .OR right.RX, eY =(RY, VY, EY) is a relation, where RY is a non-empty set of real attributes, VY is a non-empty set of virtual attributes, EY, an extension of the relation, also denoted as ext(eY), is a set of tuples, and Y1 .OR right.RY, π
X (r) is a projection operation of relation r onto attributes X,δ
X (r) is a distinct projection operation of relation r onto attributes X, and⊙
ε
{, ←
, →
, ←
→
}, wherein represents a join operation, ←
→
represents a full outer join operation, ←
represents a left outer join operation, and →
represents a right outer join operation.
-
-
10. An apparatus for simplifying a query in a computer, the query being performed by the computer to retrieve data from a database stored in a electronic storage device coupled to the computer, the apparatus comprising:
-
(a) a computer; (b) means for accepting the query into the computer; and (c) means for replacing a first expression in the query with a second expression, wherein the first expression comprises;
space="preserve" listing-type="equation">π
.sub.X.sbsb.2 δ
.sub.X.sbsb.1 (e.sub.x)⊙
π
.sub.Y.sbsb.1 (e.sub.y)and the second expression comprises;
space="preserve" listing-type="equation">π
.sub.X.sbsb.2.sub.Y.sbsb.1 δ
.sub.V.sbsb.y.sub.X.sbsb.1.sub.Y.sbsb.1 (e.sub.x ⊙
e.sub.Y)wherein; eX =(RX, VX, EX) is a relation, where RX is a non-empty set of real attributes, VX is a non-empty set of virtual attributes, EX, an extension of the relation, also denoted as ext(eX), is a set of tuples, and X1 .OR right.RX, and X2 .OR right.X1, eY =(RY, VY, EY) is a relation, where RY is a non-empty set of real attributes, VY is a non-empty set of virtual attributes, EY, an extension of the relation, also denoted as ext(eY), is a set of tuples, and Y1 .OR right.RY, π
X (r) is a projection operation of relation r onto attributes X,δ
X (r) is a distinct projection operation of relation r onto attributes X, and⊙
ε
{, ←
, →
, ←
→
}, wherein represents a join operation, ←
→
represents a full outer join operation, ←
represents a left outer join operation, and →
represents a right outer join operation.
-
-
11. An apparatus for simplifying a query in a computer, the query being performed by the computer to retrieve data from a database stored in a electronic storage device coupled to the computer, the apparatus comprising:
-
(a) a computer; (b) means for accepting the query into the computer; and (c) means for replacing a first expression in the query with a second expression, wherein the first expression comprises;
space="preserve" listing-type="equation">π
.sub.X.sbsb.2 δ
.sub.X.sbsb.1 (e.sub.x)⊙
δ
.sub.Y.sbsb.1 (e.sub.y)and the second expression comprises;
space="preserve" listing-type="equation">π
.sub.X.sbsb.2.sub.Y.sbsb.1 δ
.sub.X.sbsb.1.sub.Y.sbsb.1 (e.sub.x ⊙
e.sub.Y)wherein; eX =(RX, VX, EX) is a relation, where RX is a non-empty set of real attributes, VX is a non-empty set of virtual attributes, EX, an extension of the relation, also denoted as ext(eX), is a set of tuples, and X1 .OR right.RX, and X2 .OR right.X1, eY =(RY, VY, EY) is a relation, where RY is a non-empty set of real attributes, VY is a non-empty set of virtual attributes, EY, an extension of the relation, also denoted as ext(eY), is a set of tuples, and Y1 .OR right.RY, π
X (r) is a projection operation of relation r onto attributes X,δ
X (r) is a distinct projection operation of relation r onto attributes X, and⊙
ε
{, ←
, →
, ←
→
}, wherein represents a join operation, ←
→
represents a full outer join operation, ←
represents a left outer join operation, and →
represents a right outer join operation.
-
-
12. An apparatus for simplifying a query in a computer, the query being performed by the computer to retrieve data from a database stored in a electronic storage device coupled to the computer, the apparatus comprising:
-
(a) a computer; (b) means for accepting the query into the computer; and (c) means for applying an identity to the query, wherein the identity comprises;
space="preserve" listing-type="equation">δ
.sub.X.sbsb.1.sub.Y.sbsb.1 (e.sub.x ⊙
.sup.p.sbsp.xy e.sub.y)=δ
.sub.X.sbsb.1 (e.sub.x).sub.⊙
.sup.p.sbsp.xy δ
.sub.Y.sbsb.1 (e.sub.y)and wherein; eX =(RX, VX, EX) is a relation, where RX is a non-empty set of real attributes, VX is a non-empty set of virtual attributes, EX, an extension of the relation, also denoted as ext(eX), is a set of tuples, and X1 .OR right.RX, eY =(RY, VY, EY) is a relation, where RY is a non-empty set of real attributes, VY is a non-empty set of virtual attributes, EY, an extension of the relation, also denoted as ext(eY), is a set of tuples, and Y1 .OR right.RY, pxy is a predicate, sch(pxy) is a schema of pxy, (sch(pxy)∩
RX).OR right.X1,(sch(pxy)∩
RY).OR right.Y1,δ
X (r) is a distinct projection operation of relation r onto attributes X, and⊙
ε
{, ←
, →
, ←
→
}, wherein represents a join operation, ←
→
represents a full outer join operation, ←
represents a left outer join operation, and →
represents a right outer join operation.
-
-
13. An article of manufacture comprising a computer program carrier embodying one or more instructions of a method of simplifying a query in a computer, the query being performed by the computer to retrieve data from a database stored in a electronic storage device coupled to the computer, the method comprising the steps of:
-
(a) accepting the query into the computer; and (b) replacing a first expression in the query with a second expression, wherein the first expression comprises;
space="preserve" listing-type="equation">δ
.sub.X.sbsb.1 (e.sub.x)⊙
δ
.sub.Y.sbsb.1 (e.sub.y)and the second expression comprises;
space="preserve" listing-type="equation">δ
.sub.X.sbsb.1.sub.Y.sbsb.1 (e.sub.x ⊙
e.sub.y)wherein; eX =(RX, VX, EX) is a relation, where RX is a non-empty set of real attributes, VX is a non-empty set of virtual attributes, EX, an extension of the relation, also denoted as ext(eX), is a set of tuples, and X1 .OR right.RX, and X2 .OR right.X1, eY =(RY, VY, EY) is a relation, where RY is a non-empty set of real attributes, VY is a non-empty set of virtual attributes, EY, an extension of the relation, also denoted as ext(eY), is a set of tuples, and Y1 .OR right.RY, and Y2 .OR right.Y1, δ
X (r) is a distinct projection operation of relation r onto attributes X, and⊙
ε
{, ←
, →
, ←
→
}, wherein represents a join operation, ←
→
represents a full outer join operation, ←
represents a left outer join operation, and →
represents a right outer join operation.
-
-
14. An article of manufacture comprising a computer program carrier embodying one or more instructions of a method of simplifying a query in a computer, the query being performed by the computer to retrieve data from a database stored in a electronic storage device coupled to the computer, the method comprising the steps of:
-
(a) accepting the query into the computer; and (b) replacing a first expression in the query with a second expression, wherein the first expression comprises;
space="preserve" listing-type="equation">π
.sub.X.sbsb.2 δ
.sub.X.sbsb.1 (e.sub.x)⊙
π
.sub.Y.sbsb.2 δ
.sub.Y.sbsb.1 (e.sub.y)and the second expression comprises;
space="preserve" listing-type="equation">π
.sub.X.sbsb.2.sub.Y.sbsb.2 δ
.sub.X.sbsb.1.sub.Y.sbsb.1 (e.sub.x ⊙
e.sub.Y)wherein; eX =(RX, VX, EX) is a relation, where RX is a non-empty set of real attributes, VX is a non-empty set of virtual attributes, EX, an extension of the relation, also denoted as ext(eX), is a set of tuples, and X1 .OR right.RX, and X2 .OR right.X1, eY =(RY, VY, EY) is a relation, where RY is a non-empty set of real attributes, VY is a non-empty set of virtual attributes, EY, an extension of the relation, also denoted as ext(eY), is a set of tuples, and Y1 .OR right.RY, and Y2 .OR right.Y1, π
X (r) is a projection operation of relation r onto attributes X,δ
X (r) is a distinct projection operation of relation r onto attributes X, and⊙
ε
{, ←
, →
, ←
→
}, wherein represents a join operation, ←
→
represents a full outer join operation, ←
represents a left outer join operation, and →
represents a right outer join operation.
-
-
15. An article of manufacture comprising a computer program carrier embodying one or more instructions of a method of simplifying a query in a computer, the query being performed by the computer to retrieve data from a database stored in a electronic storage device coupled to the computer, the method comprising the steps of:
-
(a) accepting the query into the computer; and (b) replacing a first expression in the query with a second expression, wherein the first expression comprises;
space="preserve" listing-type="equation">π
.sub.X.sbsb.1 (e.sub.x)⊙
δ
.sub.Y.sbsb.1 (e.sub.y)and the second expression comprises;
space="preserve" listing-type="equation">π
.sub.X.sbsb.1.sub.Y.sbsb.1 δ
.sub.V.sbsb.x.sub.X.sbsb.1.sub.Y.sbsb.1 (e.sub.x ⊙
e.sub.y)wherein; eX =(RX, VX, EX) is a relation, where RX is a non-empty set of real attributes, VX is a non-empty set of virtual attributes, EX, an extension of the relation, also denoted as ext(eX), is a set of tuples, and X1 .OR right.RX, eY =(RY, VY, EY) is a relation, where RY is a non-empty set of real attributes, VY is a non-empty set of virtual attributes, EY, an extension of the relation, also denoted as ext(eY), is a set of tuples, and Y1 .OR right.RY, π
X (r) is a projection operation of relation r onto attributes X,δ
X (r) is a distinct projection operation of relation r onto attributes X, and⊙
ε
{, ←
, →
, ←
→
}, wherein represents a join operation, ←
→
represents a full outer join operation, ←
represents a left outer join operation, and →
represents a right outer join operation.
-
-
16. An article of manufacture comprising a computer program carrier embodying one or more instructions of a method of simplifying a query in a computer, the query being performed by the computer to retrieve data from a database stored in a electronic storage device coupled to the computer, the method comprising the steps of:
-
(a) accepting the query into the computer; and (b) replacing a first expression in the query with a second expression, wherein the first expression comprises;
space="preserve" listing-type="equation">π
.sub.X.sbsb.2 δ
.sub.X.sbsb.1 (e.sub.x)⊙
π
.sub.Y.sbsb.1 (e.sub.y)and the second expression comprises;
space="preserve" listing-type="equation">π
.sub.X.sbsb.2.sub.Y.sbsb.1 δ
.sub.V.sbsb.y.sub.X.sbsb.1.sub.Y.sbsb.1 (e.sub.x ⊙
e.sub.Y)wherein; eX =(RX, VX, EX) is a relation, where RX is a non-empty set of real attributes, VX is a non-empty set of virtual attributes, EX, an extension of the relation, also denoted as ext(eX), is a set of tuples, and X1 .OR right.RX, and X2 .OR right.X1, eY =(RY, VY, EY) is a relation, where RY is a non-empty set of real attributes, VY is a non-empty set of virtual attributes, EY, an extension of the relation, also denoted as ext(eY), is a set of tuples, and Y1 .OR right.RY, π
X (r) is a projection operation of relation r onto attributes X,δ
X (r) is a distinct projection operation of relation r onto attributes X, and⊙
ε
{, ←
, →
, ←
→
}, wherein represents a join operation, ←
→
represents a full outer join operation, ←
represents a left outer join operation, and →
represents a right outer join operation.
-
-
17. An article of manufacture comprising a computer program carrier embodying one or more instructions of a method of simplifying a query in a computer, the query being performed by the computer to retrieve data from a database stored in a electronic storage device coupled to the computer, the method comprising the steps of:
-
(a) accepting the query into the computer; and (b) replacing a first expression in the query with a second expression, wherein the first expression comprises;
space="preserve" listing-type="equation">π
.sub.X.sbsb.2 δ
.sub.X.sbsb.1 (e.sub.x)⊙
δ
.sub.Y.sbsb.1 (e.sub.y)and the second expression comprises;
space="preserve" listing-type="equation">π
.sub.X.sbsb.2.sub.Y.sbsb.1 δ
.sub.X.sbsb.1.sub.Y.sbsb.1 (e.sub.x ⊙
e.sub.Y)wherein; eX =(RX, VX, EX) is a relation, where RX is a non-empty set of real attributes, VX is a non-empty set of virtual attributes, EX, an extension of the relation, also denoted as ext(eX), is a set of tuples, and X1 .OR right.RX, and X2 .OR right.X1, eY =(RY, VY, EY) is a relation, where RY is a non-empty set of real attributes, VY is a non-empty set of virtual attributes, EY, an extension of the relation, also denoted as ext(eY), is a set of tuples, and Y1 .OR right.RY, π
X (r) is a projection operation of relation r onto attributes X,δ
X (r) is a distinct projection operation of relation r onto attributes X, and⊙
ε
{, ←
, →
, ←
→
}, wherein represents a join operation, ←
→
represents a full outer join operation, ←
represents a left outer join operation, and →
represents a right outer join operation.
-
-
18. An article of manufacture comprising a computer program carrier embodying one or more instructions of a method of simplifying a query in a computer, the query being performed by the computer to retrieve data from a database stored in a electronic storage device coupled to the computer, the method comprising the steps of:
-
(a) accepting the query into the computer; and (b) applying an identity to the query, wherein the identity comprises;
space="preserve" listing-type="equation">δ
.sub.X.sbsb.1.sub.Y.sbsb.1 (e.sub.x ⊙
.sup.p.sbsp.xy e.sub.y)=δ
.sub.X.sbsb.1 (e.sub.x).sub.⊙
.sup.p.sbsp.xy δ
.sub.Y.sbsb.1 (e.sub.y)and wherein; eX =(RX, VX, EX) is a relation, where RX is a non-empty set of real attributes, VX is a non-empty set of virtual attributes, EX, an extension of the relation, also denoted as ext(eX), is a set of tuples, and X1 .OR right.RX, eY =(RY, VY, EY) is a relation, where RY is a non-empty set of real attributes, VY is a non-empty set of virtual attributes, EY, an extension of the relation, also denoted as ext(eY), is a set of tuples, and Y1 .OR right.RY, pxy is a predicate, sch(pxy) is a schema of pxy, (sch(pxy)∩
RX).OR right.X1,(sch(pxy)∩
RY).OR right.Y1,δ
X (r) is a distinct projection operation of relation r onto attributes X, and⊙
ε
{, ←
, →
, ←
→
}, wherein represents a join operation, ←
→
represents a full outer join operation, ←
represents a left outer join operation, and →
represents a right outer join operation.
-
Specification