1 Minggu 6, Pertemuan 12 Query Processing Matakuliah: T0206-Sistem Basisdata Tahun: 2005 Versi: 1.0/0.0.

Slides:



Advertisements
Similar presentations
Query Processing Chapter 21 in Textbook.
Advertisements

1 Pertemuan > > Matakuliah: >/ > Tahun: > Versi: >
Manajemen Basis Data Pertemuan Matakuliah: M0264/Manajemen Basis Data Tahun: 2008.
1 Pertemuan 22 Radix Sort Matakuliah: T0016/Algoritma dan Pemrograman Tahun: 2005 Versi: versi 2.
Database Environment Pertemuan 02 Matakuliah: M0564 /Pengantar Sistem Basis Data Tahun : 2008.
Dynamic SQL Pertemuan 11 Matakuliah: T0413/Current Popular IT II Tahun: 2007.
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.
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.
1 Pertemuan 02 Database environment Matakuliah: >/ > Tahun: > Versi: >
CS263 Lecture 19 Query Optimisation.  Motivation for Query Optimisation  Phases of Query Processing  Query Trees  RA Transformation Rules  Heuristic.
Session – 10 QUERY OPTIMIZATION Matakuliah: M0184 / Pengolahan Data Distribusi Tahun: 2005 Versi:
1 Minggu 4, Pertemuan 8 SQL: Data Manipulation (Cont.) Matakuliah: T0206-Sistem Basisdata Tahun: 2005 Versi: 1.0/0.0.
1 Pertemuan 14 Object Query Language (Lanjutan bagian 1) Matakuliah: M0174/OBJECT ORIENTED DATABASE Tahun: 2005 Versi: 1/0.
Embedded SQL Pertemuan 9 Matakuliah: T0413/Current Popular IT II Tahun: 2007.
1 Pertemuan 01 Pengantar tentang database Matakuliah: >/ > Tahun: > Versi: >
1 Pertemuan 16 Isu-Isu pada Sistem Paging dan Segmentasi Matakuliah: T0316/sistem Operasi Tahun: 2005 Versi/Revisi: 5.
1 Pertemuan 5 The structure part of object data model Matakuliah: M0174/OBJECT ORIENTED DATABASE Tahun: 2005 Versi: 1/0.
1 Pertemuan 14 Perencanaan, Desain dan Administrasi Databases Matakuliah: >/ > Tahun: > Versi: >
1 Pertemuan 17 Seleksi DBMS Matakuliah: >/ > Tahun: > Versi: >
1 Pertemuan 21 Parallelism and Superscalar Matakuliah: H0344/Organisasi dan Arsitektur Komputer Tahun: 2005 Versi: 1/1.
1 Pertemuan 17 Building Object Database Application Matakuliah: M0174/OBJECT ORIENTED DATABASE Tahun: 2005 Versi: 1/0.
1 Minggu 1, Pertemuan 1 Introduction to Database Matakuliah: T0206-Sistem Basisdata Tahun: 2005 Versi: 1.0/0.0.
1 Minggu 3, Pertemuan 5 Relational Algebra (Cont.) Matakuliah: T0206-Sistem Basisdata Tahun: 2005 Versi: 1.0/0.0.
1 Minggu 11, Pertemuan 22 Conceptual Database Design (Chapter 14.1, 3rd ed.) Matakuliah: T0206-Sistem Basisdata Tahun: 2005 Versi: 1.0/0.0.
ICS (072)Query Processing and Optimization 1 Chapter 15 Algorithms for Query Processing and Optimization ICS 424 Advanced Database Systems Dr.
1 Pertemuan 7 The Object Definition Language Matakuliah: M0174/OBJECT ORIENTED DATABASE Tahun: 2005 Versi: 1/0.
Database Systems: Design, Implementation, and Management Eighth Edition Chapter 11 Database Performance Tuning and Query Optimization.
1 Minggu 2, Pertemuan 3 The Relational Model Matakuliah: T0206-Sistem Basisdata Tahun: 2005 Versi: 1.0/0.0.
1 Pertemuan 9 The Manipulative part of the object data model Matakuliah: M0174/OBJECT ORIENTED DATABASE Tahun: 2005 Versi: 1/0.
1 Minggu 3, Pertemuan 6 Relational Calculus Matakuliah: T0206-Sistem Basisdata Tahun: 2005 Versi: 1.0/0.0.
1 Pertemuan 04 MODEL RELASIONAL Matakuliah: >/ > Tahun: > Versi: >
1 Minggu 10, Pertemuan 19 Normalization (cont.) Matakuliah: T0206-Sistem Basisdata Tahun: 2005 Versi: 1.0/0.0.
1 Pertemuan 8 The Object Definition Language (Lanjutan) Matakuliah: M0174/OBJECT ORIENTED DATABASE Tahun: 2005 Versi: 1/0.
Query Optimization CS 157B Ch. 14 Mien Siao. Outline Introduction Steps in Cost-based query optimization- Query Flow Projection Example Query Interaction.
Query Processing Presented by Aung S. Win.
Pertemuan 5 Pengembangan Teknologi Informasi Matakuliah: H0402/PENGELOLAAN SISTEM KOMPUTER Tahun: 2005 Versi: 1/0.
Database Systems: Design, Implementation, and Management Tenth Edition Chapter 11 Database Performance Tuning and Query Optimization.
Database Systems Design, Implementation, and Management Coronel | Morris 11e ©2015 Cengage Learning. All Rights Reserved. May not be scanned, copied or.
Database Systems: Design, Implementation, and Management Eighth Edition Chapter 10 Database Performance Tuning and Query Optimization.
CS 8630 Database Administration, Dr. Guimaraes , Physical Design and Performance Class Will Start Momentarily… CS8630 Database Administration.
1 Minggu 9, Pertemuan 17 Database Planning, Design, and Administration Matakuliah: T0206-Sistem Basisdata Tahun: 2005 Versi: 1.0/0.0.
1 Pertemuan 23 Normalisasi Matakuliah: >/ > Tahun: > Versi: >
Academic Year 2014 Spring. MODULE CC3005NI: Advanced Database Systems “QUERY OPTIMIZATION” Academic Year 2014 Spring.
1 Chapter 20 Query Processing Transparencies. 2 Chapter 20 - Objectives u Objectives of query processing and optimization. u Static versus dynamic query.
DATABASE MGMT SYSTEM (BCS 1423) Chapter 5: Methodology – Conceptual Database Design.
1 Pertemuan 17 Basisdata (Databases) Matakuliah: T0604-Pengantar Teknologi Informasi Tahun: 2008 Versi: 2.0/0.0 Williams, B.K, Stacy C. Sawyer (2007).
1 Pertemuan 25 Object Relational Database Management System Matakuliah: M0174/OBJECT ORIENTED DATABASE Tahun: 2005 Versi: 1/0.
PMIT-6102 Advanced Database Systems By- Jesmin Akhter Assistant Professor, IIT, Jahangirnagar University.
The Relational Model Pertemuan 03 Matakuliah: M0564 /Pengantar Sistem Basis Data Tahun : 2008.
Query Processing Bayu Adhi Tama, MTI. 1 ownerNoclient © Pearson Education Limited 1995, 2005.
1 Pertemuan > > Matakuliah: >/ > Tahun: > Versi: >
DATABASE ADMINISTRATION Pertemuan ke-7. Application Performance source : Database Administration the complete guide to practices and procedures chapter.
Chapter 18 Query Processing. 2 Chapter - Objectives u Objectives of query processing and optimization. u Static versus dynamic query optimization. u How.
1 Pertemuan > > Matakuliah: >/ > Tahun: > Versi: >
Query Processing – Query Trees. Evaluation of SQL Conceptual order of evaluation – Cartesian product of all tables in from clause – Rows not satisfying.
Commercial RDBMSs: Office Access and Oracle Pertemuan 13 Matakuliah: M0564 /Pengantar Sistem Basis Data Tahun : 2008.
Chapter 18 Query Processing and Optimization. Chapter Outline u Introduction. u Using Heuristics in Query Optimization –Query Trees and Query Graphs –Transformation.
Chapter 13: Query Processing
Database Systems, 8 th Edition SQL Performance Tuning Evaluated from client perspective –Most current relational DBMSs perform automatic query optimization.
Pertemuan 20 Building Object Database Application (Lanjutan bagian 3)
Pertemuan <<13>> Data Warehousing dan Decision Support
Pertemuan 22 The Business Views of the Technology Architecture
Tahun : <<2005>> Versi : <<1/1>>
Query Optimization Phases of query processing
Database Performance Tuning and Query Optimization
Chapter 23 Query Processing Pearson Education © 2014.
Minggu 9, Pertemuan 18 Normalization
Chapter 11 Database Performance Tuning and Query Optimization
Distributed Database Management Systems
Presentation transcript:

