Session – 10 QUERY OPTIMIZATION Matakuliah: M0184 / Pengolahan Data Distribusi Tahun: 2005 Versi:

Slides:



Advertisements
Similar presentations
Chapter 13: Query Processing
Advertisements

Query Optimization Reserves Sailors sid=sid bid=100 rating > 5 sname (Simple Nested Loops) Imperative query execution plan: SELECT S.sname FROM Reserves.
Choosing an Order for Joins
Equality Join R X R.A=S.B S : : Relation R M PagesN Pages Relation S Pr records per page Ps records per page.
CS 245Notes 71 CS 245: Database System Principles Notes 7: Query Optimization Hector Garcia-Molina.
Query Optimization CS634 Lecture 12, Mar 12, 2014 Slides based on “Database Management Systems” 3 rd ed, Ramakrishnan and Gehrke.
Distributed DBMSPage © 1998 M. Tamer Özsu & Patrick Valduriez Outline Introduction Background Distributed DBMS Architecture Distributed Database.
Distributed DBMSPage © 1998 M. Tamer Özsu & Patrick Valduriez Outline Introduction Background Distributed DBMS Architecture Distributed Database.
Distributed DBMS© M. T. Özsu & P. Valduriez Ch.6/1 Outline Introduction Background Distributed Database Design Database Integration Semantic Data Control.
Manajemen Basis Data Pertemuan Matakuliah: M0264/Manajemen Basis Data Tahun: 2008.
CS CS4432: Database Systems II Operator Algorithms Chapter 15.
Database Management Systems, R. Ramakrishnan and J. Gehrke1 Relational Query Optimization Chapters 14.
Advanced Database Systems September 2013 Dr. Fatemeh Ahmadi-Abkenari 1.
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.
Query Evaluation. SQL to ERA SQL queries are translated into extended relational algebra. Query evaluation plans are represented as trees of relational.
1 Relational Query Optimization Module 5, Lecture 2.
1 Minggu 12, Pertemuan 23 Introduction to Distributed DBMS (Chapter , 22.6, 3rd ed.) Matakuliah: T0206-Sistem Basisdata Tahun: 2005 Versi: 1.0/0.0.
CS 245Notes 71 CS 245: Database System Principles Notes 7: Query Optimization Hector Garcia-Molina.
Query Rewrite: Predicate Pushdown (through grouping) Select bid, Max(age) From Reserves R, Sailors S Where R.sid=S.sid GroupBy bid Having Max(age) > 40.
Distributed Database Systems
1 Distributed Databases CS347 Lecture 14 May 30, 2001.
CS 347Notes 041 CS 347: Distributed Databases and Transaction Processing Notes04: Query Optimization Hector Garcia-Molina.
Session – 9 QUERY OPTIMATIZATION Matakuliah: M0184 / Pengolahan Data Distribusi Tahun: 2005 Versi:
Chapter 7 Advanced SQL Database Systems: Design, Implementation, and Management, Sixth Edition, Rob and Coronel.
Session – 7 DATA HANDLING – DISTRIBUTION AND TRANSFORMATION Matakuliah: M0184 / Pengolahan Data Distribusi Tahun: 2005 Versi:
Query Processing & Optimization
L Distributed Query Optimization Algorithms -- 1 Distributed Query Optimization Algorithms v System R and R* v Hill Climbing and SDD-1.
Session - 24 FUTURE DEVELOPMENT IN DISTRIBUTED DATABASE DISTRIBUTED EXPERT SYSTEM Matakuliah: M0184 / Pengolahan Data Distribusi Tahun: 2005 Versi:
Access Path Selection in a Relation Database Management System (summarized in section 2)
Query Processing Presented by Aung S. Win.
Database Management Systems, R. Ramakrishnan and J. Gehrke1 Query Evaluation Chapter 12: Overview.
Access Path Selection in a Relational Database Management System Selinger et al.
Database Management 9. course. Execution of queries.
1 6. Distributed Query Optimization Chapter 9 Optimization of Distributed Queries.
Query Optimization. Query Optimization Query Optimization The execution cost is expressed as weighted combination of I/O, CPU and communication cost.
©Silberschatz, Korth and Sudarshan13.1Database System Concepts Chapter 13: Query Processing Overview Measures of Query Cost Selection Operation Sorting.
Academic Year 2014 Spring. MODULE CC3005NI: Advanced Database Systems “QUERY OPTIMIZATION” Academic Year 2014 Spring.
KORHAN KOCABIYIK1 R* Optimizer Validation and Performance Evaluation for Distributed Queries Lothar F. Mackert, Guy M. Lohman IBM Almaden Research Center.
Query Processing. Steps in Query Processing Validate and translate the query –Good syntax. –All referenced relations exist. –Translate the SQL to relational.
CS 338Query Evaluation7-1 Query Evaluation Lecture Topics Query interpretation Basic operations Costs of basic operations Examples Textbook Chapter 12.
12.1Database System Concepts - 6 th Edition Chapter 12: Query Processing Overview Measures of Query Cost Selection Operation Join Operation Sorting 、 Other.
PMIT-6102 Advanced Database Systems By- Jesmin Akhter Assistant Professor, IIT, Jahangirnagar University.
Distributed DBMS© M. T. Özsu & P. Valduriez Ch.8/1 Outline Introduction Background Distributed Database Design Database Integration Semantic Data Control.
Chapter 12 Query Processing (1) Yonsei University 2 nd Semester, 2013 Sanghyun Park.
Database Management Systems, R. Ramakrishnan and J. Gehrke1 Introduction to Query Optimization Chapter 13.
Querying The Internet With PIER Nitin Khandelwal.
R*: An overview of the Architecture By R. Williams et al. Presented by D. Kontos Instructor : Dr. Megalooikonomou.
Session – 11 CONCURRENCY CONTROL USER ACCESS CONTROL Matakuliah: M0184 / Pengolahan Data Distribusi Tahun: 2005 Versi:
CS 440 Database Management Systems Lecture 5: Query Processing 1.
Query Processing and Query Optimization Database System Implementation CSE 507 Some slides adapted from Silberschatz, Korth and Sudarshan Database System.
Chapter 13 Query Optimization Yonsei University 1 st Semester, 2015 Sanghyun Park.
1 Minggu 6, Pertemuan 12 Query Processing Matakuliah: T0206-Sistem Basisdata Tahun: 2005 Versi: 1.0/0.0.
CS742 – Distributed & Parallel DBMSPage 3. 1M. Tamer Özsu Outline Introduction & architectural issues Data distribution  Distributed query processing.
CS 540 Database Management Systems
Database Management System
Session – 4 DISTRIBUTED DATABASE AND COMPUTER NETWORK
Database Applications (15-415) DBMS Internals- Part VII Lecture 16, October 25, 2016 Mohammad Hammoud.
Distributed Databases
CS222P: Principles of Data Management Lecture #15 Query Optimization (System-R) Instructor: Chen Li.
Chapter 12: Query Processing
Access Path Selection in a Relational Database Management System
R*: An Overview of the Architecture
Database Applications (15-415) DBMS Internals- Part VII Lecture 19, March 27, 2018 Mohammad Hammoud.
Database Query Execution
Outline Introduction Background Distributed DBMS Architecture
Chapters 15 and 16b: Query Optimization
Chapter 12 Query Processing (1)
Distributed Database Management Systems
CS222: Principles of Data Management Lecture #15 Query Optimization (System-R) Instructor: Chen Li.
Distributed Database Management Systems
Presentation transcript:

