Initial QGM - PowerPoint PPT Presentation

1 / 23
About This Presentation
Title:

Initial QGM

Description:

Performing Feed for the topmost Box. Q1.Grade =Q2.$1. CDept= mgmt' Max. Q1. Q2. supp. took ... the topmost box into one box as every tuple in the topmost box ... – PowerPoint PPT presentation

Number of Views:23
Avg rating:3.0/5.0
Slides: 24
Provided by: DiY1
Learn more at: http://web.cs.wpi.edu
Category:
Tags: qgm | initial | topmost

less

Transcript and Presenter's Notes

Title: Initial QGM


1
Initial QGM
2
Q1.CDeptmgmt AndQ1.GradegtQ2.1
SELECT Q1.SName FROM took Q1, temp1 Q2 WHERE
Q1.CDept mgmt AND Q1.Grade gt
Q2.1
Q2
Q1
Grade
SName, CName, CDept, Grade
temp1
SELECT Max(Grade) AS Grade FROM Child Q4
Q4
Max
Grade
took
SELECT Grade FROM took Q3 WHERE
Q3.CNameQ1.CName
Q3
CName, Grade
took
3
Performing Feed for the topmost Box
4
supp
Q1.GradegtQ2.1
SELECT Q1.SName FROM took Q1, temp1 Q2 WHERE
Q1.Grade gt Q2.1
Q2
Q1
Grade
SName, CName, Grade
temp1
SELECT MAX (Grade) AS Grade FROM Child
Q4
Max
CDeptmgmt
SELECT DISTINCT CName FROM supp
distinct
SName, CName, CDept, Grade
Magic_1
took
5
supp
Q1.GradegtQ2.1
SELECT Q1.SName FROM took Q1, CIBox Q2 WHERE
Q1.Grade gt Q2.1
Q2
Q1
SName, CName, Grade
SELECT Q3.Grade FROM DCOBox Q3 WHERE Q3.CName
Q1.CName
Q3
Q3.CNameQ1.CName
CIBox
CName
CName
CName,Grade
CDeptmgmt
distinct
Q4
Q5
SELECT Q4.cName, Q5.1FROM Magic_1 Q4,
temp1 Q5
SName, CName, CDept, Grade
DCOBox
Grade
Magic_1
Q6
took
temp1
Max
6
Can merge the C1Box and the topmost box into one
box as every tuple in the topmost box joins with
atmost one tuple in the C1Box
7
supp
Q1.GradegtQ2.Grade Q1.cNameQ2.cName
SELECT Q1.sName FROM supp Q1, DCOBox Q2WHERE
Q1.cNameQ2.cName AND Q1.GradegtQ2.Grade
Q2
Q1
SName, CName, Grade
CName,Grade
CName
CName
CDeptmgmt
SELECT Q4.cName,Q5.1FROM Magic_1 Q4,
temp1 Q5
distinct
Q4
Q5
SName, CName, CDept, Grade
DCOBox
Grade
Magic_1
Q6
took
temp1
Max
8
Starting Point for the Aggregation Box
9
CName, Grade
Q4
Q5
SELECT Q4.CName, Q5.1 AS Grade FROM Magic_1 Q4,
temp1 Q5
DCOBox
Grade
CName
temp1
SELECT Max(Grade) AS Grade FROM Child Q6
Q6
Max
distinct
Grade
Magic_1
Q4.CNameQ3.CName
Q3
SELECT Grade FROM took Q3 WHERE
Q3.CNameQ1.CName
CName, Grade
took
10
Performing Feed for the aggregate Box
11
CName, Grade
SELECT Q4.CName,Q5.1 From Magic_1 Q4,
temp1 Q5
Q4
Q5
DCOBox
Grade
CName
SELECT Max(Grade) AS Grade FROM Child Q6
Q6
Max
temp1
Grade
SELECT Grade FROM DCOBox Q7 WHERE Q7.CName
Q4.CName
distinct
Q7.cNameQ4.cName
Q7
CIBox
CName
CName, Grade
Magic_1
Q8
Q9
SELECT Q8.CName, Q9.Grade FROM Magic_2 Q8, Child
Q9
DCOBox
Grade
SELECT Grade FROM took Q3 WHERE Q3.CName
Q1.CName
CName
Q1.CNameQ3.CName
Q3
distinct
CName, Grade
Magic_2
took
12
Performing Absorb for the aggregate Box
introduce the Group By and the LOJ
13
CName, Grade
Q4
Q5
DCOBox
SELECT Q4.CName, Q5.Grade FROM Magic_1 Q4 LOJ
temp1 Q5 ON CName
CName, Grade
SELECT CName, MAX (Grade) AS GradeFROM Child
Q6GROUPBY Q6.CName
CName
Max
Q6
temp1
CName, Grade
distinct
Q7
CIBox
CName
CName, Grade
Magic_1
Q8
Q9
DCOBox
Grade
CName
Q1.cNameQ3.cName
Q3
distinct
CName, Grade
Magic_2
took
14
The LOJ is unnecessary here, and the C1Box is
also unnecessary.
15
Q1.GradegtQ2.Grade Q1.CNameQ2.CName
SELECT Q1.SName FROM supp Q1, temp1 Q2 WHERE
Q1.CName Q2.CName AND Q1.Grade
gt Q2.Grade
Q2
Q1
CName, Grade
SELECT CName, MAX (Grade) AS GradeFROM Child
Q6GROUPBY Q6.CName
Q6
temp1
Max
CName, Grade
Q8
Q9
DCOBox
Grade
CName
Q1.CNameQ3.CName
Q3
distinct
CName, Grade
Magic_2
took
16
Starting Point for the bottommost SPJ Box
17
CName, Grade
SELECT Q8.CName, Q9.Grade FROM Magic_2 Q8, temp2
Q9
Q8
Q9
DCOBox
Grade
CName
temp2
Q8.CNameQ3.CName
Q3
SELECT Grade FROM took Q3 WHERE Q3.CName
Q1.CName
distinct
CName, Grade
took
Magic_2
18
Performing Absorb for the SPJ Box
19
CName, Grade
SELECT Q9.CName, Q9.Grade FROM temp2 Q9
Q8
Q9
DCOBox
CName, Grade
CName
temp2
Q10.CNameQ3.CName
Q3
Q10
SELECT Q3.CName, Q3.Grade FROM Magic_2 Q10, took
Q3 WHERE Q3.CName Q10.CName
distinct
CName
CName, Grade
took
Magic_2
20
Remove unnecessary DCOBox
21
CName, Grade
SELECT Q3.CName, Q3.Grade FROM Magic_2 Q10, took
Q3 WHERE Q3.CName Q10.CName
Q10.cNameQ3.cName
Q3
Q10
distinct
CName
CName, Grade
took
Magic_2
22
The Final QGM
23
Q1.GradegtQ2.Grade Q1.CNameQ2.CName
SELECT Q1.sName FROM supp Q1, temp1 Q2WHERE
Q1.CNameQ2.CName AND Q1.GradegtQ2.Grade
Q2
Q1
SName, CName, Grade
CName, Grade
SELECT CName, MAX (Grade) AS GradeFROM Child
Q6GROUPBY Q6.CName
temp1
Q6
Max
CDeptmgmt
CName, Grade
SName, CName, CDept, Grade
CName
Q10.CNameQ3.CName
Q3
Q10
SELECT Q3.CName, Q3.Grade FROM Magic_2 Q10, took
Q3 WHERE Q3.CName Q10.CName
distinct
took
CName
CName, Grade
took
Magic_2
Write a Comment
User Comments (0)
About PowerShow.com