SQL Tuning Proven Methodologies

Size: px
Start display at page:

Download "SQL Tuning Proven Methodologies"

Transcription

1 SQL Tuning Proven Methodologies V.Hariharaputhran

2 V.Hariharaputhran o Twelve years in Oracle Development / DBA / Big Data / Cloud Technologies o All India Oracle Users Group (AIOUG) Evangelist o Passion to learn and share o Blog: o

3 Our 60 minutes Agenda Objective Lifecycle of a SQL Cursors Why and What Get the right Execution Plan Case Studies Push predicate vs. No-Push Join Elimination Correlated sub-query Why my Index is not Used Take Away

4 Until Yesterday it was running Fine What happened now? DBA Developer

5 Typical Day Options we see 1. Why not Cache Table 2. There is Memory Problem / No partition hence you are bound to run slow 3. I learnt new features and desperate to implement them 4. Rewrite the SQL / Add Index / 5. SQL running slow Found the init parameter causing it, Let me change it. 6. I see no Histograms / must be a stats problem 7. I came across a tool, you just have to provide the table name it would generate the SQL for us.

6 Out of the BOX Recreate the Table Avoid writing the SQL / Change the Design Archive Strategy

7 SQL Lifecycle Parse Bind Execute Fetch

8 Some more Parse PARSE So what is before the syntax check Adding VPD Predicates to SQL

9 VPD Watch out for the Predicate Info

10 Why add VPD first

11 More about Parsing Syntax Check - Keywords Semantic Check - Objects Accessible View Merging/Subquery Unnesting Views to Base tables / Inline Views Query Transformation Transitivity Optimization Soft Parse Hard Parse Query Execution Plan / Load into Library Cache

12 Cursor SELECT * FROM EMP ENV STATS SQL TEXT BIND VARIABLES PARENT CURSOR CHILD CURSOR

13 Cursors

14 What is this Child Number = 0?

15

16 Identify the reason for Child Cursor

17 declare v_ename emp.ename%type; begin For x in loop select /* NORMAL */ ename into v_ename from Binding in PLSQL emp where empno = x ; end loop; end; / declare v_ename emp.ename%type; v_sql varchar2(200); begin For x in loop execute immediate 'select /* bind */ ename from emp where empno = :v_empno' into v_ename using x ; end loop; end; / In PL/SQL its free, Oracle does the binding for us

18 Explain Plan

19 Is X not a Number?

20 Estimate Vs Actual

21 Autotrace

22 Autotrace 20000/3=6666.6

23 Explain Plan Not the Real Plan, Just an estimate Treat all Bind Variable as Varchar2 Datatype Does not use Bind Variable Peeking

24 DBMS_XPLAN DBMS_XPLAN.display - Estimated DBMS_XPLAN.display_cursor Real from Memory DBMS_XPLAN.display_awr - Historic

25 CASE STUDY -1

26 Estimated Plan from DBMS_XPLAN SQL> select * from tblchk tbl1 where exists 2 (select 1 from tblchk tbl2 where tbl1.id=tbl2.id and tbl2.id_val='aioug'); no rows selected SQL> select * from table(dbms_xplan.display_cursor()); Id Operation Name Rows Bytes Cost (%CPU) Time SELECT STATEMENT 1 (100) * 1 FILTER * 2 HASH JOIN RIGHT SEMI 190K 2226K 207 (2) 00:00:01 * 3 TABLE ACCESS FULL TBLCHK K 103 (1) 00:00:01 4 TABLE ACCESS FULL TBLCHK 220K 1289K 103 (1) 00:00: Predicate Information (identified by operation id): filter(null IS NOT NULL) 2 - access("tbl1"."id"="tbl2"."id") 3 - filter("tbl2"."id_val"='aioug')

27 God TKprof call count cpu elapsed disk query current rows Parse Execute Fetch total Misses in library cache during parse: 1 Optimizer mode: ALL_ROWS Parsing user id: 143 Number of plan statistics captured: 1 Rows (1st) Rows (avg) Rows (max) Row Source Operation HASH JOIN RIGHT SEMI (cr=487 pr=483 pw=0 time= us cost=207 size= card=190008) TABLE ACCESS FULL TBLCHK (cr=487 pr=483 pw=0 time= us cost=103 size= card=36663) TABLE ACCESS FULL TBLCHK (cr=0 pr=0 pw=0 time=0 us cost=103 size= card=220000) Elapsed times include waiting on following events: Event waited on Times Max. Wait Total Waited Waited SQL*Net message to client Disk file operations I/O db file sequential read db file scattered read SQL*Net message from client

28 Add the Check Constraint SQL> select distinct id_val from tblchk; ID_VAL A B C alter table tblchk add CONSTRAINT check_idval CHECK (id_val in ('A','B','C'));

29 After Constraint TKprof call count cpu elapsed disk query current rows Parse Execute Fetch total Misses in library cache during parse: 1 Optimizer mode: ALL_ROWS Parsing user id: 143 Number of plan statistics captured: 1 Rows (1st) Rows (avg) Rows (max) Row Source Operation FILTER (cr=0 pr=0 pw=0 time=7 us) HASH JOIN RIGHT SEMI (cr=0 pr=0 pw=0 time=0 us cost=276 size= card=257840) TABLE ACCESS FULL TBLCHK (cr=0 pr=0 pw=0 time=0 us cost=138 size= card=46662) TABLE ACCESS FULL TBLCHK (cr=0 pr=0 pw=0 time=0 us cost=137 size= card=280000) Elapsed times include waiting on following events: Event waited on Times Max. Wait Total Waited Waited SQL*Net message to client SQL*Net message from client

30 DBMS_XPLAN ALLSTATS LAST Rows = Num_Rows / No of Distinct records in ID_VAL More v$sql_plan_statistics_all

31 Explain Plan Access Method Table Scan / Index Join Method NL/Hash/Sort Merge Join Order Order in which tables are joined Join Type Anti / Semi / Outer Partition Pruning What partitions are used Parallel Execution Predicate / Column Projections Memory Stats 0/1/M