Session – 10 QUERY OPTIMIZATION Matakuliah: M0184 / Pengolahan Data Distribusi Tahun: 2005 Versi:

OBJECTIVE QUERY Optimization process Distribute query optimization algorithms

DISTRIBUTED QUERY OPTIMIZATION ALGORITHMS Algorith ms Optm. Timing Obj. Function Optm. Factors Networ k Semi Joins DIST. INGRES Dynami c Resp.Time or Total Cost Msg Size, Proj Cost General / broadca st No R *StaticTotal Cost#Msg, Msg Size, IO, CPU General / Local No SDD – 1StaticMsg SizeGeneral Yes Source : Principles Of Distributed Database Systems

DISTRIBUTED INGRES Algorithm Consist of dynamically optimizing the processing strategy of a given query. The objective function of the algorithm is to minimize response time and cost General and broadcast network are consider, therefore the data unit can be transmitted from one site to all the other sites in a single transfer This algorithm is executed by the site, called Master site where the query is initiated

R * Algorithm Uses compilation approach where an exhaustive search of all alternative strategies is performed in order to choose the one with the least cost. Query compilation is a distributed task in R*, coordinated by master site, where the query is initiated. To join two relation, there are three candidate sites : site for 1 st relation, site for 2 nd relation and 3 rd site. Two method for intersite data transfers : Ship Whole and Fetch as Needed

SDD-1 Algorithm Refinements of an initial feasible solution are recursively computed until no more cost improvement can be made. It is devised for wide area point-to-point network The cost of transferring the result to final site is ignored

Method of Performing JOIN On the basic relational operation (SELECT, JOIN, PROJECT) the most expensive in term in both time and money is JOIN. It causes more page swaps. The frequency of page swaps is often used as the cost measure when modeling these system

SEMI-JOIN Method Symbol : Semi Join of Relation R1 and Relation R2 The second example has potential advantage over the first if R1 and R2 are at different sites A and B, and the execution of full JOIN between R1 and R2 is to be done at the 3 rd Site C – Refer to SDD-1 algorithm system =R1R2R1 ( π R2) π =R1R2 (R1R2) 1 ………… (1.1) ………… (1.2)

SEMI-JOIN Method Cont’d Procedure SEMI-JOIN Project the JOIN attributes from R2 at B ( = πR2), after applying any required SELECTIONs Transmit πR2 to A Compute Semi Join of R1 at A Move the result to C

Non SEMI-JOIN Methods In R*, execution is generated at compilation time and therefore it uses a static optimization algorithms. Query can be compiled during times when the system is slack and the optimal access plan for their execution are determined then. The nested loop and merge scan method are used for join in R* The nested loop method scans one relation called outer relation for each tuple of the other relation, called the inner relation with a matching JOIN Value

Non SEMI-JOIN Methods Preceding query execution, four stages of “query preparation” are completed in R*, they are : 1.Analyze the SQL query and perform object name resolution 2.Look up the catalog to check authorization and view integration 3.Plan the minimum cost access strategy for the global query 4.Generate the access modules and store them at a master site

Specific Issues for Modern Query Optimization Is a static or a dynamic algorithm used Are independence and uniformity assumptions made What JOIN method is used Is account taken of the effects of other system modules on optimization Is simultaneous query traffic taken into account Is the search for an optimum exhaustive Is any semantic query transformation carried out Is the influence of heterogeneity considered