4. Introduction (2) GENERATE HTML { { imagefile(path="C:ebpage", "prc_logoback.gif"), imagefile(path="C:ebpage", "main_top02.gif") @{valign=middle, align=center} } @{bgcolor="#296793", width="600"}! ""@{border-width=0, height=20}! "August 2010 Physician Licensure Exam"@{font-size=20, align="center"}! { {"List of Exams"@{align="center", font-size=14}! [link(t.t_name@{font-size=12, width=150}, file="", att="")@{border-width=0}]! }@{valign=top}, {"List of Passers"@{align="center", font-size=14}! [e.e_name@{font-size=10, border-width=0}]! }@{width=330, align=left, valign=top}, {"List of Schools"@{align="center", font-size=14}! [s.s_name@{font-size=10, border-width=0}]! }@{width=330, align=left, valign=top} }@{align="center"} } FROM examinee e, school s, examtype t 4 Remove decorations
5. Introduction (3) GENERATE HTML { {"List of Exams"![t.t_name]!}, {"List of Passers"![e.e_name]!}, {"List of Schools"![s.s_name]!} } FROM examtype t, examinee e, school s 5 SQL Query SELECT DISTINCT t.t_name, e.e_name, s.s_name, FROMexamtype t, examinee e, school s
6. Problem Illustration Expected Output SELECT DISTINCT t.t_name, e.e_name, s.s_name, FROMexamtype t, examinee e, school s x x 20 + 250 + 50 = 320 tuples … Intermediate Table (250,000) 6
7. Proposal (1) GENERATE HTML { {"List of Exams"![t.t_name]!}, {"List of Passers"![e.e_name]!}, {"List of Schools"![s.s_name]!} } FROM examtype t, examinee e, school s SELECT DISTINCT t.t_name, e.e_name, s.s_name, FROMexamtype t, examinee e, school s SELECT t_name FROM examtype SELECT e_name FROM examinee SELECT s_name FROM school Expected Output … … …
8. Proposal (2) 3 Parts Detection of divisible queries Division of Queries Creation of SQL queries Execution of SQL queries Combination of query results 8
9.
10. Page decoration and query attributes are separatedstart Parse Query Parse Query Make Schema Make Schema Make SQL Statement Original Process Data Construction Execute SQL Statement Make Tree Structure Generate Code Application Data end 9
11. Schema A tree-structured representation of the layout of the attributes 10 [ [t.t_name], [e.e_name], [s.s_name] ]
17. Using the tree structure, code for application data is generatedstart Parse Query Parse Query Make Schema Make Schema Make SQL Statement Make SQL Statement Original Process Data Construction Execute SQL Statement Execute SQL Statement Make Tree Structure Make Tree Structure Generate Code Generate Code Application Data end 11
18. start SuperSQL query Parse Query Make Schema Proposed Process Check Divisibility Make SQL Statements Check Divisibility Make SQL Statement Y N Execute SQL Statement Execute SQL Statements Generate Code Make Tree Structure Combine results into a tree structure Application Data end 12
19. Check Divisibility Algorithm 13 1. Get the attributes from the schema GENERATE HTML { {"List of Exams"![t.t_name]!}, {"List of Passers"![e.e_name]!}, {"List of Schools"![s.s_name]!} } FROM examtype t, examinee e, school s Schema [ [t.t_name], [e.e_name], [s.s_name] ]
20. Check Divisibility Algorithm 14 2. Make a graph to identify relationships t.t_name s.s_name e.e_name Vertices : attributes Edges: If two attributes are from the same table If two attributes are equated in a where condition If two attributes are grouped in the schema
21. Check Divisibility Algorithm 15 3. Find connected components using Depth-First Search t.t_name s.s_name e.e_name Connected Component - a subgraph that contains a path between all pairs of vertices in the subgraph Depth-First Search - A search algorithm that extends the current path as far as possible before backtracking to the last choice point and trying the next alternative path.
22. Example 2 16 1. Get the attributes from the schema GENERATE HTML [ f.title! {{ { "Director" ! f.dir } ! { "Running" ! f.length } }, { "Starring" , [ r.name % {r.name , { "Birthday" , r.bday }! "Biography" ! r.bio } } ]! } }! f.story]! FROM film f, actor r, act a WHERE a.film = f.id AND a.act = r.id [[f.title, f.dir, f.length, [actor.name, actor.name, actor.birthday, actor.biography], f.story]]
23. Example 2 17 2. Make a graph to identify relationships f.story f.title f.len r.bday r.name f.dir a.act r.bio f.id r.id a.film
25. start SuperSQL query Parse Query Make Schema Proposed Process Check Divisibility Make SQL Statements Check Divisibility Make SQL Statements Make SQL Statement Y N Execute SQL Statement Execute SQL Statements Execute SQL Statements Generate Code Make Tree Structure Combine results into a tree structure Combine results into a tree structure Application Data end 19
26. Current Status 3 Parts Detection of divisible queries Division of Queries Creation of SQL queries Execution of SQL queries Combination of query results Trivial case: columns are independent of each other Others 20
27. Experiments (1) Intel (R) Core (TM)2 Duo CPU 2.09 GHz 1.97 GB RAM Microsoft Windows XP Professional 2002 SP3 Java 6 Update 22 Standard Edition 21
30. Summary Implemented an algorithm for checking if SuperSQL queries can be decomposed into several SQL Queries Queries are decomposed into several SQL queries when possible Experiments show that the procedure reduces the execution time of SuperSQL in some query cases 25
32. Future Work Continue implementation of the MakeTree function to address other query classes Testing More experiments Statistical Analysis of data 27
33. Comments from Panel Research Suggestions: Use database information For the example, use embedded system (with limited memory) that generates webpages Presentation Suggestion: Take note of the number of decimal points in the data Question: How can you be sure that the output generated by the new one is the same as the original? It can be verified by checking the tree structure 28