32 Full table Scan Majority Rows + Columns Scans up to HWM Multi block Reads Candidate for Parallel Execution

33 FTS with Filter

34 Index Fast Full Scan Not Going to Table

35 Index Unique Scan Not Going to Table

36 Index to Table

37 Transform SQL to semantically equivalent SQL - WHY Processed more efficiently Better Plan. I wrote this way because it easy for me, I can develop the application Faster

38 Query Transformation View Merging

39 CREATE VIEW V_EMP_SAL AS SELECT * FROM EMP WHERE SAL>100; View Merging SELECT EMP_ID FROM V_EMP_SAL WHERE DEPTNO = 10; SELECT * FROM EMP WHERE SAL>100 AND DEPTNO = 10; ROWNUM PSEUDOCOLUMN SET OPERATORS UNION UNION ALL INTERSECT MINUS CONNECT BY CLAUSE

40 Transitivity

41 SELECT T1.COL1, T2.COL2 FROM TBL1 T1, TBL2 T2 WHERE T1.COL1 = T2.COL1 AND T1.COL1 = 100; Transitivity SELECT T1.COL1, T2.COL2 FROM TBL1 T1, TBL2 T2 WHERE T1.COL1 = T2.COL1 AND T1.COL1 = 100 AND T2.COL1 = 100;

42 Subquery Unnesting

43 SELECT E.EMPNO, E.DEPTNO FROM EMP E WHERE E.DEPTNO IN (SELECT D.DEPTNO FROM DEPT D WHERE D.LOC = 'CHICAGO') Subquery Unnesting SELECT E.EMPNO EMPNO,E.DEPTNO DEPTNO FROM HARI.EMP E WHERE E.DEPTNO=ANY (SELECT D.DEPTNO DEPTNO FROM HARI.DEPT D WHERE D.LOC='CHICAGO') SELECT E.EMPNO EMPNO,E.DEPTNO DEPTNO FROM HARI.DEPT D,HARI.EMP E WHERE E.DEPTNO=D.DEPTNO AND D.LOC='CHICAGO'

44 Complex View Merging

45 SELECT D.DNAME, D.DEPTNO,VW.DEPT_AVG_SAL FROM DEPT D, VW_AVG_SAL VW WHERE D.DEPTNO = VW.DEPTNO AND D.LOC = 'CHICAGO'; SELECT D.DNAME,D.DEPTNO, AVG(EMP.SAL) DEPT_AVG_SAL FROM HARI.DEPT D,HARI.EMP EMP WHERE D.DEPTNO=EMP.DEPTNO AND D.LOC='CHICAGO' GROUP BY D.ROWID,D.DEPTNO,D.DNAME Complex View Merging SELECT D.DNAME DNAME,D.DEPTNO DEPTNO, VW.DEPT_AVG_SAL DEPT_AVG_SAL FROM HARI.DEPT D, ( SELECT EMP.DEPTNO DEPTNO, AVG(EMP.SAL) DEPT_AVG_SAL FROM HARI.EMP EMP GROUP BY EMP.DEPTNO ) VW WHERE D.DEPTNO=VW.DEPTNO AND D.LOC='CHICAGO'

46 Push Predicates

47 CREATE OR REPLACE VIEW V_EMP_UNION AS SELECT ENAME, EMPNO FROM EMP E1 WHERE DEPTNO <20 UNION SELECT ENAME, EMPNO FROM EMP E2 WHERE DEPTNO >30; SELECT * FROM VW_EMP_UNION WHERE EMPNO > 7788 SELECT * FROM ( SELECT ENAME, EMPNO FROM EMP E1 WHERE DEPTNO <20 AND EMPNO > 7788 UNION SELECT ENAME, EMPNO FROM EMP E2 WHERE DEPTNO >30 AND EMPNO > 7788 ) ; ; * Push Predicates

48 Do You Know (DYK) How many row source can be joined together at a time? TWO In a Full Table Scan up to what point oracle scans all the blocks in a table? HWM Hash or Sort-Merge which is more efficient in general? HASH

49 Join Methods

50 SORT MERGE JOIN

51 SORT MERGE JOIN

52 Join Type Nested Loop Retrieves row from one source and find its corresponding one from another source Hash Join Build Hash Table in memory for smaller row source Go through the other source and uses Hash function on Join Columns

53 select empno from emp where empno like '11'; Do You Know (DYK) How will my predicate info look like? select * from dept where loc like '%CHENNAI'; This operator can be used instead OR clause. How will my predicate info look like? UNION,Even after having DISTINCT clause in the query, SORT UNIQUE is not done by the Optimizer. If the Data doesn't have duplicates

54 Case Study - Correlated Subquery

55 In Action Correlated Subquery SELECT * FROM TAB1 WHERE EXISTS (SELECT 1 FROM TAB2 WHERE TAB2.COL1 = TAB1.COL1)

56

57 Not Using my Index

58

59 Number <-> Varchar

60 Fix the Datatype

61

62 Approach of Datatype Change now - Impacts the Existing Code Don t Forget the Learning TO_Number Function

63 Correlated Subquery is the problem, do you know how it works? You should not use Correlated subquery, rewrite it with NOT IN OK?

64 IS NOT EXISTS = NOT IN?

65

66

67 Lets us dig more Data & Facts

68 NOT EXISTS ANTI JOIN

69 NOT IN ANTI JOIN

70 NOT EXISTS NOT IN ORDERS ******** SINGLE TABLE ACCESS PATH Single Table Cardinality Estimation for ORDERS[O] Table: ORDERS Alias: O Access Path: TableScan Cost: Access Path: index (FullScan) Index: PK_ORDER Cost: Best:: AccessPath: TableScan Cost: ORDERS ******** Single Table Cardinality Estimation for ORDERS[O] Table: ORDERS Alias: O Access Path: TableScan Cost: Access Path: index (FFS) Cost: index filter:"o"."book_id" IS NOT NULL Best:: AccessPath: IndexFFS Index: IDX_ORDERS1 Cost:

71 Does Index Store NULL Values

