15.1 – Introduction to physical-Query-plan operators

Slides:



Advertisements
Similar presentations
CS 540 Database Management Systems
Advertisements

Completing the Physical-Query-Plan. Query compiler so far Parsed the query. Converted it to an initial logical query plan. Improved that logical query.
Query Execution Since our SQL queries are very high level the query processor does a lot of processing to supply all the details. An SQL query is translated.
Query Execution Optimizing Performance. Resolving an SQL query Since our SQL queries are very high level, the query processor must do a lot of additional.
COMP 451/651 Optimizing Performance
Query Execution Professor: Dr T.Y. Lin Prepared by, Mudra Patel Class id: 113.
Query Execution Professor: Dr T.Y. Lin Prepared by, Mudra Patel Class id: 113.
CS 257, Spring’08 Presented By: Presented By: Gayatri Gopalakrishnan Gayatri Gopalakrishnan ID : 201.
1 Lecture 22: Query Execution Wednesday, March 2, 2005.
Query Execution Professor: Dr T.Y. Lin Prepared by, Mudra Patel Class id: 113.
Query Compiler: 16.7 Completing the Physical Query-Plan CS257 Spring 2009 Professor Tsau Lin Student: Suntorn Sae-Eung ID: 212.
Query Execution Chapter 15 Section 15.1 Presented by Khadke, Suvarna CS 257 (Section II) Id
1 Relational Operators. 2 Outline Logical/physical operators Cost parameters and sorting One-pass algorithms Nested-loop joins Two-pass algorithms.
CSCE Database Systems Chapter 15: Query Execution 1.
CPS216: Advanced Database Systems Notes 07:Query Execution Shivnath Babu.
Query Processing. Steps in Query Processing Validate and translate the query –Good syntax. –All referenced relations exist. –Translate the SQL to relational.
Query Execution Section 15.1 Shweta Athalye CS257: Database Systems ID: 118 Section 1.
CS4432: Database Systems II Query Processing- Part 3 1.
CS 257 Chapter – 15.9 Summary of Query Execution Database Systems: The Complete Book Krishna Vellanki 124.
16.7 Completing the Physical- Query-Plan By Aniket Mulye CS257 Prof: Dr. T. Y. Lin.
CS4432: Database Systems II Query Processing- Part 2.
Lecture 17: Query Execution Tuesday, February 28, 2001.
CS 440 Database Management Systems Lecture 5: Query Processing 1.
File Processing : Query Processing 2008, Spring Pusan National University Ki-Joune Li.
CS 540 Database Management Systems
1 Lecture 23: Query Execution Monday, November 26, 2001.
Query Processing COMP3017 Advanced Databases Nicholas Gibbins
CS4432: Database Systems II Query Processing- Part 1 1.
Query Execution Chapter 15 Section 15.1 Presented by Khadke, Suvarna CS 257 (Section II) Id
CS 540 Database Management Systems
CS 440 Database Management Systems
Database Management System
Prepared by : Ankit Patel (226)
Chapter 12: Query Processing
Database Performance Tuning and Query Optimization
CPSC-608 Database Systems
Overview of Query Optimization
COST ESTIMATION FOR THE RELATIONAL ALGEBRA OPERATIONS MIT 813 GROUP 15 PRESENTATION.
Chapter 15 QUERY EXECUTION.
Query Execution Presented by Khadke, Suvarna CS 257
Database Management Systems (CS 564)
Examples of Physical Query Plan Alternatives
Database Systems Ch Michael Symonds
File Processing : Query Processing
Sidharth Mishra Dr. T.Y. Lin CS 257 Section 1 MH 222 SJSU - Fall 2016
Query Processing B.Ramamurthy Chapter 12 11/27/2018 B.Ramamurthy.
Selected Topics: External Sorting, Join Algorithms, …
15.6 Index Based Algorithms
(Two-Pass Algorithms)
Query Optimization CS 157B Ch. 14 Mien Siao.
Chapters 15 and 16b: Query Optimization
Lecture 2- Query Processing (continued)
One-Pass Algorithms for Database Operations (15.2)
Query Execution Presented by Jiten Oswal CS 257 Chapter 15
Chapter 12 Query Processing (1)
Lecture 13: Query Execution
Chapter 11 Database Performance Tuning and Query Optimization
CS222P: Principles of Data Management Notes #13 Set operations, Aggregation, Query Plans Instructor: Chen Li.
Lecture 23: Query Execution
Evaluation of Relational Operations: Other Techniques
CPSC-608 Database Systems
Lecture 22: Query Execution
CPSC-608 Database Systems
External Sorting Sorting is used in implementing many relational operations Problem: Relations are typically large, do not fit in main memory So cannot.
Lecture 11: B+ Trees and Query Execution
Query Processing.
Completing the Physical-Query-Plan and Chapter 16 Summary ( )
Evaluation of Relational Operations: Other Techniques
Lecture 24: Query Execution
Lecture 20: Query Execution
Presentation transcript:

15.1 – Introduction to physical-Query-plan operators Presented BY: Jason Chee

Query processor Query Processor: Group of components of a DBMS that turns user queries and data-modification commands into a sequence of database operations and executes those operations

Query Compilation (Ch 16) Three parts: Parsing: Construct parse tree Query rewrite: parse tree -> query algebra -> logical query plan (faster) Physical plan generation: Converts logical query plan to physical query plan by selecting appropriate algorithms and order of execution.

Physical-query-plan operators Physical Operators often are implementations of relational algebra operators Examples of non-relational operators: Scan: bring into memory each tuple of some relation Iterators: method by which operators comprising a physical query plan can pass requests for tuples and answers among themselves

Scanning tables Reading the contents of a relation R Table-scan: Relation R is stored in secondary memory Blocks containing tuples of R are known, and it is possible to get the blocks one by one Index-scan If there is an index on any attribute of R, we may be able to use this index to get all the tuples of R.

Sorting while scanning tables Sort relation as we read tuples for multiple reasons. Examples: ORDER BY clause Operations requiring relations to be sorted Physical-query-plan operator sort-scan can be implemented many ways. One example is a B-tree index on sorted attribute a.

Computational model for physical operators Query is made of several operations of relational algebra, and query plan composed of several physical operators. Estimate cost by number of disk I/O’s. To compare algorithms, we assume that the arguments of any operator are found on disk, but the result of the operator is left in main memory. Because size of result doesn’t depend on algorithm Final write is cost of query, not algorithm

Parameters for measuring costs M: Number of main memory buffers (size of block) available to operator. Could be smaller than total main memory if several operators share memory. B or B(R): Size of relation R – number of blocks to hold all tuples of R T or T(R): Number of tuples in R. T/B = tuples per block V(R,[a1,a2,…an]): number of distinct values in a column, or columns for multiple attributes

i/o cost for scan operators Table-scan: If R is clustered, need B disk I/Os If R is not clustered, could be up to T disk I/Os – as many blocks as there are tuples Index-scan: If column data is contained in the index SELECT category_id FROM tbl WHERE category_id BETWEEN 10 AND 100; Don’t need to access the table Often smaller than B

Iterators for implementation of physical operators Design pattern to implement physical operators Three Methods 1) Open(): Initializes data structures 2) GetNext(): Returns the next tuple in the result and adjusts data structures as necessary. If no more tuples, return not found 3) Close(): Ends the iteration for all tuples. Calls close on any arguments of the operator.

Table-scan Iterator methods

Thank you Please feel free to ask any questions.