Explaining the Explain Plan:

Size: px
Start display at page:

Download "Explaining the Explain Plan:"

Transcription

1 Explaining the Explain Plan: Interpre'ng Execu'on Plans for SQL Statements Maria Colgan Master Product Manager June

2 Safe Harbor Statement The following is intended to outline our general product direcqon. It is intended for informaqon purposes only, and may not be incorporated into any contract. It is not a commitment to deliver any material, code, or funcqonality, and should not be relied upon in making purchasing decisions. The development, release, and Qming of any features or funcqonality described for Oracle s products remains at the sole discreqon of Oracle. 2

3 Agenda What is an execuqon plan How to generate a plan What is a good plan for the OpQmizer Understanding execuqon plans ExecuQon plan examples

4 What Happens when a SQL statement is issued? User SQL Execution 4 1 Oracle Database 2 Syntax Check SemanQc Check Shared Pool check Parsing Shared Pool Library Cache Shared SQL Area C1 C2 Cn 3 Query Transformation Plan Generator Code Generator Optimizer Cost Estimator

5 What is an execuqon plan? ExecuQon plans show the detailed steps necessary to execute a SQL statement These steps are expressed as a set of database operators that consumes and produces rows The order of the operators and their implementaqon is decided by the opqmizer using a combinaqon of query transformaqons and physical opqmizaqon techniques The display is commonly shown in a tabular format, but a plan is in fact treeshaped

6 What is an execuqon plan? Query: SELECT prod_category, avg(amount_sold) FROM sales s, products p WHERE p.prod_id = s.prod_id GROUP BY prod_category; Tabular representaqon of plan Tree-shaped representaqon of plan GROUP BY HASH JOIN TABLE ACCESS PRODUCTS TABLE ACCESS SALES

7 Agenda What is an execuqon plan How to generate a plan What is a good plan for the OpQmizer Understanding execuqon plans ExecuQon plan examples

8 Many Ways to View an ExecuQon Plan Autotrace SQL Monitor SQL Developer TKPROF..But there are actually only 2 ways to generate one 8

9 How to generate an execuqon plan Two methods for looking at the execuqon plan 1. EXPLAIN PLAN command Displays an execuqon plan for a SQL statement without actually execuqng the statement 2. V$SQL_PLAN A dicqonary view introduced in Oracle 9i that shows the execuqon plan for a SQL statement that has been compiled into a cursor in the cursor cache Under certain condiqons the plan shown with EXPLAIN PLAN can be different from the plan shown using V$SQL_PLAN

10 How to generate an execuqon plan EXPLAIN PLAN command & dbms_xplan.display funcqon SQL> EXPLAIN PLAN FOR SELECT p.prod_name, avg(s.amount_sold) FROM WHERE sales s, products p p.prod_id = s.prod_id GROUP BY p.prod_name; SQL> SELECT * FROM table(dbms_xplan.display('plan_table',null,'basic'));

11 How to generate an execuqon plan Generate & display execuqon plan for last SQL statements executed in session SQL> SELECT p.prod_name, avg(s.amount_sold) FROM sales s, products p WHERE p.prod_id = s.prod_id GROUP BY p.prod_name; SQL> SELECT * FROM table(dbms_xplan.display_cursor(null,null,'basic'));

12 DBMS_XPLAN parameters DBMS_XPLAN.DISPLAY takes 3 parameters plan table name (default 'PLAN_TABLE'), statement_id (default null), format (default 'TYPICAL') DBMS_XPLAN.DISPLAY_CURSOR takes 3 parameters SQL_ID (default last statement executed in this session), Child number (default 0), format (default 'TYPICAL') Format* is highly customizable - Basic,Typical, All AddiQonal low level parameters show more detail *More informaqon on formatng on OpQmizer blog

13 Agenda What is an execuqon plan How to generate a plan What is a good plan for the OpQmizer Understanding execuqon plans ExecuQon plan examples

14 What s a good plan for the OpQmizer? The OpQmizer has two different goals Serial execuqon: It s all about cost The cheaper, the beuer Parallel execuqon: it s all about performance The faster, the beuer Two fundamental quesqons: What is cost What is performance

15 What is cost? A magically number the opqmizer makes up? Resources required to execute a SQL statement? EsQmate of how long it will take to execute a statement? Actual DefiniQon Cost represents units of work or resources used OpQmizer uses CPU & IO as units of work EsQmate of amount of CPU & disk I/Os, used to perform an operaqon Cost is an internal Oracle measurement & should be used for comparison purposes only

16 What is performance? Getng as many queries completed as possible? Getng fastest possible elapsed Qme using the fewest resources? Getng the best concurrency rate? Actual DefiniQon Performance is fastest possible response Qme for a query Goal is to complete the query as quickly as possible OpQmizer does not focus on resources needed to execute the plan

17 Agenda What is an execuqon plan How to generate a plan What is a good plan for the opqmizer Understanding execuqon plans Cardinality Access paths Join methods Join order ExecuQon plan examples

18 Cardinality What is it? EsQmate of number rows that will be returned by each operaqon How does the OpQmizer Determine it? Cardinality for a single column equality predicate = total num of rows num of dis'nct values For example: A table has 100 rows, a column has 10 disqnct values => cardinality=10 rows More complicated predicates have more complicated cardinality calculaqon Why should you care? It influences everything! Access method, Join type, Join Order etc

19 IdenQfying cardinality in an execuqon plan Cardinality - esqmated # of rows returned Determine correct cardinality using a SELECT COUNT(*) from each table applying any WHERE Clause predicates belonging to that table

20 Checking cardinality esqmates SELECT /*+ gather_plan_sta's'cs */ p.prod_name, SUM(s.quanQty_sold) FROM sales s, products p WHERE s.prod_id =p.prod_id GROUP By p.prod_name ; SELECT * FROM table ( DBMS_XPLAN.DISPLAY_CURSOR(FORMAT=>'ALLSTATS LAST'));

21 Checking cardinality esqmates SELECT * FROM table ( DBMS_XPLAN.DISPLAY_CURSOR(FORMAT=>'ALLSTATS LAST')); Compare esqmated number of rows returned with actual rows returned

22 Checking cardinality esqmates for PE SELECT * FROM table ( DBMS_XPLAN.DISPLAY_CURSOR(FORMAT=>'ALLSTATS LAST')); Note: a lot of the data is zero in the A-rows column because we only show last executed cursor which is the QC. Need to use ALLSTATS ALL to see info on all parallel server cursors

23 Checking cardinality esqmates for PE SELECT * FROM table ( DBMS_XPLAN.DISPLAY_CURSOR(FORMAT=>'ALLSTATS ALL'));

24 Check cardinality using SQL Monitor Easiest way to compare the esqmated number of rows returned with actual rows returned