72 Back to Basics Fast Full Index Scan multiple blocks from disk in a single I/O Cost = No of blocks to be scanned + MBRC value Reads the index blocks in no particular order Accesses the data in the index itself, without accessing the table

73 Fast Full Index Scan Accesses the data in the index itself, without accessing the table

74

75 Can I do it even better Yes, Why not at the Design Stage Enforce referential Integrity Mark Columns as NOT NULL Index the Foreign Key Column

76 I have a CTD After Datatype Correction

77 CTD cont

78 Recap View Merging/Subquery Unnesting Views to Base tables / Inline Views Query Transformation Transitivity Optimization Query Execution Plan

79 Until Yesterday it was running Fine What happened now? DBA Developer Start Comparing Old Plan and New Plan Analyze the Data and understand what has changed The above 2 would help you to dig further

80 References ( NOT IN with NULL Values) Gaja Krishna Vaidyanatha CTD,TKPROF Options - Exadata Performance Mgmt AIOUG Chennai Chapter

81 Thanks

Oracle Database 11g: SQL Tuning Workshop

Oracle Database 11g: SQL Tuning Workshop Oracle University Contact Us: + 38516306373 Oracle Database 11g: SQL Tuning Workshop Duration: 3 Days What you will learn This Oracle Database 11g: SQL Tuning Workshop Release 2 training assists database

More information

1Z0-117 Oracle Database 11g Release 2: SQL Tuning. Oracle

1Z0-117 Oracle Database 11g Release 2: SQL Tuning. Oracle 1Z0-117 Oracle Database 11g Release 2: SQL Tuning Oracle To purchase Full version of Practice exam click below; http://www.certshome.com/1z0-117-practice-test.html FOR Oracle 1Z0-117 Exam Candidates We

More information

Top 25+ DB2 SQL Tuning Tips for Developers. Presented by Tony Andrews, Themis Inc. tandrews@themisinc.com

Top 25+ DB2 SQL Tuning Tips for Developers. Presented by Tony Andrews, Themis Inc. tandrews@themisinc.com Top 25+ DB2 SQL Tuning Tips for Developers Presented by Tony Andrews, Themis Inc. tandrews@themisinc.com Objectives By the end of this presentation, developers should be able to: Understand what SQL Optimization

More information

Oracle EXAM - 1Z0-117. Oracle Database 11g Release 2: SQL Tuning. Buy Full Product. http://www.examskey.com/1z0-117.html

Oracle EXAM - 1Z0-117. Oracle Database 11g Release 2: SQL Tuning. Buy Full Product. http://www.examskey.com/1z0-117.html Oracle EXAM - 1Z0-117 Oracle Database 11g Release 2: SQL Tuning Buy Full Product http://www.examskey.com/1z0-117.html Examskey Oracle 1Z0-117 exam demo product is here for you to test the quality of the

More information

Advanced Oracle SQL Tuning

Advanced Oracle SQL Tuning Advanced Oracle SQL Tuning Seminar content technical details 1) Understanding Execution Plans In this part you will learn how exactly Oracle executes SQL execution plans. Instead of describing on PowerPoint

More information

Oracle Database 11g: SQL Tuning Workshop Release 2

Oracle Database 11g: SQL Tuning Workshop Release 2 Oracle University Contact Us: 1 800 005 453 Oracle Database 11g: SQL Tuning Workshop Release 2 Duration: 3 Days What you will learn This course assists database developers, DBAs, and SQL developers to

More information

DB2 Developers Guide to Optimum SQL Performance

DB2 Developers Guide to Optimum SQL Performance DB2 Developers Guide to Optimum SQL Performance Réunion du Guide DB2 pour z/os France Lundi 18 mars 2013 Tour Euro Plaza, Paris-La Défense Tom Beavin Silicon Valley Lab Email: beavin@us.ibm.com 2012 IBM

More information

An Oracle White Paper May 2011. The Oracle Optimizer Explain the Explain Plan

An Oracle White Paper May 2011. The Oracle Optimizer Explain the Explain Plan An Oracle White Paper May 2011 The Oracle Optimizer Explain the Explain Plan Introduction... 1 The Execution Plan... 2 Displaying the Execution plan... 3 What is Cost... 8 Understanding the execution plan...

More information

The Sins of SQL Programming that send the DB to Upgrade Purgatory Abel Macias. 1 Copyright 2011, Oracle and/or its affiliates. All rights reserved.

The Sins of SQL Programming that send the DB to Upgrade Purgatory Abel Macias. 1 Copyright 2011, Oracle and/or its affiliates. All rights reserved. The Sins of SQL Programming that send the DB to Upgrade Purgatory Abel Macias 1 Copyright 2011, Oracle and/or its affiliates. All rights reserved. Who is Abel Macias? 1994 - Joined Oracle Support 2000

More information

Fallacies of the Cost Based Optimizer

Fallacies of the Cost Based Optimizer Fallacies of the Cost Based Optimizer Wolfgang Breitling breitliw@centrexcc.com Who am I Independent consultant since 1996 specializing in Oracle and Peoplesoft setup, administration, and performance tuning

More information

Best Practices for DB2 on z/os Performance

Best Practices for DB2 on z/os Performance Best Practices for DB2 on z/os Performance A Guideline to Achieving Best Performance with DB2 Susan Lawson and Dan Luksetich www.db2expert.com and BMC Software September 2008 www.bmc.com Contacting BMC

More information

Partitioning under the hood in MySQL 5.5

Partitioning under the hood in MySQL 5.5 Partitioning under the hood in MySQL 5.5 Mattias Jonsson, Partitioning developer Mikael Ronström, Partitioning author Who are we? Mikael is a founder of the technology behind NDB

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 objective A SQL statement can be executed in many different ways The query optimizer determines

More information

SQL Query Evaluation. Winter 2006-2007 Lecture 23

