20101217 mtg

444 views

Published on

Published in: Technology
  • Be the first to comment

  • Be the first to like this

20101217 mtg

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

×