25 SoluQons to incorrect cardinality esqmates Cause Stale or missing staqsqcs Data Skew MulQple single column predicates on a table FuncQon wrapped column MulQple columns used in a join Complicated expression containing columns from mulqple tables Solu'on DBMS_STATS Create a histogram Create a column group using DBMS_STATS.CREATE_EXTENDED_STATS Create staqsqcs on the funct wrapped column using DBMS_STATS.CREATE_EXTENDED_STATS Create a column group on join columns using DBMS_STATS.CREATE_EXTENDED_STAT Use dynamic sampling level 4 or higher

26 Agenda What is an execuqon plan How to generate a plan What is a good plan for the opqmizer Understanding execuqon plans Cardinality Access paths Join methods Join order ExecuQon plan examples

27 Access paths Getng the data Access Path Full table scan Table access by Rowid Index unique scan Index range scan Index skip scan Full index scan Fast full index scan Index joins Bitmap indexes Explana'on Reads all rows from table & filters out those that do not meet the where clause predicates. Used when no index, DOP set etc Rowid specifies the datafile & data block containing the row and the locaqon of the row in that block. Used if rowid supplied by index or in where clause Only one row will be returned. Used when stmt contains an equality where clause predicate on a UNIQUE or a PRIMARY KEY column, which guarantees that only a single row is accessed Accesses adjacent index entries returns ROWID values Used with equality on non-unique indexes or range predicate on unique index (<.>, between etc) Skips the leading edge of the index & uses the rest Advantageous if there are few disqnct values in the leading column and many disqnct values in the non-leading column Processes all leaf blocks of an index, but only enough branch blocks to find 1 st leaf block. Used when all necessary columns are in index & order by clause matches index struct or if sort merge join is done Scans all blocks in index used to replace a FTS when all necessary columns are in the index. Using mulq-block IO & can going parallel Hash join of several indexes that together contain all the table columns that are referenced in the query. Wont eliminate a sort operaqon uses a bitmap for key values and a mapping funcqon that converts each bit posiqon to a rowid. Can efficiently merge indexes that correspond to several condiqons in a WHERE clause

28 IdenQfying access paths in an execuqon plan Look in OperaQon secqon to see how an object is being accessed If the wrong access method is being used check cardinality, join order