SQL Query Evaluation. Winter 2006-2007 Lecture 23 SQL Query Evaluation Winter 2006-2007 Lecture 23 SQL Query Processing Databases go through three steps: Parse SQL into an execution plan Optimize the execution plan Evaluate the optimized plan Execution

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 Politecnico di Torino Database Management System Oracle Hints Data Base and Data Mining Group of Politecnico di Torino Tania Cerquitelli Computer Engineering, 2014-2015, slides by Tania Cerquitelli and

More information

Oracle 10g PL/SQL Training

Oracle 10g PL/SQL Training Oracle 10g PL/SQL Training Course Number: ORCL PS01 Length: 3 Day(s) Certification Exam This course will help you prepare for the following exams: 1Z0 042 1Z0 043 Course Overview PL/SQL is Oracle's Procedural

More information

Using TimesTen between your Application and Oracle. between your Application and Oracle. DOAG Conference 2011

Using TimesTen between your Application and Oracle. between your Application and Oracle. DOAG Conference 2011 DOAG Conference 2011 Using TimesTen between your Application and Oracle Jan Ott, Roland Stirnimann Senior Consultants Trivadis AG BASEL 1 BERN LAUSANNE ZÜRICH DÜSSELDORF FRANKFURT A.M. FREIBURG I.BR. HAMBURG

More information

Oracle Database: SQL and PL/SQL Fundamentals NEW

Oracle Database: SQL and PL/SQL Fundamentals NEW Oracle University Contact Us: + 38516306373 Oracle Database: SQL and PL/SQL Fundamentals NEW Duration: 5 Days What you will learn This Oracle Database: SQL and PL/SQL Fundamentals training delivers the

More information

SQL Performance Hero and OMG Method vs the Anti-patterns. Jeff Jacobs Jeffrey Jacobs & Associates jmjacobs@jeffreyjacobs.com

SQL Performance Hero and OMG Method vs the Anti-patterns. Jeff Jacobs Jeffrey Jacobs & Associates jmjacobs@jeffreyjacobs.com SQL Performance Hero and OMG Method vs the Anti-patterns Jeff Jacobs Jeffrey Jacobs & Associates jmjacobs@jeffreyjacobs.com Survey Says DBAs Developers Architects Heavily non-oracle development shop Concerned

More information

Oracle Database: SQL and PL/SQL Fundamentals

Oracle Database: SQL and PL/SQL Fundamentals Oracle University Contact Us: +966 12 739 894 Oracle Database: SQL and PL/SQL Fundamentals Duration: 5 Days What you will learn This Oracle Database: SQL and PL/SQL Fundamentals training is designed to

More information

University of Aarhus. Databases 2009. 2009 IBM Corporation

University of Aarhus. Databases 2009. 2009 IBM Corporation University of Aarhus Databases 2009 Kirsten Ann Larsen What is good performance? Elapsed time End-to-end In DB2 Resource consumption CPU I/O Memory Locks Elapsed time = Sync. I/O + CPU + wait time I/O

More information

Oracle Database: SQL and PL/SQL Fundamentals

Oracle Database: SQL and PL/SQL Fundamentals Oracle University Contact Us: 1.800.529.0165 Oracle Database: SQL and PL/SQL Fundamentals Duration: 5 Days What you will learn This course is designed to deliver the fundamentals of SQL and PL/SQL along

More information

Execution Plans: The Secret to Query Tuning Success. MagicPASS January 2015

Execution Plans: The Secret to Query Tuning Success. MagicPASS January 2015 Execution Plans: The Secret to Query Tuning Success MagicPASS January 2015 Jes Schultz Borland plan? The following steps are being taken Parsing Compiling Optimizing In the optimizing phase An execution

More information

Execution plans and tools

Execution plans and tools Execution plans and tools Dawid Wojcik Execution plans Execution plan Text or graphical representation of steps Oracle server takes to execute specific SQL Execution plan is a tree in which every node

More information

DBMS / Business Intelligence, SQL Server

DBMS / Business Intelligence, SQL Server DBMS / Business Intelligence, SQL Server Orsys, with 30 years of experience, is providing high quality, independant State of the Art seminars and hands-on courses corresponding to the needs of IT professionals.

More information

Oracle Database 11 g Performance Tuning. Recipes. Sam R. Alapati Darl Kuhn Bill Padfield. Apress*

Oracle Database 11 g Performance Tuning. Recipes. Sam R. Alapati Darl Kuhn Bill Padfield. Apress* Oracle Database 11 g Performance Tuning Recipes Sam R. Alapati Darl Kuhn Bill Padfield Apress* Contents About the Authors About the Technical Reviewer Acknowledgments xvi xvii xviii Chapter 1: Optimizing

More information

RDBMS Using Oracle. Lecture Week 7 Introduction to Oracle 9i SQL Last Lecture. kamran.munir@gmail.com. Joining Tables

RDBMS Using Oracle. Lecture Week 7 Introduction to Oracle 9i SQL Last Lecture. kamran.munir@gmail.com. Joining Tables RDBMS Using Oracle Lecture Week 7 Introduction to Oracle 9i SQL Last Lecture Joining Tables Multiple Table Queries Simple Joins Complex Joins Cartesian Joins Outer Joins Multi table Joins Other Multiple

More information

A basic create statement for a simple student table would look like the following.

A basic create statement for a simple student table would look like the following. Creating Tables A basic create statement for a simple student table would look like the following. create table Student (SID varchar(10), FirstName varchar(30), LastName varchar(30), EmailAddress varchar(30));

More information

Top 25+ DB2 SQL. Developers

Top 25+ DB2 SQL. Developers Top 25+ DB2 SQL Tuning Tips for Developers Presented by Tony Andrews, Themis Inc. tandrews@themisinc.com Objectives By the end of this presentation, developers should be able to: Understand what SQL Optimization

More information

Duration Vendor Audience 5 Days Oracle End Users, Developers, Technical Consultants and Support Staff

Duration Vendor Audience 5 Days Oracle End Users, Developers, Technical Consultants and Support Staff D80198GC10 Oracle Database 12c SQL and Fundamentals Summary Duration Vendor Audience 5 Days Oracle End Users, Developers, Technical Consultants and Support Staff Level Professional Delivery Method Instructor-led

More information

