K.Subieta. SBA and SBQL, appendix, slide 1 Sept. 2006 Appendix: how the ENVS and QRES stacks work (M0 example) Presentation prepared for OMG Object Database.

Slides:



Advertisements
Similar presentations
Research conducted by the Chair of Information Systems PJIIT Leader: Prof. Kazimierz Subieta Staff: 11 research and didactic workers (1 Prof, 4 PhD, 6.
Advertisements

Chapter 13: Query Processing
1 Top-K Algorithms: Concepts and Applications by Demetris Zeinalipour Visiting Lecturer Department of Computer Science University of Cyprus Department.
Implementing Reflective Access Control in SQL Lars E. Olson 1, Carl A. Gunter 1, William R. Cook 2, and Marianne Winslett 1 1 University of Illinois at.
CS 540 Database Management Systems
6.830/6.814 Lecture 5 Database Internals Continued September 17, 2014.
Set operators (UNION, UNION ALL, MINUS, INTERSECT) [SQL]
ISBN Chapter 3 Describing Syntax and Semantics.
1 Theory, Practice & Methodology of Relational Database Design and Programming Copyright © Ellis Cohen Query & Application Performance These.
Query Evaluation. An SQL query and its RA equiv. Employees (sin INT, ename VARCHAR(20), rating INT, age REAL) Maintenances (sin INT, planeId INT, day.
K.Subieta. SBA and SBQL, slide 1 Sept SBA (Stack-Based Approach) and SBQL (Stack-Based Query Language) Presentation prepared for OMG Object Database.
Using one level of Cache:
DB performance tuning using indexes Section 8.5 and Chapters 20 (Raghu)
CS263 Lecture 19 Query Optimisation.  Motivation for Query Optimisation  Phases of Query Processing  Query Trees  RA Transformation Rules  Heuristic.
1 Physical Database Design and Tuning Module 5, Lecture 3.
Query Optimization Example Source: Query Optimization, Y. E. Ioannidis, ACM Computing Surveys, 28(1), March Database Tables: Emp (name, age, sal,
Query Optimization 3 Cost Estimation R&G, Chapters 12, 13, 14 Lecture 15.
Describing Syntax and Semantics
L Distributed Query Optimization Algorithms -- 1 Distributed Query Optimization Algorithms v System R and R* v Hill Climbing and SDD-1.
1 Optimization. 2 Why Optimize? Given a query of size n and a database of size m, how big can the output of applying the query to the database be? Example:
K.Subieta. PJIIT 2 OMG, slide 1 Dec Presentation by: Prof. Kazimierz Subieta Polish-Japanese Institute of Information Technology, Warsaw, PolandPolish-Japanese.
K.Subieta. Object-Oriented Query Languages and Views, slide 1 Sept Tutorial: Object-Oriented Query Languages and Views Part 1: Basic concepts and.
K.Subieta. Introduction to SBA and SBQL, Slide 1 3rd Country Conference, Feb.2007 SBA (Stack-Based Approach) and SBQL (Stack-Based Query Language) by Prof.
K.Subieta. SBA and SBQL, slide 1 June 2007 Stack-Based Approach and Stack-Based Query Language - Overview Presentation prepared for the OMG Analysis &
K.Subieta. SBA and SBQL, slide 1 Sept SBA (Stack-Based Approach) and SBQL (Stack-Based Query Language) Presentation prepared for OMG Object Database.
K.Subieta. Advanced Notions of SBQL, Slide 1 3rd Country Conference, Feb.2007 Advanced Notions of SBQL (procedures, views, types, etc.) by Prof. Kazimierz.
SOFSEM-SRF 2006, January 21-26, Merin, Czech Republic R. Adamus,K. Kuliberda, J. Wislicki, K. Subieta Wrapping Relational Data Structures to Object-Oriented.
1 ICS 184: Introduction to Data Management Lecture Note 10 SQL as a Query Language (Cont.)
Copyright © 2004 Pearson Education, Inc.. Chapter 15 Algorithms for Query Processing and Optimization.
K.Stencel. SBQL Views, slide 1 March 2008 SBQL Object Views. Unlimited Mapping and Updatability Presentation prepared for 1 st International Conference.
Dept [0..*] dname: string location: string [1..*] Emp [0..*] name: string age: integer sal: integer [0..1] worksIn [1..1] employs [1..*] i 50 Dept i 51.
Query Processing. Steps in Query Processing Validate and translate the query –Good syntax. –All referenced relations exist. –Translate the SQL to relational.
K.Subieta. ODB Semantics: SBA, slide 1 December 2007 Object Database Semantics: the Stack-Based Architecture Presentation prepared for Object Database.
November 2001, Slide 1 P.Habela, K.Subieta: Standard Metamodel for Object Databases (1) Standard Metamodel for Object Databases (1): Introduction Piotr.
K.Subieta. Updating Issues in SBQL, slide 1 June 2007 Updating Issues in SBQL Presentation prepared for OMG Object Database Technology Working Group OMG.
Normalizing Your Database CPT 242. Normalization The procedure where the developer analyzes the data and establishes the table structure to create the.
Query Optimization CMPE 226 Database Systems By, Arjun Gangisetty
K.Subieta. SBA & SBQL, slide 1 March 2008 Stack-Based Architecture and Stack-Based Query Language Presentation prepared for 1 st International Conference.
1 Theory, Practice & Methodology of Relational Database Design and Programming Copyright © Ellis Cohen Relational State Assertions These slides.
1 Theory, Practice & Methodology of Relational Database Design and Programming Copyright © Ellis Cohen Collection Operators These slides are.
IMS 4212: Database Implementation 1 Dr. Lawrence West, Management Dept., University of Central Florida Physical Database Implementation—Topics.
CS 440 Database Management Systems Lecture 5: Query Processing 1.
1 Theory, Practice & Methodology of Relational Database Design and Programming Copyright © Ellis Cohen Collection Operators These slides are.
CS 540 Database Management Systems
Fan Qi Database Lab 1, com1 #01-08 CS3223 Tutorial 8.
UNIVERSITY OF SOUTH CAROLINA Department of Computer Science and Engineering CSCE 330 Programming Language Structures Operational Semantics (Slides mainly.
November 2001, Slide 1 P.Habela, K.Subieta: Standard Metamodel for Object Databases (2) Standard Metamodel for Object Databases (2): Proposed Improvements.
K.Subieta. SBA and SBQL, appendix, slide 1 Sept Appendix: how the ENVS and QRES stacks work (example) Presentation prepared for OMG Object Database.
PPL Syntax & Formal Semantics Lecture Notes: Chapter 2.
BTEC L3 Extended Unit 1 – Communication and Employability Skills for IT.
Execution Plans Detail From Zero to Hero İsmail Adar.
CS 603: Programming Language Organization Lecture 6 Spring 2003 Department of Computer Science University of Alabama Joel Jones.
CHAPTER 19 Query Optimization. CHAPTER 19 Query Optimization.
Module 11: File Structure
CS 440 Database Management Systems
Database Management System
Database System Implementation CSE 507
Generalization.
Stack Lesson xx   This module shows you the basic elements of a type of linked list called a stack.
Access Path Selection in a Relational Database Management System
CS222: Principles of Data Management Notes #13 Set operations, Aggregation Instructor: Chen Li.
Action Plan presentation
Relational Query Optimization
CS222P: Principles of Data Management Notes #13 Set operations, Aggregation, Query Plans Instructor: Chen Li.
4 Years Milestone plan – (Company Name)
Database Systems (資料庫系統)
Lecture 2 מבוא מורחב.
Lecture 2 מבוא מורחב.
Database Programming Using Oracle 11g
How the ENVS and QRES stacks work (example)
Presentation transcript:

K.Subieta. SBA and SBQL, appendix, slide 1 Sept Appendix: how the ENVS and QRES stacks work (M0 example) Presentation prepared for OMG Object Database Technology Working Group OMG TECHNICAL MEETING, Anaheim, CA USA September 25-29, 2006 by Prof. Kazimierz Subieta Polish-Japanese Institute of Information Technology, Warsaw, Poland SBA/SBQL pages:

K.Subieta. SBA and SBQL, appendix, slide 2 Sept Query addressing a tiny database Query: For each department get its reference and the average sal of its employees. SBQL: Dept join avg((employs.Emp).sal) Tiny database: Expected result: bag{ struct{i 17, 2500}, struct{i 22, 1450} }

K.Subieta. SBA and SBQL, appendix, slide 3 Sept Query syntax tree and execution scenario Dept join avg( ( employs. Emp ). sal ) join Deptavg..sal employsEmp 2 nd dot 1 st dot join1 st dot2 nd dot avg 1 st Dept 2 nd Dept 1 st employs 2 nd employs 1 st Emp 2 nd Emp 3 rd Emp3 rd employs

K.Subieta. SBA and SBQL, appendix, slide 4 Sept Dept join avg( ( employs. Emp ). sal ) Emp(i 1 ) Emp(i 5 ) Emp(i 9 ) Dept(i 17 ) Dept(i 22 ) ENVSQRES empty Start

K.Subieta. SBA and SBQL, appendix, slide 5 Sept Dept join avg( ( employs. Emp ). sal ) Emp(i 1 ) Emp(i 5 ) Emp(i 9 ) Dept(i 17 ) Dept(i 22 ) ENVSQRES bag{ i 17, i 22 } After binding Dept

K.Subieta. SBA and SBQL, appendix, slide 6 Sept Dept join avg( ( employs. Emp ). sal ) Emp(i 1 ) Emp(i 5 ) Emp(i 9 ) Dept(i 17 ) Dept(i 22 ) ENVSQRES bag{ i 17, i 22 } join starts 1 st loop of the iteration over top of QRES dname(i 18 ) loc(i 19 ) loc(i 20 ) employs(i 21 ) nested

K.Subieta. SBA and SBQL, appendix, slide 7 Sept Dept join avg( ( employs. Emp ). sal ) Emp(i 1 ) Emp(i 5 ) Emp(i 9 ) Dept(i 17 ) Dept(i 22 ) ENVSQRES bag{ i 17, i 22 } dname(i 18 ) loc(i 19 ) loc(i 20 ) employs(i 21 ) After binding employs i 21

K.Subieta. SBA and SBQL, appendix, slide 8 Sept Dept join avg( ( employs. Emp ). sal ) Emp(i 1 ) Emp(i 5 ) Emp(i 9 ) Dept(i 17 ) Dept(i 22 ) ENVSQRES bag{ i 17, i 22 } dname(i 18 ) loc(i 19 ) loc(i 20 ) employs(i 21 ) i 21 dot starts iteration on top of QRES Emp(i 1 ) nested

K.Subieta. SBA and SBQL, appendix, slide 9 Sept Dept join avg( ( employs. Emp ). sal ) Emp(i 1 ) Emp(i 5 ) Emp(i 9 ) Dept(i 17 ) Dept(i 22 ) ENVSQRES bag{ i 17, i 22 } dname(i 18 ) loc(i 19 ) loc(i 20 ) employs(i 21 ) i 21 Emp(i 1 ) After binding Emp i1i1

K.Subieta. SBA and SBQL, appendix, slide 10 Sept Dept join avg( ( employs. Emp ). sal ) Emp(i 1 ) Emp(i 5 ) Emp(i 9 ) Dept(i 17 ) Dept(i 22 ) ENVSQRES bag{ i 17, i 22 } dname(i 18 ) loc(i 19 ) loc(i 20 ) employs(i 21 ) Closing the iteration by the first dot i1i1

K.Subieta. SBA and SBQL, appendix, slide 11 Sept Dept join avg( ( employs. Emp ). sal ) Emp(i 1 ) Emp(i 5 ) Emp(i 9 ) Dept(i 17 ) Dept(i 22 ) ENVSQRES bag{ i 17, i 22 } dname(i 18 ) loc(i 19 ) loc(i 20 ) employs(i 21 ) i1i1 Second dot starts iteration over top of QRES name(i 2 ) sal(i 3 ) worksIn(i 4 ) nested

K.Subieta. SBA and SBQL, appendix, slide 12 Sept Dept join avg( ( employs. Emp ). sal ) Emp(i 1 ) Emp(i 5 ) Emp(i 9 ) Dept(i 17 ) Dept(i 22 ) ENVSQRES bag{ i 17, i 22 } dname(i 18 ) loc(i 19 ) loc(i 20 ) employs(i 21 ) i1i1 name(i 2 ) sal(i 3 ) worksIn(i 4 ) After binding sal i3i3

K.Subieta. SBA and SBQL, appendix, slide 13 Sept Dept join avg( ( employs. Emp ). sal ) Emp(i 1 ) Emp(i 5 ) Emp(i 9 ) Dept(i 17 ) Dept(i 22 ) ENVSQRES bag{ i 17, i 22 } dname(i 18 ) loc(i 19 ) loc(i 20 ) employs(i 21 ) i3i3 Closing the iteration by the second dot

K.Subieta. SBA and SBQL, appendix, slide 14 Sept Dept join avg( ( employs. Emp ). sal ) Emp(i 1 ) Emp(i 5 ) Emp(i 9 ) Dept(i 17 ) Dept(i 22 ) ENVSQRES bag{ i 17, i 22 } dname(i 18 ) loc(i 19 ) loc(i 20 ) employs(i 21 ) 2500 After performing avg on top of QRES

K.Subieta. SBA and SBQL, appendix, slide 15 Sept Dept join avg( ( employs. Emp ). sal ) Emp(i 1 ) Emp(i 5 ) Emp(i 9 ) Dept(i 17 ) Dept(i 22 ) ENVSQRES bag{ i 17, i 22 } dname(i 18 ) loc(i 19 ) loc(i 20 ) employs(i 21 ) 2500 join forms the first partial result struct{ i 17, 2500 }Partial result of join:

K.Subieta. SBA and SBQL, appendix, slide 16 Sept After ending the 1 st loop by join 12 Dept join avg( ( employs. Emp ). sal ) Emp(i 1 ) Emp(i 5 ) Emp(i 9 ) Dept(i 17 ) Dept(i 22 ) ENVSQRES bag{ i 17, i 22 } struct{ i 17, 2500 }Partial result of join:

K.Subieta. SBA and SBQL, appendix, slide 17 Sept Dept join avg( ( employs. Emp ). sal ) Emp(i 1 ) Emp(i 5 ) Emp(i 9 ) Dept(i 17 ) Dept(i 22 ) ENVSQRES bag{ i 17, i 22 } join starts 2 nd loop of the iteration over top of QRES dname(i 23 ) loc(i 24 ) employs(i 25 ) employs(i 26 ) nested struct{ i 17, 2500 }Partial result of join:

K.Subieta. SBA and SBQL, appendix, slide 18 Sept After binding employs 14 Dept join avg( ( employs. Emp ). sal ) Emp(i 1 ) Emp(i 5 ) Emp(i 9 ) Dept(i 17 ) Dept(i 22 ) ENVSQRES bag{ i 17, i 22 } dname(i 23 ) loc(i 24 ) employs(i 25 ) employs(i 26 ) bag{ i 25, i 26 } struct{ i 17, 2500 }Partial result of join:

K.Subieta. SBA and SBQL, appendix, slide 19 Sept Dept join avg( ( employs. Emp ). sal ) Emp(i 1 ) Emp(i 5 ) Emp(i 9 ) Dept(i 17 ) Dept(i 22 ) ENVSQRES bag{ i 17, i 22 } dname(i 23 ) loc(i 24 ) employs(i 25 ) employs(i 26 ) bag{ i 25, i 26 } First dot starts 1 st loop of iteration on top of QRES nested Emp(i 5 ) struct{ i 17, 2500 }Partial result of join:

K.Subieta. SBA and SBQL, appendix, slide 20 Sept After binding Emp 16 Dept join avg( ( employs. Emp ). sal ) Emp(i 1 ) Emp(i 5 ) Emp(i 9 ) Dept(i 17 ) Dept(i 22 ) ENVSQRES bag{ i 17, i 22 } dname(i 23 ) loc(i 24 ) employs(i 25 ) employs(i 26 ) bag{ i 25, i 26 } Emp(i 5 ) struct{ i 17, 2500 }Partial result of join: i5i5

K.Subieta. SBA and SBQL, appendix, slide 21 Sept Forming 1 st partial result of the first dot 17 Dept join avg( ( employs. Emp ). sal ) Emp(i 1 ) Emp(i 5 ) Emp(i 9 ) Dept(i 17 ) Dept(i 22 ) ENVSQRES bag{ i 17, i 22 } dname(i 23 ) loc(i 24 ) employs(i 25 ) employs(i 26 ) bag{ i 25, i 26 } struct{ i 17, 2500 }Partial result of join: i5i5 Partial result of dot:

K.Subieta. SBA and SBQL, appendix, slide 22 Sept Dept join avg( ( employs. Emp ). sal ) Emp(i 1 ) Emp(i 5 ) Emp(i 9 ) Dept(i 17 ) Dept(i 22 ) ENVSQRES bag{ i 17, i 22 } dname(i 23 ) loc(i 24 ) employs(i 25 ) employs(i 26 ) bag{ i 25, i 26 } struct{ i 17, 2500 }Partial result of join: i5i5 Partial result of dot: First dot starts 2 nd loop of iteration on top of QRES nested Emp(i 9 )

K.Subieta. SBA and SBQL, appendix, slide 23 Sept Dept join avg( ( employs. Emp ). sal ) Emp(i 1 ) Emp(i 5 ) Emp(i 9 ) Dept(i 17 ) Dept(i 22 ) ENVSQRES bag{ i 17, i 22 } dname(i 23 ) loc(i 24 ) employs(i 25 ) employs(i 26 ) bag{ i 25, i 26 } struct{ i 17, 2500 }Partial result of join: i5i5 Partial result of dot: Emp(i 9 ) After binding Emp i9i9

K.Subieta. SBA and SBQL, appendix, slide 24 Sept Dept join avg( ( employs. Emp ). sal ) Emp(i 1 ) Emp(i 5 ) Emp(i 9 ) Dept(i 17 ) Dept(i 22 ) ENVSQRES bag{ i 17, i 22 } dname(i 23 ) loc(i 24 ) employs(i 25 ) employs(i 26 ) bag{ i 25, i 26 } struct{ i 17, 2500 }Partial result of join: i5i5 Partial results of dot: i9i9 Forming 2 nd partial result of the first dot

K.Subieta. SBA and SBQL, appendix, slide 25 Sept Dept join avg( ( employs. Emp ). sal ) Emp(i 1 ) Emp(i 5 ) Emp(i 9 ) Dept(i 17 ) Dept(i 22 ) ENVSQRES bag{ i 17, i 22 } dname(i 23 ) loc(i 24 ) employs(i 25 ) employs(i 26 ) bag{ i 5, i 9 } struct{ i 17, 2500 }Partial result of join: Closing iteration by the first dot, forming its result

K.Subieta. SBA and SBQL, appendix, slide 26 Sept Dept join avg( ( employs. Emp ). sal ) Emp(i 1 ) Emp(i 5 ) Emp(i 9 ) Dept(i 17 ) Dept(i 22 ) ENVSQRES bag{ i 17, i 22 } dname(i 23 ) loc(i 24 ) employs(i 25 ) employs(i 26 ) bag{ i 5, i 9 } struct{ i 17, 2500 }Partial result of join: Second dot starts 1 st loop of iteration on top of QRES nested name(i 6 ) sal(i 7 ) worksIn(i 8 )

K.Subieta. SBA and SBQL, appendix, slide 27 Sept Dept join avg( ( employs. Emp ). sal ) Emp(i 1 ) Emp(i 5 ) Emp(i 9 ) Dept(i 17 ) Dept(i 22 ) ENVSQRES bag{ i 17, i 22 } dname(i 23 ) loc(i 24 ) employs(i 25 ) employs(i 26 ) bag{ i 5, i 9 } struct{ i 17, 2500 }Partial result of join: name(i 6 ) sal(i 7 ) worksIn(i 8 ) After binding sal i7i7

K.Subieta. SBA and SBQL, appendix, slide 28 Sept Dept join avg( ( employs. Emp ). sal ) Emp(i 1 ) Emp(i 5 ) Emp(i 9 ) Dept(i 17 ) Dept(i 22 ) ENVSQRES bag{ i 17, i 22 } dname(i 23 ) loc(i 24 ) employs(i 25 ) employs(i 26 ) bag{ i 5, i 9 } struct{ i 17, 2500 }Partial result of join: Forming 1 st partial result of the second dot i7i7 Partial result of dot:

K.Subieta. SBA and SBQL, appendix, slide 29 Sept Dept join avg( ( employs. Emp ). sal ) Emp(i 1 ) Emp(i 5 ) Emp(i 9 ) Dept(i 17 ) Dept(i 22 ) ENVSQRES bag{ i 17, i 22 } dname(i 23 ) loc(i 24 ) employs(i 25 ) employs(i 26 ) bag{ i 5, i 9 } struct{ i 17, 2500 }Partial result of join: i7i7 Partial result of dot: Second dot starts 2 nd loop of iteration on top of QRES nested name(i 10 ) sal(i 11 ) address(i 12 ) worksIn(i 16 )

K.Subieta. SBA and SBQL, appendix, slide 30 Sept Dept join avg( ( employs. Emp ). sal ) Emp(i 1 ) Emp(i 5 ) Emp(i 9 ) Dept(i 17 ) Dept(i 22 ) ENVSQRES bag{ i 17, i 22 } dname(i 23 ) loc(i 24 ) employs(i 25 ) employs(i 26 ) bag{ i 5, i 9 } struct{ i 17, 2500 }Partial result of join: i7i7 Partial result of dot: name(i 10 ) sal(i 11 ) address(i 12 ) worksIn(i 16 ) After binding sal i 11

K.Subieta. SBA and SBQL, appendix, slide 31 Sept Dept join avg( ( employs. Emp ). sal ) Emp(i 1 ) Emp(i 5 ) Emp(i 9 ) Dept(i 17 ) Dept(i 22 ) ENVSQRES bag{ i 17, i 22 } dname(i 23 ) loc(i 24 ) employs(i 25 ) employs(i 26 ) bag{ i 5, i 9 } struct{ i 17, 2500 }Partial result of join: i7i7 Partial result of dot: i 11 Forming 2 nd partial result of the second dot

K.Subieta. SBA and SBQL, appendix, slide 32 Sept Dept join avg( ( employs. Emp ). sal ) Emp(i 1 ) Emp(i 5 ) Emp(i 9 ) Dept(i 17 ) Dept(i 22 ) ENVSQRES bag{ i 17, i 22 } dname(i 23 ) loc(i 24 ) employs(i 25 ) employs(i 26 ) bag{ i 7, i 11 } struct{ i 17, 2500 }Partial result of join: Closing iteration by the second dot, forming its result

K.Subieta. SBA and SBQL, appendix, slide 33 Sept Dept join avg( ( employs. Emp ). sal ) Emp(i 1 ) Emp(i 5 ) Emp(i 9 ) Dept(i 17 ) Dept(i 22 ) ENVSQRES bag{ i 17, i 22 } dname(i 23 ) loc(i 24 ) employs(i 25 ) employs(i 26 ) 1450 struct{ i 17, 2500 }Partial result of join: After performing avg on top of QRES

K.Subieta. SBA and SBQL, appendix, slide 34 Sept Dept join avg( ( employs. Emp ). sal ) Emp(i 1 ) Emp(i 5 ) Emp(i 9 ) Dept(i 17 ) Dept(i 22 ) ENVSQRES bag{ i 17, i 22 } dname(i 23 ) loc(i 24 ) employs(i 25 ) employs(i 26 ) 1450 struct{ i 17, 2500 }Partial results of join: join forms 2 nd partial result struct{ i 22, 1450 }

K.Subieta. SBA and SBQL, appendix, slide 35 Sept Dept join avg( ( employs. Emp ). sal ) Emp(i 1 ) Emp(i 5 ) Emp(i 9 ) Dept(i 17 ) Dept(i 22 ) ENVSQRES bag{ struct{ i 17, 2500}, struct{ i 22, 1450} } Closing the iteration by join, forming the final result

K.Subieta. SBA and SBQL, appendix, slide 36 Sept In closing … Please note that this evaluation scenario concerns the formal semantics executed by the abstract machine. –Our goal is clear, universal and free of ambiguities semantic specification rather than performance. In real implementation there are many obvious optimizations. The evaluation process is also the subject of many sophisticated optimizations (rewriting, indices, caching,…). The entire process is executed in the main memory, hence the computations are not critical. –Critical computations concern the access to external storage and network, and avoiding unnecessary (redundant) computations. –This is the subject of major SBA optimization methods.