29 Access path example 1 What plan would you expect for this query? Table countries contains 10K rows & has a primary key on country_id SELECT country_id, name FROM countries WHERE country_id in ('AU','FR','IE );

30 Access path example 2 What plan would you expect for this query? Table countries contains 10K rows & has a primary key on country_id SELECT country_id, name FROM countries WHERE country_id between 'AU' and 'IE';

31 Access path example 3 What plan would you expect for this query? Table countries contains 10K rows & has a primary key on country_id SELECT country_id, name FROM countries WHERE name = USA';

32 Common access path issues Issue Uses a table scan instead of index Picks wrong index Cause DOP on table but not index, value of MBRC Stale or missing staqsqcs Cost of full index access is cheaper than index look up followed by table access Picks index that matches most # of column

33 Agenda What is an execuqon plan How to generate a plan What is a good plan for the opqmizer Understanding execuqon plans Cardinality Access paths Join methods Join order ExecuQon plan examples

34 Join methods Join Methods Nested Loops joins Hash Joins Sort Merge joins Explanation For every row in the outer table, Oracle accesses all the rows in the inner table Useful when joining small subsets of data and there is an efficient way to access the second table (index look up) The smaller of two tables is scan and resulting rows are used to build a hash table on the join key in memory. The larger table is then scan, join column of the resulting rows are hashed and the values used to probing the hash table to find the matching rows. Useful for larger tables & if equality predicate Consists of two steps: 1. Sort join operation: Both the inputs are sorted on the join key. 2. Merge join operation: The sorted lists are merged together. Useful when the join condition between two tables is an inequality condition

35 Join types Join Type Cartesian Joins Outer Joins Explanation Joins every row from one data source with every row from the other data source, creating the Cartesian Product of the two sets. Only good if tables are very small. Only choice if there is no join condition specified in query Returns all rows that satisfy the join condition and also returns all of the rows from the table without the (+) for which no rows from the other table satisfy the join condition

36 IdenQfying join methods in an execuqon plan Look in the OperaQon secqon to check the right join type is used If wrong join type is used check stmt is wriuen correctly & cardinality esqmates

37 Join method example 1 What join method would you expect for this query? SELECT e.last_name, e.salary, d.department_name FROM hr.employees e, hr.departments d WHERE d.departments_name IN ('MarkeQng,'Sales') AND e.department_id=d.department_id; Employees has 107 rows Departments has 27 rows Foreign key relaqonship between Employees and Departments on dept_id

38 Join method example 1 What join method would you expect for this query? SELECT e.last_name, e.salary, d.department_name FROM hr.employees e, hr.departments d WHERE d.departments_name IN ('MarkeQng,'Sales') AND e.department_id=d.department_id;

39 Join method example 2 What join method would you expect for this query? SELECT o.customer_id, l.unit_price * l.quanqty FROM oe.orders o,oe.order_items l WHERE l.order_id = o.order_id; Orders has 105 rows Order Items has 665 rows

40 Join method example 2 What join method would you expect for this query? SELECT o.customer_id, l.unit_price * l.quanqty FROM oe.orders o,oe.order_items l WHERE l.order_id = o.order_id; Orders has 105 rows Order Items has 665 rows

41 Join type example 1 What join type should be use for this query? SELECT o.order_id,0.order_date,e.name FROM oe.orders o, hr.employees e; Orders has 105 rows Employees has 107 rows

42 Join type example 1 What join type should be use for this query? SELECT o.order_id,0.order_date,e.name FROM oe.orders o, hr.employees e;

43 Join type example 2 Cartesian product not always bad Chosen when the number of rows being joined is low Commonly used to join mulqple small dimensions to one large fact table PRODUCTS s.prod_id=p.prod_id s.cust_id=c.cust_id CUSTOMERS s.promo_id=c.promo_id PROMOTIONS

44 Join type example 2 Cartesian product not always bad By joining the three small dimension tables together first we minimize the number of rows being carried through the joins

45 Join type example 3 What join type should be use for this query? SELECT d.department_id,e.emp_id FROM hr.employees e FULL OUTER JOIN hr.departments d ON e.department_id = d.department_id ORDER BY d.department_id; Employees has 107 rows Departments has 27 rows Foreign key relaqonship between Employees and Departments on dept_id

46 Join type example 3 What join type should be use for this query? SELECT d.department_id,e.emp_id FROM hr.employees e FULL OUTER JOIN hr.departments d ON e.department_id = d.department_id ORDER BY d.department_id;

47 Join type example 4 What join type should be use for this query? SELECT s.quanqty_sold FROM sales s, customers c WHERE s.cust_id =c.cust_id; Sales table has 960 Rows Customer table has 55,500 rows Customer has a primary key created on cust_id Sales has a foreign key created on cust_id

48 Join type example 4 What join type should be use for this query? SELECT s.quanqty_sold FROM sales s, customers c WHERE s.cust_id =c.cust_id; No join is needed Table elimination transformation Optimizer realizes that the join to customers tables is redundant as no columns are selected Presence of primary foreign key relationship means we can remove table

49 What causes wrong join method to be selected Issue Nested loop selected instead of hash join Hash join selected instead of nested loop Cartesian Joins Cause Cardinality estimate on the left side is under estimated triggers Nested loop to be selected In case of a hash join the Optimizer doesn t taken into consideration the benefit of caching. Rows on the left come in a clustered fashion or (ordered) so the probe in Cardinality underestimation

50 Agenda What is an execuqon plan How to generate a plan What is a good plan for the opqmizer Understanding execuqon plans Cardinality Access paths Join methods Join order ExecuQon plan examples

51 Join order The order in which the tables are join in a mulq table statement Ideally start with the table that will eliminate the most rows Strongly affected by the access paths available Some basic rules Joins guaranteed to produce at most one row always go first Joins between two row sources that have only one row each When outer joins are used the table with the outer join operator must come a er the other table in the predicate If view merging is not possible all tables in the view will be joined before joining to the tables outside the view

52 IdenQfying join order in an execuqon plan Want to start with the table that reduce the result set the most If the join order is not correct, check the staqsqcs, cardinality & access methods

53 Finding the join order for complex SQL It can be hard to determine Join Order for Complex SQL statements but it is easily visible in the outline data of plan SELECT * FROM table(dbms_xplan.display_cursor(format=> TYPICAL +outline ); The leading hint tells you the join order

54 What causes the wrong join order Causes Incorrect single table cardinality estimates Incorrect join cardinality estimates

55 Agenda What is an execuqon plan How to generate a plan What is a good plan for the opqmizer Understanding execuqon plans ExecuQon plan examples

56 Example SQL Statement Find all the employees who make as much or more than their manager SELECT e1.last_name, e1.job_qtle, e1.total_comp FROM (SELECT e.manager_id, e.last_name, j.job_qtle, e.salary+(e.salary+e.commission_pct) total_comp FROM employees e, jobs j, departments d WHERE d.department_name = 'Sales' AND e.department_id = d.department_id AND e.job_id = j.job_id ) e1, (SELECT e.employee_id, e.salary+(e.salary+e.commission_pct) tc FROM employees e, departments d WHERE d.department_name = Sales' AND e.department_id = d.department_id ) e2 WHERE e1.manager_id = e2.employee_id AND e1.total_comp >= e2.tc;

57 Is it a good execuqon plan? 1. Is the esqmated number of rows being returned accurate? 3.Are the access method correct? 2. Are the cardinality esqmates accurate? Means no stats gathered strong indicator this won t be best possible plan

58 Example cont d execuqon plan Are the right join methods being used? 5. Is the join order correct? Is the table that eliminates the most rows accessed first?

59 What does the plan tree look like? NESTED LOOP NESTED LOOP INDEX UNIQUE SCAN TABLE ACCESS JOBS HASH JOIN INDEX UNIQUE SCAN TABLE ACCESS DEPARTMENT MERGE JOIN CARTESIAN TABLE ACCESS EMPLOYEES TABLE ACCESS DEPARTMENT TABLE ACCESS EMPLOYEES

60 SoluQon 1. Only 1 row is actually returned and the cost is 4 lower now 5. The join order has changed Join methods have changed to be all NL 3. Access methods have changed for some tables 2. CardinaliQes are correct and with each join number of rows reduced

61 What does the plan tree look like? NESTED LOOP NESTED LOOP INDEX UNIQUE SCAN TABLE ACCESS DEPARTMENT NESTED LOOP INDEX UNIQUE SCAN - TABLE ACCESS JOBS NESTED LOOP INDEX RANGE SCAN - TABLE ACCESS EMPLOYEES TABLE ACCESS DEPARTMENT INDEX RANGE SCAN TABLE ACCESS EMPLOYEES

62 AddiQonal Resources Join the Conversa'on hups://twiuer.com/sqlmaria hups://blogs.oracle.com/opqmizer/ hups://sqlmaria.com hups:// hups:// Related White Papers Explain the Explain Plan Understanding OpQmizer StaQsQcs Best PracQces for Gathering OpQmizer StaQsQcs What to expect from the OpQmizer in 12c What to expect from the OpQmizer in 11g Related Websites hup:// database-technologies/query-opqmizaqon/overview/ index.html 62

Oracle Database 11gR2 Optimizer Insights

Oracle Database 11gR2 Optimizer Insights Oracle Database 11gR2 Optimizer Insights Marcus Bender Distinguished Sales Consultant Presales Fellow Strategic Technical Support (STU) ORACLE Deutschland GmbH, Geschäftsstelle Hamburg Parallel Execution

More information

The Oracle Optimizer Explain the Explain Plan O R A C L E W H I T E P A P E R A P R I L

The Oracle Optimizer Explain the Explain Plan O R A C L E W H I T E P A P E R A P R I L The Oracle Optimizer Explain the Explain Plan O R A C L E W H I T E P A P E R A P R I L 2 0 1 7 Table of Contents Introduction 1 The Execution Plan 2 Displaying the Execution Plan 3 What is Cost? 7 Understanding

More information

<Insert Picture Here> Inside the Oracle Database 11g Optimizer Removing the black magic

<Insert Picture Here> Inside the Oracle Database 11g Optimizer Removing the black magic Inside the Oracle Database 11g Optimizer Removing the black magic Hermann Bär Data Warehousing Product Management, Server Technologies Goals of this session We will Provide a common

More information

1 Copyright 2011, Oracle and/or its affiliates. All rights reserved.

1 Copyright 2011, Oracle and/or its affiliates. All rights reserved. 1 Copyright 2011, Oracle and/or its affiliates. All rights 2 Copyright 2011, Oracle and/or its affiliates. All rights Optimizer Statistics CPU & IO DATA DICTIONARY OPTIMIZER STATISTICS Index Table Column

More information

20 Essential Oracle SQL and PL/SQL Tuning Tips. John Mullins

20 Essential Oracle SQL and PL/SQL Tuning Tips. John Mullins 20 Essential Oracle SQL and PL/SQL Tuning Tips John Mullins jmullins@themisinc.com www.themisinc.com www.themisinc.com/webinars Presenter John Mullins Themis Inc. (jmullins@themisinc.com) 30+ years of

More information

Answer: Reduce the amount of work Oracle needs to do to return the desired result.

Answer: Reduce the amount of work Oracle needs to do to return the desired result. SQL Tuning 101 excerpt: Explain Plan A Logical Approach By mruckdaschel@affiniongroup.com Michael Ruckdaschel Affinion Group International My Qualifications Software Developer for Affinion Group International

More information

Displaying Data from Multiple Tables. Copyright 2004, Oracle. All rights reserved.

Displaying Data from Multiple Tables. Copyright 2004, Oracle. All rights reserved. Displaying Data from Multiple Tables Copyright 2004, Oracle. All rights reserved. Objectives After completing this lesson, you should be able to do the following: Write SELECT statements to access data

More information

Database Foundations. 6-9 Joining Tables Using JOIN. Copyright 2014, Oracle and/or its affiliates. All rights reserved.

Database Foundations. 6-9 Joining Tables Using JOIN. Copyright 2014, Oracle and/or its affiliates. All rights reserved. Database Foundations 6-9 Roadmap Introduction to Oracle Application Express Structured Query Language (SQL) Data Definition Language (DDL) Data Manipulation Language (DML Transaction Control Language (TCL)

More information

CBO SQL TRANSFORMER Document describes a few examples of transformations made by CBO.

CBO SQL TRANSFORMER Document describes a few examples of transformations made by CBO. 2013 CBO SQL TRANSFORMER Document describes a few examples of transformations made by CBO. Environment description OS - Oracle Linux Server release 6.3 x64 Database Oracle Database 11.2.0.3 EE with sample

More information

Oracle DB-Tuning Essentials

Oracle DB-Tuning Essentials Infrastructure at your Service. Oracle DB-Tuning Essentials Agenda 1. The DB server and the tuning environment 2. Objective, Tuning versus Troubleshooting, Cost Based Optimizer 3. Object statistics 4.

More information

Copyright 2012, Oracle and/or its affiliates. All rights reserved.

Copyright 2012, Oracle and/or its affiliates. All rights reserved. 1 Oracle safe harbor statement The following is intended to outline our general product direction. It is intended for information purposes only, and may not be incorporated into any contract. It is not

More information

Oracle Database 11g: SQL Tuning Workshop. Student Guide

Oracle Database 11g: SQL Tuning Workshop. Student Guide Oracle Database 11g: SQL Tuning Workshop Student Guide D52163GC10 Edition 1.0 June 2008 Author Jean-François Verrier Technical Contributors and Reviewers Muriel Fry (Special thanks) Joel Goodman Harald

More information

Oracle SQL Tuning for Developers Workshop Student Guide - Volume I

Oracle SQL Tuning for Developers Workshop Student Guide - Volume I Oracle SQL Tuning for Developers Workshop Student Guide - Volume I D73549GC10 Edition 1.0 October 2012 D78799 Authors Sean Kim Dimpi Rani Sarmah Technical Contributors and Reviewers Nancy Greenberg Swarnapriya

More information

Oracle 1Z Oracle Database 11g Performance Tuning.

Oracle 1Z Oracle Database 11g Performance Tuning. Oracle 1Z0-054 Oracle Database 11g Performance Tuning http://killexams.com/exam-detail/1z0-054 C. Query v$session to gather statistics of the individual sessions for the workload created by the jobs. D.

More information

KORA. RDBMS Concepts II

KORA. RDBMS Concepts II RDBMS Concepts II Outline Querying Data Source With SQL Star & Snowflake Schemas Reporting Aggregated Data Using the Group Functions What Are Group Functions? Group functions operate on sets of rows to

More information

Oracle Optimizer: What s New in Oracle Database 12c? Maria Colgan Master Product Manager

Oracle Optimizer: What s New in Oracle Database 12c? Maria Colgan Master Product Manager Oracle Optimizer: What s New in Oracle Database 12c? Maria Colgan Master Product Manager PART 3 2 Program Agenda Adaptive Query Optimization Statistics Enhancements What s new in SQL Plan Management 3

More information

Oracle Database 11g: SQL Tuning Workshop

Oracle Database 11g: SQL Tuning Workshop Oracle University Contact Us: Local: 0845 777 7 711 Intl: +44 845 777 7 711 Oracle Database 11g: SQL Tuning Workshop Duration: 3 Days What you will learn This Oracle Database 11g: SQL Tuning Workshop Release

More information

Top 7 Plan Stability Pitfalls & How to Avoid Them. Neil Chandler Chandler Systems Ltd UK

Top 7 Plan Stability Pitfalls & How to Avoid Them. Neil Chandler Chandler Systems Ltd UK Top 7 Plan Stability Pitfalls & How to Avoid Them Neil Chandler Chandler Systems Ltd UK Keywords: SQL Optimizer Plan Change Stability Outlines Baselines Plan Directives Introduction When you write some

More information

Query Optimizer, Who Influences & How it works ++ optimization techniques

Query Optimizer, Who Influences & How it works ++ optimization techniques Query Optimizer, Who Influences & How it works ++ optimization techniques AIOUG : ODevC Yatra 2018, India Chandan Tanwani Senior Application Engineer Oracle Financial Services Software Ltd. Copyright 2018

More information

SQL Gone Wild: Taming Bad SQL the Easy Way (or the Hard Way) Sergey Koltakov Product Manager, Database Manageability

SQL Gone Wild: Taming Bad SQL the Easy Way (or the Hard Way) Sergey Koltakov Product Manager, Database Manageability SQL Gone Wild: Taming Bad SQL the Easy Way (or the Hard Way) Sergey Koltakov Product Manager, Database Manageability Oracle Enterprise Manager Top-Down, Integrated Application Management Complete, Open,

More information

Join, Sub queries and set operators

Join, Sub queries and set operators Join, Sub queries and set operators Obtaining Data from Multiple Tables EMPLOYEES DEPARTMENTS Cartesian Products A Cartesian product is formed when: A join condition is omitted A join condition is invalid

More information

Interpreting Explain Plan Output. John Mullins

Interpreting Explain Plan Output. John Mullins Interpreting Explain Plan Output John Mullins jmullins@themisinc.com www.themisinc.com www.themisinc.com/webinars Presenter John Mullins Themis Inc. (jmullins@themisinc.com) 30+ years of Oracle experience

More information

D B M G Data Base and Data Mining Group of Politecnico di Torino

D B M G Data Base and Data Mining Group of Politecnico di Torino Database Management Data Base and Data Mining Group of tania.cerquitelli@polito.it A.A. 2014-2015 Optimizer operations Operation Evaluation of expressions and conditions Statement transformation Description

More information

Joining tables. Jaroslav Porubän, Miroslav Biňas, Milan Nosáľ (c)

Joining tables. Jaroslav Porubän, Miroslav Biňas, Milan Nosáľ (c) Joining tables Jaroslav Porubän, Miroslav Biňas, Milan Nosáľ (c) 2011-2016 Introduction Normalization process tears the database into multiple tables related using foreign keys SQL provides means to join

More information

<Insert Picture Here> DBA s New Best Friend: Advanced SQL Tuning Features of Oracle Database 11g

<Insert Picture Here> DBA s New Best Friend: Advanced SQL Tuning Features of Oracle Database 11g DBA s New Best Friend: Advanced SQL Tuning Features of Oracle Database 11g Peter Belknap, Sergey Koltakov, Jack Raitto The following is intended to outline our general product direction.

More information

Oracle Database Performance Tuning, Benchmarks & Replication

Oracle Database Performance Tuning, Benchmarks & Replication Oracle Database Performance Tuning, Benchmarks & Replication Kapil Malhotra kapil.malhotra@software.dell.com Solutions Architect, Information Management Dell Software 2 11/29/2013 Software Database Tuning

More information

Tuning SQL without the Tuning Pack. John Larkin JP Morgan Chase

Tuning SQL without the Tuning Pack. John Larkin JP Morgan Chase Tuning SQL without the Tuning Pack John Larkin JP Morgan Chase Who am I Originally a mainframe COBOL programmer DBA for the last 23 years, the last 15 with Oracle. UNIX (Solaris, Aix, Windows, Linux) Recently

More information

Oracle Database 12c: SQL Tuning for Developers

Oracle Database 12c: SQL Tuning for Developers Oracle Database 12c: SQL Tuning for Developers Student Guide Volume I D79995GC10 Edition 1.0 December 2016 D84109 Learn more from Oracle University at education.oracle.com Author Dimpi Rani Sarmah Technical

More information

Join Methods. Franck Pachot CERN

Join Methods. Franck Pachot CERN Join Methods Franck Pachot CERN Twitter: @FranckPachot E-mail: contact@pachot.net The session is a full demo. This manuscript shows only the commands used for the demo the explanations will be during the

More information

Real-World Performance Training SQL Performance

Real-World Performance Training SQL Performance Real-World Performance Training SQL Performance Real-World Performance Team Agenda 1 2 3 4 5 6 The Optimizer Optimizer Inputs Optimizer Output Advanced Optimizer Behavior Why is my SQL slow? Optimizer

More information

Retrieving Data from Multiple Tables

Retrieving Data from Multiple Tables Islamic University of Gaza Faculty of Engineering Computer Engineering Dept. Database Lab (ECOM 4113) Lab 5 Retrieving Data from Multiple Tables Eng. Mohammed Alokshiya November 2, 2014 An JOIN clause

More information

Intermediate SQL: Aggregated Data, Joins and Set Operators

Intermediate SQL: Aggregated Data, Joins and Set Operators Intermediate SQL: Aggregated Data, Joins and Set Operators Aggregated Data and Sorting Objectives After completing this lesson, you should be able to do the following: Identify the available group functions

More information

Optimizer with Oracle Database 12c Release 2 O R A C L E W H I T E P A P E R J U N E

Optimizer with Oracle Database 12c Release 2 O R A C L E W H I T E P A P E R J U N E Optimizer with Oracle Database 12c Release 2 O R A C L E W H I T E P A P E R J U N E 2 0 1 7 Table of Contents Introduction 1 Adaptive Query Optimization 2 Optimizer Statistics 13 Optimizer Statistics

More information

GIFT Department of Computing Science. CS-217/224: Database Systems. Lab-5 Manual. Displaying Data from Multiple Tables - SQL Joins

GIFT Department of Computing Science. CS-217/224: Database Systems. Lab-5 Manual. Displaying Data from Multiple Tables - SQL Joins GIFT Department of Computing Science CS-217/224: Database Systems Lab-5 Manual Displaying Data from Multiple Tables - SQL Joins V3.0 5/5/2016 Introduction to Lab-5 This lab introduces students to selecting

More information

Dan Hotka Author/Instructor Oracle Ace Director.

Dan Hotka Author/Instructor Oracle Ace Director. Dan Hotka Author/Instructor Oracle Ace Director , LLC (c) www.danhotka.com LLC. Any reproduction or copying of this manual without the express written consent of www.danhotka.com LLC is expressly prohibited.

More information

Oracle 9i Application Development and Tuning

Oracle 9i Application Development and Tuning Index 2NF, NOT 3NF or BCNF... 2:17 A Anomalies Present in this Relation... 2:18 Anomalies (Specific) in this Relation... 2:4 Application Design... 1:28 Application Environment... 1:1 Application-Specific

More information

Advanced Oracle Performance Troubleshooting. Query Transformations Randolf Geist

Advanced Oracle Performance Troubleshooting. Query Transformations Randolf Geist Advanced Oracle Performance Troubleshooting Query Transformations Randolf Geist http://oracle-randolf.blogspot.com/ http://www.sqltools-plusplus.org:7676/ info@sqltools-plusplus.org Independent Consultant

More information

Adaptive Optimization. Presented by: Kerry Osborne Red Gate Webinar, Nov. 2013

Adaptive Optimization. Presented by: Kerry Osborne Red Gate Webinar, Nov. 2013 Adaptive Optimization Presented by: Kerry Osborne Red Gate Webinar, Nov. 2013 whoami Never Worked for Oracle Worked with Oracle DB Since 1982 (V2) Working with Exadata since early 2010 Work for Enkitec

More information

Triangle SQL Server User Group Adaptive Query Processing with Azure SQL DB and SQL Server 2017

Triangle SQL Server User Group Adaptive Query Processing with Azure SQL DB and SQL Server 2017 Triangle SQL Server User Group Adaptive Query Processing with Azure SQL DB and SQL Server 2017 Joe Sack, Principal Program Manager, Microsoft Joe.Sack@Microsoft.com Adaptability Adapt based on customer

More information

Database Programming with SQL

Database Programming with SQL Database Programming with SQL 7-2 Objectives In this lesson, you will learn to: Construct and execute a SELECT statement to access data from more than one table using a nonequijoin Create and execute a

More information

Oracle9i: SQL Tuning Workshop

Oracle9i: SQL Tuning Workshop Oracle9i: SQL Tuning Workshop Instructor Guide Vol. 2 D12395GC10 Production 1.0 January 2002 D34339 Authors Nancy Greenberg Priya Vennapusa Technical Contributors and Reviewers Howard Bradley Laszlo Czinkoczki

More information

Copyright 2016 Ramez Elmasri and Shamkant B. Navathe

Copyright 2016 Ramez Elmasri and Shamkant B. Navathe CHAPTER 19 Query Optimization Introduction Query optimization Conducted by a query optimizer in a DBMS Goal: select best available strategy for executing query Based on information available Most RDBMSs

More information

Real-World Performance Training SQL Performance

Real-World Performance Training SQL Performance Real-World Performance Training SQL Performance Real-World Performance Team Agenda 1 2 3 4 5 6 SQL and the Optimizer You As The Optimizer Optimization Strategies Why is my SQL slow? Optimizer Edges Cases

More information

Five Things You Might Not Know About Oracle Database

Five Things You Might Not Know About Oracle Database Five Things You Might Not Know About Oracle Database Maria Colgan Oracle Database Product Management February 2018 @SQLMaria Safe Harbor Statement The following is intended to outline our general product

More information

Query Optimizer MySQL vs. PostgreSQL

Query Optimizer MySQL vs. PostgreSQL Percona Live, Santa Clara (USA), 24 April 2018 Christian Antognini @ChrisAntognini antognini.ch/blog BASEL BERN BRUGG DÜSSELDORF FRANKFURT A.M. FREIBURG I.BR. GENEVA HAMBURG COPENHAGEN LAUSANNE MUNICH

More information

Architettura Database Oracle

Architettura Database Oracle Architettura Database Oracle Shared Pool La shared pool consiste di: Data dictionary: cache che contiene informazioni relative agli oggetti del databse, lo storage ed i privilegi Library cache: contiene

More information

Firebird in 2011/2012: Development Review

Firebird in 2011/2012: Development Review Firebird in 2011/2012: Development Review Dmitry Yemanov mailto:dimitr@firebirdsql.org Firebird Project http://www.firebirdsql.org/ Packages Released in 2011 Firebird 2.1.4 March 2011 96 bugs fixed 4 improvements,

More information

CMSC424: Programming Project

CMSC424: Programming Project CMSC424: Programming Project Due: April 24, 2012 There are two parts to this assignment. The first one involves generating and analyzing the query plans that Oracle generates. The second part asks you

More information

MANAGING DATA(BASES) USING SQL (NON-PROCEDURAL SQL, X401.9)

MANAGING DATA(BASES) USING SQL (NON-PROCEDURAL SQL, X401.9) Technology & Information Management Instructor: Michael Kremer, Ph.D. Class 6 Professional Program: Data Administration and Management MANAGING DATA(BASES) USING SQL (NON-PROCEDURAL SQL, X401.9) AGENDA

More information

Query Optimizer MySQL vs. PostgreSQL

Query Optimizer MySQL vs. PostgreSQL Percona Live, Frankfurt (DE), 7 November 2018 Christian Antognini @ChrisAntognini antognini.ch/blog BASEL BERN BRUGG DÜSSELDORF FRANKFURT A.M. FREIBURG I.BR. GENEVA HAMBURG COPENHAGEN LAUSANNE MUNICH STUTTGART

More information

Database Programming with PL/SQL

Database Programming with PL/SQL Database Programming with PL/SQL Review of SQL Joins 1 Copyright 2013, Oracle and/or its affiliates. All rights Objectives In this lesson, you will review how to construct and execute SELECT statements:

More information

Advanced Oracle SQL Tuning v3.0 by Tanel Poder

Advanced Oracle SQL Tuning v3.0 by Tanel Poder Advanced Oracle SQL Tuning v3.0 by Tanel Poder /seminar Training overview This training session is entirely about making Oracle SQL execution run faster and more efficiently, understanding the root causes

More information

Introduction to Query Processing and Query Optimization Techniques. Copyright 2011 Ramez Elmasri and Shamkant Navathe

Introduction to Query Processing and Query Optimization Techniques. Copyright 2011 Ramez Elmasri and Shamkant Navathe Introduction to Query Processing and Query Optimization Techniques Outline Translating SQL Queries into Relational Algebra Algorithms for External Sorting Algorithms for SELECT and JOIN Operations Algorithms

More information

Exploring Best Practices and Guidelines for Tuning SQL Statements

Exploring Best Practices and Guidelines for Tuning SQL Statements Exploring Best Practices and Guidelines for Tuning SQL Statements Ami Aharonovich Oracle ACE & OCP Ami@DBAces.co.il Oracle ACE Who am I Oracle Certified Professional DBA (OCP) Founder and CEO, DBAces Oracle

More information

Oracle. Exam Questions 1Z Oracle Database 11g Release 2: SQL Tuning Exam. Version:Demo

Oracle. Exam Questions 1Z Oracle Database 11g Release 2: SQL Tuning Exam. Version:Demo Oracle Exam Questions 1Z0-117 Oracle Database 11g Release 2: SQL Tuning Exam Version:Demo 1.You ran a high load SQL statement that used an index through the SQL Tuning Advisor and accepted its recommendation

More information

7. Query Processing and Optimization

7. Query Processing and Optimization 7. Query Processing and Optimization Processing a Query 103 Indexing for Performance Simple (individual) index B + -tree index Matching index scan vs nonmatching index scan Unique index one entry and one

More information

Oracle Database In-Memory By Example

Oracle Database In-Memory By Example Oracle Database In-Memory By Example Andy Rivenes Senior Principal Product Manager DOAG 2015 November 18, 2015 Safe Harbor Statement The following is intended to outline our general product direction.

More information

Institute of Aga. Microsoft SQL Server LECTURER NIYAZ M. SALIH

Institute of Aga. Microsoft SQL Server LECTURER NIYAZ M. SALIH Institute of Aga 2018 Microsoft SQL Server LECTURER NIYAZ M. SALIH Database: A Database is a collection of related data organized in a way that data can be easily accessed, managed and updated. Any piece

More information

Query Optimization, part 2: query plans in practice

Query Optimization, part 2: query plans in practice Query Optimization, part 2: query plans in practice CS634 Lecture 13 Slides by E. O Neil based on Database Management Systems 3 rd ed, Ramakrishnan and Gehrke Working with the Oracle query optimizer First

More information

Relational Database Index Design and the Optimizers

Relational Database Index Design and the Optimizers Relational Database Index Design and the Optimizers DB2, Oracle, SQL Server, et al. Tapio Lahdenmäki Michael Leach (C^WILEY- IX/INTERSCIENCE A JOHN WILEY & SONS, INC., PUBLICATION Contents Preface xv 1

More information

Institute of Aga. Network Database LECTURER NIYAZ M. SALIH

Institute of Aga. Network Database LECTURER NIYAZ M. SALIH 2017 Institute of Aga Network Database LECTURER NIYAZ M. SALIH Database: A Database is a collection of related data organized in a way that data can be easily accessed, managed and updated. Any piece of

More information

Série n 6 Bis : Ateliers SQL Data Modeler (Oracle)

Série n 6 Bis : Ateliers SQL Data Modeler (Oracle) Série n 6 Bis : Ateliers SQL Data Modeler (Oracle) Getting started with data Modeler Adding a Table to An Existing Database Purpose This tutorial shows you how to add a table to an existing database using

More information

HR Database. Sample Output from TechWriter 2007 for Databases

HR Database. Sample Output from TechWriter 2007 for Databases Table of Contents...3 Tables... 4 COUNTRIES... 5 DEPARTMENTS... 6 EMPLOYEES... 7 JOBS... 9 JOB_HISTORY... 10 LOCATIONS...12 REGIONS...13 Views...14 EMP_DETAILS_VIEW... 15 Procedures...17 SECURE_DML...18

More information

optimization process (see Optimization process, CBO) RBO, 25 Cursor cache, 41, 42 child, 42 parent, 42

optimization process (see Optimization process, CBO) RBO, 25 Cursor cache, 41, 42 child, 42 parent, 42 Index A Access methods bitmap index access CONVERSION COUNT example, 251 INDEX COMBINE, INLIST, 252 manipulation operations, 249 operations, 248, 250 251 physical structure, 247 restricted ROWIDs, 248

More information

Programming Languages and Techniques (CIS120e)

Programming Languages and Techniques (CIS120e) Programming Languages and Techniques (CIS120e) Lecture 7 Sep 15, 2010 Binary Search Trees (Part II), Generics Announcements Homework 2 is due tonight at 11:59:59pm. Homework 3 will be available on the

More information

Parser: SQL parse tree

Parser: SQL parse tree Jinze Liu Parser: SQL parse tree Good old lex & yacc Detect and reject syntax errors Validator: parse tree logical plan Detect and reject semantic errors Nonexistent tables/views/columns? Insufficient

More information

ORACLE TRAINING CURRICULUM. Relational Databases and Relational Database Management Systems

ORACLE TRAINING CURRICULUM. Relational Databases and Relational Database Management Systems ORACLE TRAINING CURRICULUM Relational Database Fundamentals Overview of Relational Database Concepts Relational Databases and Relational Database Management Systems Normalization Oracle Introduction to

More information

Sql Server Syllabus. Overview

Sql Server Syllabus. Overview Sql Server Syllabus Overview This SQL Server training teaches developers all the Transact-SQL skills they need to create database objects like Tables, Views, Stored procedures & Functions and triggers

More information

On Building Integrated and Distributed Database Systems

On Building Integrated and Distributed Database Systems On Building Integrated and Distributed Database Systems Distributed Query Processing and Optimization Robert Wrembel Poznań University of Technology Institute of Computing Science Poznań,, Poland Robert.Wrembel@cs.put.poznan.pl

More information

DB2 9 for z/os Selected Query Performance Enhancements

DB2 9 for z/os Selected Query Performance Enhancements Session: C13 DB2 9 for z/os Selected Query Performance Enhancements James Guo IBM Silicon Valley Lab May 10, 2007 10:40 a.m. 11:40 a.m. Platform: DB2 for z/os 1 Table of Content Cross Query Block Optimization

More information

Join (SQL) - Wikipedia, the free encyclopedia

Join (SQL) - Wikipedia, the free encyclopedia 페이지 1 / 7 Sample tables All subsequent explanations on join types in this article make use of the following two tables. The rows in these tables serve to illustrate the effect of different types of joins

More information

Physical Design. Elena Baralis, Silvia Chiusano Politecnico di Torino. Phases of database design D B M G. Database Management Systems. Pag.

Physical Design. Elena Baralis, Silvia Chiusano Politecnico di Torino. Phases of database design D B M G. Database Management Systems. Pag. Physical Design D B M G 1 Phases of database design Application requirements Conceptual design Conceptual schema Logical design ER or UML Relational tables Logical schema Physical design Physical schema

More information

Oracle ASM Cluster File System (ACFS) 12c Release 2. Ricardo Gonzalez Acuna, Oracle ASM Cluster File System (ACFS) Product Management 31 st May 2017

Oracle ASM Cluster File System (ACFS) 12c Release 2. Ricardo Gonzalez Acuna, Oracle ASM Cluster File System (ACFS) Product Management 31 st May 2017 Oracle ASM Cluster File System (ACFS) 12c Release 2 Ricardo Gonzalez Acuna, Oracle ASM Cluster File System (ACFS) Product Management 31 st May 2017 Safe Harbor Statement The following is intended to outline

More information

Review. Relational Query Optimization. Query Optimization Overview (cont) Query Optimization Overview. Cost-based Query Sub-System

Review. Relational Query Optimization. Query Optimization Overview (cont) Query Optimization Overview. Cost-based Query Sub-System Review Relational Query Optimization R & G Chapter 12/15 Implementation of single Relational Operations Choices depend on indexes, memory, stats, Joins Blocked nested loops: simple, exploits extra memory

More information

.. Spring 2008 CSC 468: DBMS Implementation Alexander Dekhtyar..

.. Spring 2008 CSC 468: DBMS Implementation Alexander Dekhtyar.. .. Spring 2008 CSC 468: DBMS Implementation Alexander Dekhtyar.. Tuning Oracle Query Execution Performance The performance of SQL queries in Oracle can be modified in a number of ways: By selecting a specific

More information

Advanced Database Systems

Advanced Database Systems Lecture IV Query Processing Kyumars Sheykh Esmaili Basic Steps in Query Processing 2 Query Optimization Many equivalent execution plans Choosing the best one Based on Heuristics, Cost Will be discussed

More information

Query Processing and Query Optimization. Prof Monika Shah

Query Processing and Query Optimization. Prof Monika Shah Query Processing and Query Optimization Query Processing SQL Query Is in Library Cache? System catalog (Dict / Dict cache) Scan and verify relations Parse into parse tree (relational Calculus) View definitions

More information

OpenWorld 2015 Oracle Par22oning

OpenWorld 2015 Oracle Par22oning OpenWorld 2015 Oracle Par22oning Did You Think It Couldn t Get Any Be6er? Safe Harbor Statement The following is intended to outline our general product direc2on. It is intended for informa2on purposes

More information

Adaptive

Adaptive Christian Antognini @ChrisAntognini antognini.ch/blog BASEL BERN BRUGG DÜSSELDORF FRANKFURT A.M. FREIBURG I.BR. GENEVA HAMBURG COPENHAGEN LAUSANNE MUNICH STUTTGART VIENNA ZURICH @ChrisAntognini Senior

More information

Kathleen Durant PhD Northeastern University CS Indexes

Kathleen Durant PhD Northeastern University CS Indexes Kathleen Durant PhD Northeastern University CS 3200 Indexes Outline for the day Index definition Types of indexes B+ trees ISAM Hash index Choosing indexed fields Indexes in InnoDB 2 Indexes A typical

More information

Tuna Helper Proven Process for SQL Tuning. Dean Richards Senior DBA, Confio Software

Tuna Helper Proven Process for SQL Tuning. Dean Richards Senior DBA, Confio Software Tuna Helper Proven Process for SQL Tuning Dean Richards Senior DBA, Confio Software 1 Who Am I? Senior DBA for Confio Software DeanRichards@confio.com Current 20+ Years in Oracle, SQL Server Former 15+

More information

Cost Based Optimizer CBO: Configuration Roadmap

Cost Based Optimizer CBO: Configuration Roadmap Cost Based Optimizer CBO: Configuration Roadmap Christian Antognini Sandro Crepaldi DOAG Regionaltreffen Hamburg/Nord 13.09.05, Hamburg Disclaimer > The CBO changes from release to release > It s difficult

More information

Chapter 12: Query Processing

Chapter 12: Query Processing Chapter 12: Query Processing Overview Catalog Information for Cost Estimation $ Measures of Query Cost Selection Operation Sorting Join Operation Other Operations Evaluation of Expressions Transformation

More information

T-SQL Performance Issues What you should know to avoid, find and resolve them. Claire Mora

T-SQL Performance Issues What you should know to avoid, find and resolve them. Claire Mora T-SQL Performance Issues What you should know to avoid, find and resolve them Claire Mora T-SQL Performance Issues What you should know to avoid, find and resolve them Preparing your environment Assessing

More information

DumpsKing. Latest exam dumps & reliable dumps VCE & valid certification king

DumpsKing.   Latest exam dumps & reliable dumps VCE & valid certification king DumpsKing http://www.dumpsking.com Latest exam dumps & reliable dumps VCE & valid certification king Exam : 1z1-062 Title : Oracle Database 12c: Installation and Administration Vendor : Oracle Version

More information

Announcement. Reading Material. Overview of Query Evaluation. Overview of Query Evaluation. Overview of Query Evaluation 9/26/17

Announcement. Reading Material. Overview of Query Evaluation. Overview of Query Evaluation. Overview of Query Evaluation 9/26/17 Announcement CompSci 516 Database Systems Lecture 10 Query Evaluation and Join Algorithms Project proposal pdf due on sakai by 5 pm, tomorrow, Thursday 09/27 One per group by any member Instructor: Sudeepa

More information

Query Optimization Overview

Query Optimization Overview Query Optimization Overview parsing, syntax checking semantic checking check existence of referenced relations and attributes disambiguation of overloaded operators check user authorization query rewrites

More information

What happens. 376a. Database Design. Execution strategy. Query conversion. Next. Two types of techniques

What happens. 376a. Database Design. Execution strategy. Query conversion. Next. Two types of techniques 376a. Database Design Dept. of Computer Science Vassar College http://www.cs.vassar.edu/~cs376 Class 16 Query optimization What happens Database is given a query Query is scanned - scanner creates a list

More information

Algorithms for Query Processing and Optimization. 0. Introduction to Query Processing (1)

Algorithms for Query Processing and Optimization. 0. Introduction to Query Processing (1) Chapter 19 Algorithms for Query Processing and Optimization 0. Introduction to Query Processing (1) Query optimization: The process of choosing a suitable execution strategy for processing a query. Two

More information

Chapter 19 Query Optimization

Chapter 19 Query Optimization Chapter 19 Query Optimization It is an activity conducted by the query optimizer to select the best available strategy for executing the query. 1. Query Trees and Heuristics for Query Optimization - Apply

More information

PERFORMANCE TUNING TRAINING IN BANGALORE

PERFORMANCE TUNING TRAINING IN BANGALORE PERFORMANCE TUNING TRAINING IN BANGALORE TIB ACADEMY #5/3 BEML LAYOUT, VARATHUR MAIN ROAD KUNDALAHALLI GATE, BANGALORE 560066 PH: +91-9513332301/2302 WWW.TRAINININGBANGALORE.COM Oracle Database 11g: Performance

More information

QUERY OPTIMIZATION [CH 15]

QUERY OPTIMIZATION [CH 15] Spring 2017 QUERY OPTIMIZATION [CH 15] 4/12/17 CS 564: Database Management Systems; (c) Jignesh M. Patel, 2013 1 Example SELECT distinct ename FROM Emp E, Dept D WHERE E.did = D.did and D.dname = Toy EMP

More information

Review -Chapter 4. Review -Chapter 5

Review -Chapter 4. Review -Chapter 5 Review -Chapter 4 Entity relationship (ER) model Steps for building a formal ERD Uses ER diagrams to represent conceptual database as viewed by the end user Three main components Entities Relationships

More information

Ensuring Optimal Performance. Vivek Sharma. 3 rd November 2012 Sangam 2012

Ensuring Optimal Performance. Vivek Sharma. 3 rd November 2012 Sangam 2012 Ensuring Optimal Performance Vivek Sharma 3 rd November 2012 Sangam 2012 Who am I? Around 12 Years using Oracle Products Certified DBA versions 8i Specializes in Performance Optimization COE Lead with

More information

Outline. Database Management and Tuning. Outline. Join Strategies Running Example. Index Tuning. Johann Gamper. Unit 6 April 12, 2012

Outline. Database Management and Tuning. Outline. Join Strategies Running Example. Index Tuning. Johann Gamper. Unit 6 April 12, 2012 Outline Database Management and Tuning Johann Gamper Free University of Bozen-Bolzano Faculty of Computer Science IDSE Unit 6 April 12, 2012 1 Acknowledgements: The slides are provided by Nikolaus Augsten

More information

Database Programming with SQL

Database Programming with SQL Database Programming with SQL 12-2 Objectives In this lesson, you will learn to: Construct and execute an UPDATE statement Construct and execute a DELETE statement Construct and execute a query that uses

More information

Administriva. CS 133: Databases. General Themes. Goals for Today. Fall 2018 Lec 11 10/11 Query Evaluation Prof. Beth Trushkowsky

Administriva. CS 133: Databases. General Themes. Goals for Today. Fall 2018 Lec 11 10/11 Query Evaluation Prof. Beth Trushkowsky Administriva Lab 2 Final version due next Wednesday CS 133: Databases Fall 2018 Lec 11 10/11 Query Evaluation Prof. Beth Trushkowsky Problem sets PSet 5 due today No PSet out this week optional practice

More information

Optimizer Challenges in a Multi-Tenant World

Optimizer Challenges in a Multi-Tenant World Optimizer Challenges in a Multi-Tenant World Pat Selinger pselinger@salesforce.come Classic Query Optimizer Concepts & Assumptions Relational Model Cost = X * CPU + Y * I/O Cardinality Selectivity Clustering

More information

Oracle Database 11g: Performance Tuning DBA Release 2

Oracle Database 11g: Performance Tuning DBA Release 2 Course Code: OC11PTDBAR2 Vendor: Oracle Course Overview Duration: 5 RRP: POA Oracle Database 11g: Performance Tuning DBA Release 2 Overview This course starts with an unknown database that requires tuning.

More information

Database Programming - Section 3. Instructor Guide

Database Programming - Section 3. Instructor Guide Database Programming - Section 3 Instructor Guide Table of Contents...1 Lesson 1 - Destinations: What's in My Future?...1 What Will I Learn?...3 Why Learn It?...4 Tell Me / Show Me...5 Try It / Solve

More information