Iggy Fernandez, Database Specialists DEFINING EFFICIENCY TUNING BY EXAMPLE CREATING AND POPULATING THE TABLES

Iggy Fernandez, Database Specialists DEFINING EFFICIENCY TUNING BY EXAMPLE CREATING AND POPULATING THE TABLES XTREME SQL TUNING: THE TUNING LIMBO Iggy Fernandez, Database Specialists This paper is based on the chapter on SQL tuning in my book Beginning Oracle Database 11g Administration (Apress, 2009). I present

More information

SQL Query Performance Tuning: Tips and Best Practices

SQL Query Performance Tuning: Tips and Best Practices SQL Query Performance Tuning: Tips and Best Practices Pravasini Priyanka, Principal Test Engineer, Progress Software INTRODUCTION: In present day world, where dozens of complex queries are run on databases

More information

Experiment 5.1 How to measure performance of database applications?

Experiment 5.1 How to measure performance of database applications? .1 CSCI315 Database Design and Implementation Experiment 5.1 How to measure performance of database applications? Experimented and described by Dr. Janusz R. Getta School of Computer Science and Software

More information

COMPUTER MEASUREMENT GROUP INDIA. Large Centralized Tax Processing Solution Benchmark and Performance Analysis

COMPUTER MEASUREMENT GROUP INDIA. Large Centralized Tax Processing Solution Benchmark and Performance Analysis COMPUTER MEASUREMENT GROUP INDIA Large Centralized Tax Processing Solution Benchmark and Performance Analysis Vijay Jain (vijaysak@gmail.com) www.cmgindia.org Computer Measurement Group, India 1 Background

More information

Who am I? Copyright 2014, Oracle and/or its affiliates. All rights reserved. 3

Who am I? Copyright 2014, Oracle and/or its affiliates. All rights reserved. 3 Oracle Database In-Memory Power the Real-Time Enterprise Saurabh K. Gupta Principal Technologist, Database Product Management Who am I? Principal Technologist, Database Product Management at Oracle Author

More information

Oracle Database: SQL and PL/SQL Fundamentals NEW

Oracle Database: SQL and PL/SQL Fundamentals NEW Oracle University Contact Us: 001-855-844-3881 & 001-800-514-06-97 Oracle Database: SQL and PL/SQL Fundamentals NEW Duration: 5 Days What you will learn This Oracle Database: SQL and PL/SQL Fundamentals

More information

Tune That SQL for Supercharged DB2 Performance! Craig S. Mullins, Corporate Technologist, NEON Enterprise Software, Inc.

Tune That SQL for Supercharged DB2 Performance! Craig S. Mullins, Corporate Technologist, NEON Enterprise Software, Inc. Tune That SQL for Supercharged DB2 Performance! Craig S. Mullins, Corporate Technologist, NEON Enterprise Software, Inc. Table of Contents Overview...................................................................................

More information

Big Data, Fast Processing Speeds Kevin McGowan SAS Solutions on Demand, Cary NC

Big Data, Fast Processing Speeds Kevin McGowan SAS Solutions on Demand, Cary NC Big Data, Fast Processing Speeds Kevin McGowan SAS Solutions on Demand, Cary NC ABSTRACT As data sets continue to grow, it is important for programs to be written very efficiently to make sure no time

More information

Oracle Database 12c: Introduction to SQL Ed 1.1

Oracle Database 12c: Introduction to SQL Ed 1.1 Oracle University Contact Us: 1.800.529.0165 Oracle Database 12c: Introduction to SQL Ed 1.1 Duration: 5 Days What you will learn This Oracle Database: Introduction to SQL training helps you write subqueries,

More information

SQL Performance and Tuning. DB2 Relational Database

SQL Performance and Tuning. DB2 Relational Database SQL Performance and Tuning DB2 Relational Database 1 Course Overview The DB2 Optimizer SQL Coding Strategies and Guidelines DB2 Catalog Filter Factors for Predicates Runstats and Reorg Utilities DB2 Explain

More information

news from Tom Bacon about Monday's lecture

news from Tom Bacon about Monday's lecture ECRIC news from Tom Bacon about Monday's lecture I won't be at the lecture on Monday due to the work swamp. The plan is still to try and get into the data centre in two weeks time and do the next migration,

More information

Inside the PostgreSQL Query Optimizer

Inside the PostgreSQL Query Optimizer Inside the PostgreSQL Query Optimizer Neil Conway neilc@samurai.com Fujitsu Australia Software Technology PostgreSQL Query Optimizer Internals p. 1 Outline Introduction to query optimization Outline of

More information

Subqueries Chapter 6

Subqueries Chapter 6 Subqueries Chapter 6 Objectives After completing this lesson, you should be able to do the follovving: Describe the types of problems that subqueries can solve Define subqueries List the types of subqueries

More information

Performance rule violations usually result in increased CPU or I/O, time to fix the mistake, and ultimately, a cost to the business unit.

Performance rule violations usually result in increased CPU or I/O, time to fix the mistake, and ultimately, a cost to the business unit. Is your database application experiencing poor response time, scalability problems, and too many deadlocks or poor application performance? One or a combination of zparms, database design and application

More information

Oracle SQL. Course Summary. Duration. Objectives

Oracle SQL. Course Summary. Duration. Objectives Oracle SQL Course Summary Identify the major structural components of the Oracle Database 11g Create reports of aggregated data Write SELECT statements that include queries Retrieve row and column data

More information

Chapter 13: Query Processing. Basic Steps in Query Processing

Chapter 13: Query Processing. Basic Steps in Query Processing Chapter 13: Query Processing! Overview! Measures of Query Cost! Selection Operation! Sorting! Join Operation! Other Operations! Evaluation of Expressions 13.1 Basic Steps in Query Processing 1. Parsing

More information

Oracle DBA Course Contents