1 Minggu 6, Pertemuan 12 Query Processing Matakuliah: T0206-Sistem Basisdata Tahun: 2005 Versi: 1.0/0.0

2 Learning Outcomes Pada akhir pertemuan ini, diharapkan mahasiswa dapat dapat menjelaskan query processing dan query optimization (C2)

3 Outline Materi Objectives of query processing and optimization. How a query is decomposed and semantically analyzed. How to create a R.A.T. to represent a query. Rules of equivalence for RA operations.

4 Introduction In network and hierarchical DBMSs, low- level procedural query language is generally embedded in high-level programming language. Programmer’s responsibility to select most appropriate execution strategy. With declarative languages such as SQL, user specifies what data is required rather than how it is to be retrieved. Relieves user of knowing what constitutes good execution strategy.

5 Introduction (cont.) Also gives DBMS more control over system performance. Two main techniques for query optimization: –heuristic rules that order operations in a query; –comparing different strategies based on relative costs, and selecting one that minimizes resource usage. Disk access tends to be dominant cost in query processing for centralized DBMS.

6 Query Processing Activities involved in retrieving data from the database. Aims of QP: –transform query written in high-level language (e.g. SQL), into correct and efficient execution strategy expressed in low-level language (implementing RA); –execute strategy to retrieve required data.

