• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
20101217 mtg
 

20101217 mtg

on

  • 364 views

 

Statistics

Views

Total Views
364
Views on SlideShare
364
Embed Views
0

Actions

Likes
0
Downloads
0
Comments
0

0 Embeds 0

No embeds

Accessibility

Categories

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    20101217 mtg 20101217 mtg Presentation Transcript

    • Minimization of SuperSQL Execution Time by Query DecompositionToyama LaboratoryMidterm PresentationRia Mae Borromeo25 December 2010
    • Introduction (1)
      an extension of SQL that provides the capability of generating various kinds of application data directly as a result of a query
      2
    • 3
    • Introduction (2)
      GENERATE HTML {
      {
      imagefile(path="C:webpage", "prc_logoback.gif"),
      imagefile(path="C:webpage", "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
    • 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
    • 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
    • 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



    • Proposal (2)
      3 Parts
      Detection of divisible queries
      Division of Queries
      Creation of SQL queries
      Execution of SQL queries
      Combination of query results
      8
    • SuperSQL query
      • Parse Query
      • Page decoration and query attributes are separated
      start
      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
    • Schema
      A tree-structured representation of the layout of the attributes
      10
      [ [t.t_name], [e.e_name], [s.s_name] ]
    • SuperSQL query
      • Parse Query
      • Page decoration and query attributes are separated
      • Make Tree Structure
      • The schema and the tuples from the database are combined into a tree-structure
      • Generate Code
      • Using the tree structure, code for application data is generated
      start
      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
    • 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
    • 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] ]
    • 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
    • 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. 
    • 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]]
    • 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
    • Example 2
      18
      3. Find connected components by Depth-First Search
      f.story
      f.title
      f.len
      f.len
      f.title
      r.bday
      r.bday
      r.name
      r.name
      f.dir
      f.dir
      a.act
      a.act
      r.bio
      r.bio
      f.id
      f.id
      r.id
      r.id
      a.film
      a.film
    • 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
    • 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
    • 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
    • Experiments (2)
      22
      • Check Divisibility Function
    • Experiments (3)
      23
      No. of Attributes
    • Experiments (4)
      24
      No. of Attributes
    • 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
    • 26
    • Future Work
      Continue implementation of the MakeTree function to address other query classes
      Testing
      More experiments
      Statistical Analysis of data
      27
    • 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
    • Thank you for listening. 