Oracle DBA Course Contents Oracle DBA Course Contents Overview of Oracle DBA tasks: Oracle as a flexible, complex & robust RDBMS The evolution of hardware and the relation to Oracle Different DBA job roles(vp of DBA, developer DBA,production

More information

Optimizing the Performance of the Oracle BI Applications using Oracle Datawarehousing Features and Oracle DAC 10.1.3.4.1

Optimizing the Performance of the Oracle BI Applications using Oracle Datawarehousing Features and Oracle DAC 10.1.3.4.1 Optimizing the Performance of the Oracle BI Applications using Oracle Datawarehousing Features and Oracle DAC 10.1.3.4.1 Mark Rittman, Director, Rittman Mead Consulting for Collaborate 09, Florida, USA,

More information

SQL Server Query Tuning

SQL Server Query Tuning SQL Server Query Tuning Klaus Aschenbrenner Independent SQL Server Consultant SQLpassion.at Twitter: @Aschenbrenner About me Independent SQL Server Consultant International Speaker, Author Pro SQL Server

More information

Guide to Performance and Tuning: Query Performance and Sampled Selectivity

Guide to Performance and Tuning: Query Performance and Sampled Selectivity Guide to Performance and Tuning: Query Performance and Sampled Selectivity A feature of Oracle Rdb By Claude Proteau Oracle Rdb Relational Technology Group Oracle Corporation 1 Oracle Rdb Journal Sampled

More information

Displaying Data from Multiple Tables. Chapter 4

Displaying Data from Multiple Tables. Chapter 4 Displaying Data from Multiple Tables Chapter 4 1 Objectives After completing this lesson, you should be able to do the following: Write SELECT statements to access data from more than one table using equality

More information

CIS 631 Database Management Systems Sample Final Exam

CIS 631 Database Management Systems Sample Final Exam CIS 631 Database Management Systems Sample Final Exam 1. (25 points) Match the items from the left column with those in the right and place the letters in the empty slots. k 1. Single-level index files

More information

Oracle Database 12c Enables Quad Graphics to Quickly Migrate from Sybase to Oracle Exadata

Oracle Database 12c Enables Quad Graphics to Quickly Migrate from Sybase to Oracle Exadata Oracle Database 12c Enables Quad Graphics to Quickly Migrate from Sybase to Oracle Exadata Presented with Prakash Nauduri Technical Director Platform Migrations Group, Database Product Management Sep 30,

More information

SQL Performance for a Big Data 22 Billion row data warehouse

SQL Performance for a Big Data 22 Billion row data warehouse SQL Performance for a Big Data Billion row data warehouse Dave Beulke dave @ d a v e b e u l k e.com Dave Beulke & Associates Session: F19 Friday May 8, 15 8: 9: Platform: z/os D a v e @ d a v e b e u

More information

MyOra 3.0. User Guide. SQL Tool for Oracle. Jayam Systems, LLC

MyOra 3.0. User Guide. SQL Tool for Oracle. Jayam Systems, LLC MyOra 3.0 SQL Tool for Oracle User Guide Jayam Systems, LLC Contents Features... 4 Connecting to the Database... 5 Login... 5 Login History... 6 Connection Indicator... 6 Closing the Connection... 7 SQL

More information

Elena Baralis, Silvia Chiusano Politecnico di Torino. Pag. 1. Physical Design. Phases of database design. Physical design: Inputs.

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

More information

Objectives. Oracle SQL and SQL*PLus. Database Objects. What is a Sequence?

Objectives. Oracle SQL and SQL*PLus. Database Objects. What is a Sequence? Oracle SQL and SQL*PLus Lesson 12: Other Database Objects Objectives After completing this lesson, you should be able to do the following: Describe some database objects and their uses Create, maintain,

More information

Chapter 5 More SQL: Complex Queries, Triggers, Views, and Schema Modification

Chapter 5 More SQL: Complex Queries, Triggers, Views, and Schema Modification Chapter 5 More SQL: Complex Queries, Triggers, Views, and Schema Modification Copyright 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 5 Outline More Complex SQL Retrieval Queries

More information

Useful Business Analytics SQL operators and more Ajaykumar Gupte IBM

Useful Business Analytics SQL operators and more Ajaykumar Gupte IBM Useful Business Analytics SQL operators and more Ajaykumar Gupte IBM 1 Acknowledgements and Disclaimers Availability. References in this presentation to IBM products, programs, or services do not imply

More information

SQL Server Query Tuning

SQL Server Query Tuning SQL Server Query Tuning A 12-Step Program By Thomas LaRock, Technical Evangelist and Head Geek Confio Software 4772 Walnut Street, Suite 100 Boulder, CO 80301 www.confio.com Introduction Query tuning is

More information

Displaying Data from Multiple Tables

Displaying Data from Multiple Tables Displaying Data from Multiple Tables 1 Objectives After completing this lesson, you should be able to do the following: Write SELECT statements to access data from more than one table using eguality and

More information

SQL SELECT Query: Intermediate

SQL SELECT Query: Intermediate SQL SELECT Query: Intermediate IT 4153 Advanced Database J.G. Zheng Spring 2012 Overview SQL Select Expression Alias revisit Aggregate functions - complete Table join - complete Sub-query in where Limiting

More information

Maximizing Materialized Views

Maximizing Materialized Views Maximizing Materialized Views John Jay King King Training Resources john@kingtraining.com Download this paper and code examples from: http://www.kingtraining.com 1 Session Objectives Learn how to create

More information

Aggregating Data Using Group Functions

Aggregating Data Using Group Functions Aggregating Data Using Group Functions Objectives Capter 5 After completing this lesson, you should be able to do the following: Identify the available group functions Describe the use of group functions

More information

An Oracle White Paper May 2010. Guide for Developing High-Performance Database Applications

An Oracle White Paper May 2010. Guide for Developing High-Performance Database Applications An Oracle White Paper May 2010 Guide for Developing High-Performance Database Applications Introduction The Oracle database has been engineered to provide very high performance and scale to thousands

More information

Programming with SQL

Programming with SQL Unit 43: Programming with SQL Learning Outcomes A candidate following a programme of learning leading to this unit will be able to: Create queries to retrieve information from relational databases using

More information

MOC 20461C: Querying Microsoft SQL Server. Course Overview

MOC 20461C: Querying Microsoft SQL Server. Course Overview MOC 20461C: Querying Microsoft SQL Server Course Overview This course provides students with the knowledge and skills to query Microsoft SQL Server. Students will learn about T-SQL querying, SQL Server

More information

SQL Server. 2012 for developers. murach's TRAINING & REFERENCE. Bryan Syverson. Mike Murach & Associates, Inc. Joel Murach

SQL Server. 2012 for developers. murach's TRAINING & REFERENCE. Bryan Syverson. Mike Murach & Associates, Inc. Joel Murach TRAINING & REFERENCE murach's SQL Server 2012 for developers Bryan Syverson Joel Murach Mike Murach & Associates, Inc. 4340 N. Knoll Ave. Fresno, CA 93722 www.murach.com murachbooks@murach.com Expanded

More information

Topics Advanced PL/SQL, Integration with PROIV SuperLayer and use within Glovia

Topics Advanced PL/SQL, Integration with PROIV SuperLayer and use within Glovia Topics Advanced PL/SQL, Integration with PROIV SuperLayer and use within Glovia 1. SQL Review Single Row Functions Character Functions Date Functions Numeric Function Conversion Functions General Functions

More information

Oracle Database 11g: Performance Tuning DBA Release 2

Oracle Database 11g: Performance Tuning DBA Release 2 Oracle University Contact Us: 1.800.529.0165 Oracle Database 11g: Performance Tuning DBA Release 2 Duration: 5 Days What you will learn This Oracle Database 11g Performance Tuning training starts with

More information

University of Massachusetts Amherst Department of Computer Science Prof. Yanlei Diao

University of Massachusetts Amherst Department of Computer Science Prof. Yanlei Diao University of Massachusetts Amherst Department of Computer Science Prof. Yanlei Diao CMPSCI 445 Midterm Practice Questions NAME: LOGIN: Write all of your answers directly on this paper. Be sure to clearly

More information

Efficient Data Access and Data Integration Using Information Objects Mica J. Block

Efficient Data Access and Data Integration Using Information Objects Mica J. Block Efficient Data Access and Data Integration Using Information Objects Mica J. Block Director, ACES Actuate Corporation mblock@actuate.com Agenda Information Objects Overview Best practices Modeling Security

More information

SQL the natural language for analysis ORACLE WHITE PAPER JUNE 2015

SQL the natural language for analysis ORACLE WHITE PAPER JUNE 2015 SQL the natural language for analysis ORACLE WHITE PAPER JUNE 2015 Contents Overview 1 Introduction 1 Powerful Framework 1 Simplified Optimization 6 Continuous Evolution 8 Standards Based 9 Why Oracle

More information

Introduction to the Oracle DBMS

Introduction to the Oracle DBMS Introduction to the Oracle DBMS Kristian Torp Department of Computer Science Aalborg University www.cs.aau.dk/ torp torp@cs.aau.dk December 2, 2011 daisy.aau.dk Kristian Torp (Aalborg University) Introduction

More information

VARRAY AND NESTED TABLE

VARRAY AND NESTED TABLE Oracle For Beginners Page : 1 Chapter 23 VARRAY AND NESTED TABLE What is a collection? What is a VARRAY? Using VARRAY Nested Table Using DML commands with Nested Table Collection methods What is a collection?

More information

MS SQL Performance (Tuning) Best Practices:

MS SQL Performance (Tuning) Best Practices: MS SQL Performance (Tuning) Best Practices: 1. Don t share the SQL server hardware with other services If other workloads are running on the same server where SQL Server is running, memory and other hardware

More information

Improving SQL efficiency using CASE

Improving SQL efficiency using CASE Improving SQL efficiency using CASE Some time ago I wrote The Power of Decode - a paper on using the DECODE function to improve report performance. I was aware at the time that DECODE was being replaced

More information

Instant SQL Programming

Instant SQL Programming Instant SQL Programming Joe Celko Wrox Press Ltd. INSTANT Table of Contents Introduction 1 What Can SQL Do for Me? 2 Who Should Use This Book? 2 How To Use This Book 3 What You Should Know 3 Conventions

More information

1. This lesson introduces the Performance Tuning course objectives and agenda

1. This lesson introduces the Performance Tuning course objectives and agenda Oracle Database 11g: Performance Tuning The course starts with an unknown database that requires tuning. The lessons will proceed through the steps a DBA will perform to acquire the information needed

More information

Keep It Simple - Common, Overlooked Performance Tuning Tips. Paul Jackson Hotsos

Keep It Simple - Common, Overlooked Performance Tuning Tips. Paul Jackson Hotsos Keep It Simple - Common, Overlooked Performance Tuning Tips Paul Jackson Hotsos Who Am I? Senior Consultant at Hotsos Oracle Ace Co-Author of Oracle Applications DBA Field Guide Co-Author of Oracle R12

More information

FHE DEFINITIVE GUIDE. ^phihri^^lv JEFFREY GARBUS. Joe Celko. Alvin Chang. PLAMEN ratchev JONES & BARTLETT LEARN IN G. y ti rvrrtuttnrr i t i r

FHE DEFINITIVE GUIDE. ^phihri^^lv JEFFREY GARBUS. Joe Celko. Alvin Chang. PLAMEN ratchev JONES & BARTLETT LEARN IN G. y ti rvrrtuttnrr i t i r : 1. FHE DEFINITIVE GUIDE fir y ti rvrrtuttnrr i t i r ^phihri^^lv ;\}'\^X$:^u^'! :: ^ : ',!.4 '. JEFFREY GARBUS PLAMEN ratchev Alvin Chang Joe Celko g JONES & BARTLETT LEARN IN G Contents About the Authors