7 Query Optimization Activity of choosing an efficient execution strategy for processing query. As there are many equivalent transformations of same high-level query, aim of QO is to choose one that minimizes resource usage. Generally, reduce total execution time of query. May also reduce response time of query. Problem computationally intractable with large number of relations, so strategy adopted is reduced to finding near optimum solution.

8 Example Different Strategies Find all Managers who work at a London branch. SELECT * FROM Staff s, Branch b WHERE s.branchNo = b.branchNo AND (s.position = ‘Manager’ AND b.city = ‘London’);

9 Example Different Strategies Three equivalent RA queries are: (1)  (position='Manager')  (city='London')  (Staff.branchNo=Branch.branchNo) (Staff X Branch) (2)  (position='Manager')  (city='London') ( Staff Staff.branchNo=Branch.branchNo Branch) (3) (  position='Manager' (Staff)) Staff.branchNo=Branch.branchNo (  city='London' (Branch))

10 Example Different Strategies Assume: –1000 tuples in Staff; 50 tuples in Branch; –50 Managers; 5 London branches; –no indexes or sort keys; –results of any intermediate operations stored on disk; –cost of the final write is ignored; –tuples are accessed one at a time.

11 Example 20.1-Cost Comparison Cost (in disk accesses) are: (1) ( ) + 2*(1000 * 50) = (2) 2* ( ) = (3) * (50 + 5) = Cartesian product and join operations much more expensive than selection, and third option significantly reduces size of relations being joined together.

12 Phases of Query Processing QP has four main phases: –decomposition (consisting of parsing and validation); –optimization; –code generation; –execution.

13 Phases of Query Processing

14 Dynamic versus Static Optimization Two times when first three phases of QP can be carried out: –dynamically every time query is run; –statically when query is first submitted. Advantages of dynamic QO arise from fact that information is up to date. Disadvantages are that performance of query is affected, time may limit finding optimum strategy.

15 Dynamic versus Static Optimization Advantages of static QO are removal of runtime overhead, and more time to find optimum strategy. Disadvantages arise from fact that chosen execution strategy may no longer be optimal when query is run. Could use a hybrid approach to overcome this.

16 Example R.A.T.