More information

Intro to Embedded SQL Programming for ILE RPG Developers

Intro to Embedded SQL Programming for ILE RPG Developers Intro to Embedded SQL Programming for ILE RPG Developers Dan Cruikshank DB2 for i Center of Excellence 1 Agenda Reasons for using Embedded SQL Getting started with Embedded SQL Using Host Variables Using

More information

Netezza SQL Class Outline

Netezza SQL Class Outline Netezza SQL Class Outline CoffingDW education has been customized for every customer for the past 20 years. Our classes can be taught either on site or remotely via the internet. Education Contact: John

More information

Oracle PL/SQL Best Practices

Oracle PL/SQL Best Practices Achieving PL/SQL Excellence Oracle PL/SQL Best Practices Steven Feuerstein Me - www.stevenfeuerstein.com PL/Solutions - www.plsolutions.com RevealNet - www.revealnet.com 7/5/99 Copyright 1999 Steven Feuerstein

More information

Query tuning by eliminating throwaway

Query tuning by eliminating throwaway Query tuning by eliminating throwaway This paper deals with optimizing non optimal performing queries. Abstract Martin Berg (martin.berg@oracle.com) Server Technology System Management & Performance Oracle

More information

Performance Tuning for the Teradata Database

Performance Tuning for the Teradata Database Performance Tuning for the Teradata Database Matthew W Froemsdorf Teradata Partner Engineering and Technical Consulting - i - Document Changes Rev. Date Section Comment 1.0 2010-10-26 All Initial document

More information

SQL - QUICK GUIDE. Allows users to access data in relational database management systems.

SQL - QUICK GUIDE. Allows users to access data in relational database management systems. http://www.tutorialspoint.com/sql/sql-quick-guide.htm SQL - QUICK GUIDE Copyright tutorialspoint.com What is SQL? SQL is Structured Query Language, which is a computer language for storing, manipulating

More information

Oracle Database In-Memory The Next Big Thing

Oracle Database In-Memory The Next Big Thing Oracle Database In-Memory The Next Big Thing Maria Colgan Master Product Manager #DBIM12c Why is Oracle do this Oracle Database In-Memory Goals Real Time Analytics Accelerate Mixed Workload OLTP No Changes

More information

COMP 5138 Relational Database Management Systems. Week 5 : Basic SQL. Today s Agenda. Overview. Basic SQL Queries. Joins Queries

COMP 5138 Relational Database Management Systems. Week 5 : Basic SQL. Today s Agenda. Overview. Basic SQL Queries. Joins Queries COMP 5138 Relational Database Management Systems Week 5 : Basic COMP5138 "Relational Database Managment Systems" J. Davis 2006 5-1 Today s Agenda Overview Basic Queries Joins Queries Aggregate Functions

More information

Introducing Microsoft SQL Server 2012 Getting Started with SQL Server Management Studio

Introducing Microsoft SQL Server 2012 Getting Started with SQL Server Management Studio Querying Microsoft SQL Server 2012 Microsoft Course 10774 This 5-day instructor led course provides students with the technical skills required to write basic Transact-SQL queries for Microsoft SQL Server

More information

Mini User's Guide for SQL*Plus T. J. Teorey

Mini User's Guide for SQL*Plus T. J. Teorey Mini User's Guide for SQL*Plus T. J. Teorey Table of Contents Oracle/logging-in 1 Nested subqueries 5 SQL create table/naming rules 2 Complex functions 6 Update commands 3 Save a query/perm table 6 Select

More information

Object-Relational Query Processing

Object-Relational Query Processing Object-Relational Query Processing Johan Petrini Department of Information Technology Uppsala University, Sweden Johan.Petrin@it.uu.se 1. Introduction In the beginning, there flat files of data with no

More information

3.GETTING STARTED WITH ORACLE8i

3.GETTING STARTED WITH ORACLE8i Oracle For Beginners Page : 1 3.GETTING STARTED WITH ORACLE8i Creating a table Datatypes Displaying table definition using DESCRIBE Inserting rows into a table Selecting rows from a table Editing SQL buffer

More information

ORACLE 9I / 10G / 11G / PL/SQL COURSE CONTENT

ORACLE 9I / 10G / 11G / PL/SQL COURSE CONTENT ORACLE 9I / 10G / 11G / PL/SQL COURSE CONTENT INTRODUCTION: Course Objectives I-2 About PL/SQL I-3 PL/SQL Environment I-4 Benefits of PL/SQL I-5 Benefits of Subprograms I-10 Invoking Stored Procedures

More information

PERFORMANCE TIPS FOR BATCH JOBS

PERFORMANCE TIPS FOR BATCH JOBS PERFORMANCE TIPS FOR BATCH JOBS Here is a list of effective ways to improve performance of batch jobs. This is probably the most common performance lapse I see. The point is to avoid looping through millions

More information

Toad for Oracle 8.6 SQL Tuning

Toad for Oracle 8.6 SQL Tuning Quick User Guide for Toad for Oracle 8.6 SQL Tuning SQL Tuning Version 6.1.1 SQL Tuning definitively solves SQL bottlenecks through a unique methodology that scans code, without executing programs, to

More information

Oracle InMemory Database

Oracle InMemory Database Oracle InMemory Database Calgary Oracle Users Group December 11, 2014 Outline Introductions Who is here? Purpose of this presentation Background Why In-Memory What it is How it works Technical mechanics

More information

SAP Business Objects Business Intelligence platform Document Version: 4.1 Support Package 7 2015-11-24. Data Federation Administration Tool Guide

SAP Business Objects Business Intelligence platform Document Version: 4.1 Support Package 7 2015-11-24. Data Federation Administration Tool Guide SAP Business Objects Business Intelligence platform Document Version: 4.1 Support Package 7 2015-11-24 Data Federation Administration Tool Guide Content 1 What's new in the.... 5 2 Introduction to administration

More information

Introduction to Microsoft Jet SQL

Introduction to Microsoft Jet SQL Introduction to Microsoft Jet SQL Microsoft Jet SQL is a relational database language based on the SQL 1989 standard of the American Standards Institute (ANSI). Microsoft Jet SQL contains two kinds of

More information

Database Performance and Tuning

Database Performance and Tuning Database Performance and Tuning for developers (RAC issues and examples) WLCG Service Reliability Workshop 26 November 2007 Miguel Anjo, CERN-Physics Databases team Outline Motivation Basics (what you

More information