SlideShare a Scribd company logo
Stop the Chaos! Get Real Oracle
Performance by Query Tuning – Part 2
Janis Griffin
Senior DBA / Performance Evangelist
© 2017 SolarWinds Worldwide, LLC. All rights reserved.
Who am I?
• Senior DBA / Performance Evangelist for SolarWinds
• Janis.Griffin@solarwinds.com
• Twitter® - @DoBoutAnything
• Current – 25+ Years in Oracle®, DB2®, ASE, SQL Server®, MySQL®
• DBA and Developer
• Specialize in performance Tuning
• Review database performance for customers and prospects
• Common question: “How do I tune it?”
© 2017 SolarWinds Worldwide, LLC. All rights reserved.
Agenda
• A quick review of part 1
• Using wait time analysis (WTA)
• Reviewing the execution plan
• Understanding the optimizer
• Finding the expensive steps
• Discuss several tuning techniques
• SQL diagramming
• Partitioning and other useful features
• How to identify coding mistakes
• Engineer out the stupid
• What to do if you can’t change the code
• Third-party applications
• Avoiding hints
• Who registered yesterday for SQL Tuning?
SELECT s.fname, s.lname, r.signup_date
FROM student s
INNER JOIN registration r ON s.student_id = r.student_id
INNER JOIN class c ON r.class_id = c.class_id
WHERE c.name = 'SQL TUNING'
AND r.signup_date BETWEEN :beg_date AND :end_date
AND r.cancelled = 'N‘
• Execution Stats – 21,829 Buffer Gets
• Execution Time – 22 seconds to execute
• Wait Events – Waits 90% direct path read
Case Study for Review
User
complained.
Query spent
over 3 hours in
the database.
© 2017 SolarWinds Worldwide, LLC. All rights reserved.
Execution Plan
© 2017 SolarWinds Worldwide, LLC. All rights reserved.
Relationship Diagram
© 2017 SolarWinds Worldwide, LLC. All rights reserved.
• Recommends – three new indexes
Tuning Advisor
DECLARE
l_sql_tune_task_id VARCHAR2(100);
BEGIN
l_sql_tune_task_id := DBMS_SQLTUNE.create_tuning_task ( sql_id => '&sql_id',
scope => DBMS_SQLTUNE.scope_comprehensive, time_limit => 60,
task_name => '&sql_id', description => 'Tuning task for class registration query');
DBMS_OUTPUT.put_line('l_sql_tune_task_id: ' || l_sql_tune_task_id);
END;
/
EXEC DBMS_SQLTUNE.execute_tuning_task(task_name => '&sql_id');
© 2017 SolarWinds Worldwide, LLC. All rights reserved.
• Need to know the size of the actual data sets for each step in execution plan
• In Joins (Right, Left, Outer)
• What are the filtering predicates?
• When is each filtering predicate applied?
• Try to filter earlier rather than later
• Compare size of final result set with data read
• Find the driving table
• To reduce buffer gets
Tune the Query
SELECT s.fname, s.lname, r.signup_date
FROM student s
INNER JOIN registration r ON s.student_id = r.student_id
INNER JOIN class c ON r.class_id = c.class_id
WHERE c.name = 'SQL TUNING'
AND r.signup_date BETWEEN :beg_date AND :end_date
AND r.cancelled = 'N'
Joins
Filtering
Predicates
© 2017 SolarWinds Worldwide, LLC. All rights reserved.
• “SQL Tuning” by Dan Tow
• Great book that teaches SQL Diagramming
• http://www.singingsql.com
SQL Diagramming
registration
student class
5
1
30
1
4%
.1%
select count(1) from registration where cancelled = 'N'
and signup_date between '2016-12-10 00:00' and '2016-12-11 00:00'
64112 / 1783066 * 100 = 3.59 or 4%
select count(1) from class where name = 'SQL TUNING'
2 / 1,267 * 100 = .1%
© 2017 SolarWinds Worldwide, LLC. All rights reserved.
© 2017 SolarWinds Worldwide, LLC. All rights reserved.
• CREATE INDEX cl_name ON class(name);
• Execution Stats – 20,348 buffer gets
• Why is a full table scan still occurring on REGISTRATION?
New Execution Plan
• CLASS_ID not left leading in index
• Execution Stats – 20,348 buffer gets
• Twice the work to use Primary Key Index on REGISTRATION
Review Index Order
© 2017 SolarWinds Worldwide, LLC. All rights reserved.
© 2017 SolarWinds Worldwide, LLC. All rights reserved.
• CREATE INDEX reg_alt ON registration(class_id);
• Execution Stats – 3000 Buffer Gets / Average Execs - .008 Secs
New Execution Plan
© 2017 SolarWinds Worldwide, LLC. All rights reserved.
• CREATE INDEX reg_cancel_signup ON registration(cancelled,signup_date);
Tuning Advisor Suggested Index
Execution Stats:
1107 Buffer Gets
Avg Executions:
0.140 Secs
© 2017 SolarWinds Worldwide, LLC. All rights reserved.
• CREATE INDEX reg_alt ON registration(class_id,signup_date, cancelled);
• Execution Stats – 445 Buffer Gets / Average Execs - .002 Secs
Better Execution Plan
Performance Improved
reg_canceled_signup index
Average Wait Time per Execution for SQL Statement Class_Registration | CECE_JGRIFFIN-2
January 27, 2015
Daily Time Range: 1:00 PM-10:00 PM
© 2017 SolarWinds Worldwide, LLC. All rights reserved.
© 2017 SolarWinds Worldwide, LLC. All rights reserved.
Case Study – Current Pay Check For Specific Employees
SELECT e.first_name, e.last_name, l.region_name
FROM emp e
INNER JOIN dept d ON e.department_id = d.department_id
INNER JOIN loc l ON l.location_id = d.location_id
WHERE (e.last_name LIKE :b1)
AND e.employee_id IN (
SELECT employee_id
FROM wage_pmt w
WHERE w.employee_id = e.employee_id
AND w.pay_date>= trunc(sysdate)-31);
© 2017 SolarWinds Worldwide, LLC. All rights reserved.
Wait Time Analysis
Almost 100% on PGA
memory allocation wait. New
wait event in 12.2 – not
documented
No statistics,
Unique indexes
Added PKs and Fks
© 2017 SolarWinds Worldwide, LLC. All rights reserved.
Execution Plan
© 2017 SolarWinds Worldwide, LLC. All rights reserved.
© 2017 SolarWinds Worldwide, LLC. All rights reserved.
Understanding the Underlying Objects
ACCEPT SQL_ID CHAR PROMPT 'Enter SQL_ID> '
DECLARE
l_sql_tune_task_id VARCHAR2(100);
BEGIN
l_sql_tune_task_id := DBMS_SQLTUNE.create_tuning_task ( sql_id => '&sql_id',
scope => DBMS_SQLTUNE.scope_comprehensive, time_limit => 60,
task_name => '&sql_id', description => 'Tuning task for Current Paycheck');
DBMS_OUTPUT.put_line('l_sql_tune_task_id: ' || l_sql_tune_task_id);
END;
/
EXEC DBMS_SQLTUNE.execute_tuning_task(task_name => '&sql_id');
SELECT DBMS_SQLTUNE.report_tuning_task('&sql_id') AS recommendations FROM dual;
EXEC DBMS_SQLTUNE.drop_tuning_task('&sql_id');
© 2017 SolarWinds Worldwide, LLC. All rights reserved.
Ask the Tuning Advisor
No recommendations
SQL Diagramming
select count(1) from wage_pmt
where pay_date >= sysdate – 31
2,184 / 142,708 * 100 = 1.5%
select avg(cnt) from (select substr(last_name,1,3), count(*) cnt
from emp group by substr(last_name,1,3))
278.5 / 3,899 * 100 = .7.14% With full last nume = .1%
emp
dept
wage_pmt
975
1
37
1
.7%
2%
loc
1
1
.1%
© 2017 SolarWinds Worldwide, LLC. All rights reserved.
No change?
© 2017 SolarWinds Worldwide, LLC. All rights reserved.
Add Index on WAGE_PMT(employee_id)
© 2017 SolarWinds Worldwide, LLC. All rights reserved.
Adjust Index on WAGE_PMT
CREATE INDEX idx_emp_date
ON wage_pmt
(employee_id, pay_date);
© 2017 SolarWinds Worldwide, LLC. All rights reserved.
Improved Performance
Created index
IDX_EMP_DATE
• FETCH FIRST n ROWS ONLY
• Retrieves first rows without scanning everything
• Faster than using rownum
• OFFSET n ROWS FETCH FIRST n ROWS ONLY
• Skip some number of rows
• 12.2 Approximate Query Processing
• Used for approximate ‘count distinct’ values
• And adds percentile aggregation
• Allows for faster processing of large data sets
• Not exact but usually within 95%+ range
• Three new parameters – alter system/session
• approx_for_aggregation Default=FALSE
• approx_for_count_distinct Default=FALSE
• approx_for_percentile Default=NONE
© 2017 SolarWinds Worldwide, LLC. All rights reserved.
Other Tuning Tips
© 2017 SolarWinds Worldwide, LLC. All rights reserved.
Approximate SQL Example Without Changing Code
Why is it exact?
Need to
set both
• Convert non-partitioned table
• To a partitioned table ONLINE
• Many new partition options
• Automatic Lists
• Multi-column Lists
• Partitioned external tables
• Other maintenance options
© 2017 SolarWinds Worldwide, LLC. All rights reserved.
New 12.2 Partitioning Features
UPDATE INDEXES clause is
optional. Indexes with SYS
names will be generated if not
used.
• Look for performance inhibitors
• Cursor or row by row processing
• Parallel processing
• Don’t use in an OLTP environment
• Use only when accessing large data sets and additional resources can be allocated
• Nested views that use db_links
• Abuse of Wild Cards (*) or No Where Clause
• Select ONLY those columns in a query which are required.
• Extra columns cause more I/O on the database and increase network traffic
• Code-based SQL Generators (e.g. Hibernate)
• Using functions on indexed columns (SUBSTR, TO_CHAR, UPPER, TRUNC)
• Optimizer can’t use the index
• Instead move the function to the constant or variable side of equation
• Consider creating a function based index
• Hard-coded hints
Engineer Out the Stupid
select… where upper(last_name) = ‘GRIFFIN’
Better way: select … where last_name = upper(:b1);
© 2017 SolarWinds Worldwide, LLC. All rights reserved.
• Reduce SORT operations as they slow down your queries
• Don’t use the UNION operator if you can use UNION ALL
• Avoid the DISTINCT keyword if you don’t need it
• Ensure the left-leading column of a multi-column index is reference
• Otherwise an INDEX SKIP SCAN may occur
• Often no better than a FULL TABLE SCAN
• Try to avoid Cartesian product queries
• Use bind variables instead of literal values
• Reduces repeated parsing of the same statement
• If using sub-queries, make use of the EXISTS operator when possible
• Optimizer will stop with a match and avoid a FULL TABLE SCAN
• Try to use an index if less than 5% of the data needs to be accessed
• Exception: small table are best accessed through a FULL TABLE SCAN
• Consider keeping in memory
More Do’s and Don’ts
© 2017 SolarWinds Worldwide, LLC. All rights reserved.
• Use equi-joins whenever possible
• Try not to use ‘not in’, !=, <>, not null, etc.
• Optimizer has more choices to choose from
• Avoid complex expressions such as NVL(col1,0), TO_DATE(), TO_NUMBER()
• They prevent the optimizer from assigning valid cardinality or selectivity estimates
• Can affect the overall plan and the join methods
• Avoid joining complex views
• May instantiate all views to run query against (reading too much data)
• Querying views requires all tables from the view to be accessed
• If they aren’t required, then don’t use the view
• Use the partition key in the ‘WHERE’ clause if querying a partitioned table
• Partition pruning will be used to reduce the amount of data read
Avoid Common Pitfalls
© 2017 SolarWinds Worldwide, LLC. All rights reserved.
• If you can hint it, baseline it (per Tom Kyte)
• Alternative to using hints
• Hints difficult to manage over time
• Once added, usually forgotten about
• Third-party software – can’t modify code
• Example:
Merge Join Cartesian > Nested Loop
select /* jg */ p.product_name
from order_items o, product p
where o.unit_price = :b1
and o.quantity > :b2
and o.product_id = p.product_id
and p.product_id = :b3;
What to Do If You Can't Change the Query
select /*+ USE_NL(o p) */ /* jg */ p.product_name
from order_items o, product p
where o.unit_price = :b1
and o.quantity > :b2
and o.product_id = p.product_id
and p.product_id = :b3;
© 2017 SolarWinds Worldwide, LLC. All rights reserved.
• Create baseline of original plan
Alter session set optimizer_capture_sql_plan_baselines = TRUE;
• Or dbms_spm.load_plans_from_cursor_cache
• Example next slide
How to Change the Baseline
From cache Baseline
© 2017 SolarWinds Worldwide, LLC. All rights reserved.
• Manually run hinted query
• Hint = /*+ USE_NL(p) +/
Change the Baseline – Cont.
Get SQL_ID, Plan hash value from cache Load from cache into baseline
© 2017 SolarWinds Worldwide, LLC. All rights reserved.
© 2017 SolarWinds Worldwide, LLC. All rights reserved.
SELECT c_last, c_first, c_street_1, c_city, c_state, c_zip,
c_phone, o_entry_d, d_name, ol_delivery_d, ol_quantity, ol_amount
FROM order_line, orders, district, customer, stock
WHERE o_id = ol_o_id
AND o_c_id=c_id
AND s_i_id = ol_i_id
AND d_id = ol_d_id
AND ol_w_id = :B2
AND ol_d_id = :B4
AND (ol_o_id < :B3 )
AND ol_o_id >= (:B3 - 20)
AND s_w_id = :B2
AND s_quantity < :B1
AND d_id = :B4
AND c_last like :B5 ;
Another Case Study – Orders by Customer Last Name
© 2017 SolarWinds Worldwide, LLC. All rights reserved.
Review the Execution Plan
select * from table (dbms_xplan.display_cursor(null,null, format=> '+report'));
© 2017 SolarWinds Worldwide, LLC. All rights reserved.
• Stock:
Get Object Information
create index stock_idx
on stock
(s_i_id, s_w_id, s_quantity);
© 2017 SolarWinds Worldwide, LLC. All rights reserved.
• Orders:
Get Object Information
Actual Rows = 60,000
Find the Driving Table
orders
stock
district
100
1
30
1
.7%
.03
select count(*) from order_line
where ol_o_id < 200 and ol_o_id >= 200-20;
3941 / 600916 * 100 = .6558%
select avg(cnt) from (select c_last, count(*) cnt
from customer group by c_last);
20 / 60000 * 100 = .03333%
Filter on Stock: 3109 / 283000 * 100 = 1%
order_line
customer
warehouse
WHERE o_id = ol_o_id
AND o_c_id=c_id
AND s_i_id = ol_i_id
AND d_id = ol_d_id
AND ol_w_id = :B2
AND ol_d_id = :B4
AND (ol_o_id < :B3 )
AND ol_o_id >= (:B3 - 20)
AND s_w_id = :B2
AND s_quantity < :B1
AND d_id = :B4
AND c_last like :B5 ;
1
20
1
1
6
60092
10
1%
© 2017 SolarWinds Worldwide, LLC. All rights reserved.
• create index stock_idx on stock (s_i_id, s_w_id, s_quantity);
© 2017 SolarWinds Worldwide, LLC. All rights reserved.
Engineer Out the Stupid
• create index orders_i2 on orders(o_id,o_c_id, o_entry_d);
Add Index on Orders to INCLUDE Customer
© 2017 SolarWinds Worldwide, LLC. All rights reserved.
© 2017 SolarWinds Worldwide, LLC. All rights reserved.
Did Performance Improve?
Added Index on
Stock
Added Index on
Orders
• Make sure you are tuning the correct query
• Use wait time analysis
• Understand the execution plan
• Focus on the costly steps
• Know what the optimizer knows
• Try these tuning techniques
• SQL diagraming to find the best execution plan
• Consider new fetch, approximate and partitioning features
• Engineer out the stupid
• Be on the lookout for coding mistakes
• If you can’t change the code
• Try using baselines or patches
© 2017 SolarWinds Worldwide, LLC. All rights reserved.
Summary
• Try Database Performance Analyzer FREE for 14 days
• Improve root cause of slow performance
• Quickly identify root cause of issues that impact end-user response time
• See historical trends over days, months, and years
• Understand impact of VMware® performance
• Agentless architecture with no dependence on Oracle Packs, installs in minutes
© 2017 SolarWinds Worldwide, LLC. All rights reserved.
Resolve performance issues quickly - free trial
www.solarwinds.com/dpa-download/
The SolarWinds, SolarWinds & Design, Orion, and THWACK trademarks are the exclusive
property of SolarWinds Worldwide, LLC or its affiliates, are registered with the U.S.
Patent and Trademark Office, and may be registered or pending registration in other
countries. All other SolarWinds trademarks, service marks, and logos may be common
law marks or are registered or pending registration. All other trademarks mentioned
herein are used for identification purposes only and are trademarks of (and may be
registered trademarks) of their respective companies.
Thank You!!!

More Related Content

What's hot

Mining the AWR: Alternative Methods for Identification of the Top SQLs (inclu...
Mining the AWR: Alternative Methods for Identification of the Top SQLs (inclu...Mining the AWR: Alternative Methods for Identification of the Top SQLs (inclu...
Mining the AWR: Alternative Methods for Identification of the Top SQLs (inclu...
Maris Elsins
 
SOA Suite Administration from OUGN 2014
SOA Suite Administration from OUGN 2014SOA Suite Administration from OUGN 2014
SOA Suite Administration from OUGN 2014
Jon Petter Hjulstad
 
EM12c Monitoring, Metric Extensions and Performance Pages
EM12c Monitoring, Metric Extensions and Performance PagesEM12c Monitoring, Metric Extensions and Performance Pages
EM12c Monitoring, Metric Extensions and Performance Pages
Enkitec
 
Oracle Enterprise Manager 12c - OEM12c Presentation
Oracle Enterprise Manager 12c - OEM12c PresentationOracle Enterprise Manager 12c - OEM12c Presentation
Oracle Enterprise Manager 12c - OEM12c Presentation
Francisco Alvarez
 
Oracle Enterprise Manager Cloud Control 13c for DBAs
Oracle Enterprise Manager Cloud Control 13c for DBAsOracle Enterprise Manager Cloud Control 13c for DBAs
Oracle Enterprise Manager Cloud Control 13c for DBAs
Gokhan Atil
 
Getting optimal performance from oracle e business suite(aioug aug2015)
Getting optimal performance from oracle e business suite(aioug aug2015)Getting optimal performance from oracle e business suite(aioug aug2015)
Getting optimal performance from oracle e business suite(aioug aug2015)
pasalapudi123
 
Apouc 2014-enterprise-manager-12c
Apouc 2014-enterprise-manager-12cApouc 2014-enterprise-manager-12c
Apouc 2014-enterprise-manager-12c
OUGTH Oracle User Group in Thailand
 
Solr Consistency and Recovery Internals - Mano Kovacs, Cloudera
Solr Consistency and Recovery Internals - Mano Kovacs, ClouderaSolr Consistency and Recovery Internals - Mano Kovacs, Cloudera
Solr Consistency and Recovery Internals - Mano Kovacs, Cloudera
Lucidworks
 
Windows 7 Feature Overview It Academic Day 2009
Windows 7 Feature Overview   It Academic Day 2009Windows 7 Feature Overview   It Academic Day 2009
Windows 7 Feature Overview It Academic Day 2009
Tobias Koprowski
 
MySQL High Availibility Solutions
MySQL High Availibility SolutionsMySQL High Availibility Solutions
MySQL High Availibility Solutions
Mark Swarbrick
 
DB12c: All You Need to Know About the Resource Manager
DB12c: All You Need to Know About the Resource ManagerDB12c: All You Need to Know About the Resource Manager
DB12c: All You Need to Know About the Resource Manager
Maris Elsins
 
AWR, ASH with EM13 at HotSos 2016
AWR, ASH with EM13 at HotSos 2016AWR, ASH with EM13 at HotSos 2016
AWR, ASH with EM13 at HotSos 2016
Kellyn Pot'Vin-Gorman
 
Aioug ha day oct2015 goldengate- High Availability Day 2015
Aioug ha day oct2015 goldengate- High Availability Day 2015Aioug ha day oct2015 goldengate- High Availability Day 2015
Aioug ha day oct2015 goldengate- High Availability Day 2015
aioughydchapter
 
Getting optimal performance from oracle e-business suite presentation
Getting optimal performance from oracle e-business suite presentationGetting optimal performance from oracle e-business suite presentation
Getting optimal performance from oracle e-business suite presentation
Berry Clemens
 
MySQL 5.7 - What's new, How to upgrade and Document Store
MySQL 5.7 - What's new, How to upgrade and Document StoreMySQL 5.7 - What's new, How to upgrade and Document Store
MySQL 5.7 - What's new, How to upgrade and Document Store
Abel Flórez
 
Protect Sensitive Data: Implementing Fine-Grained Access Control in Oracle
Protect Sensitive Data: Implementing Fine-Grained Access Control in OracleProtect Sensitive Data: Implementing Fine-Grained Access Control in Oracle
Protect Sensitive Data: Implementing Fine-Grained Access Control in Oracle
Nelson Calero
 
MySQL Enterprise Monitor
MySQL Enterprise MonitorMySQL Enterprise Monitor
MySQL Enterprise Monitor
Ted Wennmark
 
Advanced Database Administration 10g
Advanced Database Administration 10gAdvanced Database Administration 10g
Advanced Database Administration 10g
Connor McDonald
 
MySQL Enterprise Portfolio
MySQL Enterprise PortfolioMySQL Enterprise Portfolio
MySQL Enterprise Portfolio
Abel Flórez
 
20141011 my sql clusterv01pptx
20141011 my sql clusterv01pptx20141011 my sql clusterv01pptx
20141011 my sql clusterv01pptx
Ivan Ma
 

What's hot (20)

Mining the AWR: Alternative Methods for Identification of the Top SQLs (inclu...
Mining the AWR: Alternative Methods for Identification of the Top SQLs (inclu...Mining the AWR: Alternative Methods for Identification of the Top SQLs (inclu...
Mining the AWR: Alternative Methods for Identification of the Top SQLs (inclu...
 
SOA Suite Administration from OUGN 2014
SOA Suite Administration from OUGN 2014SOA Suite Administration from OUGN 2014
SOA Suite Administration from OUGN 2014
 
EM12c Monitoring, Metric Extensions and Performance Pages
EM12c Monitoring, Metric Extensions and Performance PagesEM12c Monitoring, Metric Extensions and Performance Pages
EM12c Monitoring, Metric Extensions and Performance Pages
 
Oracle Enterprise Manager 12c - OEM12c Presentation
Oracle Enterprise Manager 12c - OEM12c PresentationOracle Enterprise Manager 12c - OEM12c Presentation
Oracle Enterprise Manager 12c - OEM12c Presentation
 
Oracle Enterprise Manager Cloud Control 13c for DBAs
Oracle Enterprise Manager Cloud Control 13c for DBAsOracle Enterprise Manager Cloud Control 13c for DBAs
Oracle Enterprise Manager Cloud Control 13c for DBAs
 
Getting optimal performance from oracle e business suite(aioug aug2015)
Getting optimal performance from oracle e business suite(aioug aug2015)Getting optimal performance from oracle e business suite(aioug aug2015)
Getting optimal performance from oracle e business suite(aioug aug2015)
 
Apouc 2014-enterprise-manager-12c
Apouc 2014-enterprise-manager-12cApouc 2014-enterprise-manager-12c
Apouc 2014-enterprise-manager-12c
 
Solr Consistency and Recovery Internals - Mano Kovacs, Cloudera
Solr Consistency and Recovery Internals - Mano Kovacs, ClouderaSolr Consistency and Recovery Internals - Mano Kovacs, Cloudera
Solr Consistency and Recovery Internals - Mano Kovacs, Cloudera
 
Windows 7 Feature Overview It Academic Day 2009
Windows 7 Feature Overview   It Academic Day 2009Windows 7 Feature Overview   It Academic Day 2009
Windows 7 Feature Overview It Academic Day 2009
 
MySQL High Availibility Solutions
MySQL High Availibility SolutionsMySQL High Availibility Solutions
MySQL High Availibility Solutions
 
DB12c: All You Need to Know About the Resource Manager
DB12c: All You Need to Know About the Resource ManagerDB12c: All You Need to Know About the Resource Manager
DB12c: All You Need to Know About the Resource Manager
 
AWR, ASH with EM13 at HotSos 2016
AWR, ASH with EM13 at HotSos 2016AWR, ASH with EM13 at HotSos 2016
AWR, ASH with EM13 at HotSos 2016
 
Aioug ha day oct2015 goldengate- High Availability Day 2015
Aioug ha day oct2015 goldengate- High Availability Day 2015Aioug ha day oct2015 goldengate- High Availability Day 2015
Aioug ha day oct2015 goldengate- High Availability Day 2015
 
Getting optimal performance from oracle e-business suite presentation
Getting optimal performance from oracle e-business suite presentationGetting optimal performance from oracle e-business suite presentation
Getting optimal performance from oracle e-business suite presentation
 
MySQL 5.7 - What's new, How to upgrade and Document Store
MySQL 5.7 - What's new, How to upgrade and Document StoreMySQL 5.7 - What's new, How to upgrade and Document Store
MySQL 5.7 - What's new, How to upgrade and Document Store
 
Protect Sensitive Data: Implementing Fine-Grained Access Control in Oracle
Protect Sensitive Data: Implementing Fine-Grained Access Control in OracleProtect Sensitive Data: Implementing Fine-Grained Access Control in Oracle
Protect Sensitive Data: Implementing Fine-Grained Access Control in Oracle
 
MySQL Enterprise Monitor
MySQL Enterprise MonitorMySQL Enterprise Monitor
MySQL Enterprise Monitor
 
Advanced Database Administration 10g
Advanced Database Administration 10gAdvanced Database Administration 10g
Advanced Database Administration 10g
 
MySQL Enterprise Portfolio
MySQL Enterprise PortfolioMySQL Enterprise Portfolio
MySQL Enterprise Portfolio
 
20141011 my sql clusterv01pptx
20141011 my sql clusterv01pptx20141011 my sql clusterv01pptx
20141011 my sql clusterv01pptx
 

Viewers also liked

Double the Performance of Oracle SOA Suite 11g? Absolutely!
Double the Performance of Oracle SOA Suite 11g? Absolutely!Double the Performance of Oracle SOA Suite 11g? Absolutely!
Double the Performance of Oracle SOA Suite 11g? Absolutely!
Revelation Technologies
 
Top 10 tips for Oracle performance (Updated April 2015)
Top 10 tips for Oracle performance (Updated April 2015)Top 10 tips for Oracle performance (Updated April 2015)
Top 10 tips for Oracle performance (Updated April 2015)
Guy Harrison
 
Ebs performance tuning session feb 13 2013---Presented by Oracle
Ebs performance tuning session  feb 13 2013---Presented by OracleEbs performance tuning session  feb 13 2013---Presented by Oracle
Ebs performance tuning session feb 13 2013---Presented by Oracle
Akash Pramanik
 
How to find what is making your Oracle database slow
How to find what is making your Oracle database slowHow to find what is making your Oracle database slow
How to find what is making your Oracle database slow
SolarWinds
 
Oracle Performance Tuning Fundamentals
Oracle Performance Tuning FundamentalsOracle Performance Tuning Fundamentals
Oracle Performance Tuning Fundamentals
Enkitec
 
Monitoring and Tuning Oracle FMW 11g
Monitoring and Tuning Oracle FMW 11gMonitoring and Tuning Oracle FMW 11g
Monitoring and Tuning Oracle FMW 11g
Matthias Furrer
 
Oracle R12 EBS Performance Tuning
Oracle R12 EBS Performance TuningOracle R12 EBS Performance Tuning
Oracle R12 EBS Performance Tuning
Scott Jenner
 
Exploring Oracle Database Performance Tuning Best Practices for DBAs and Deve...
Exploring Oracle Database Performance Tuning Best Practices for DBAs and Deve...Exploring Oracle Database Performance Tuning Best Practices for DBAs and Deve...
Exploring Oracle Database Performance Tuning Best Practices for DBAs and Deve...
Aaron Shilo
 
Oracle Performance Tools of the Trade
Oracle Performance Tools of the TradeOracle Performance Tools of the Trade
Oracle Performance Tools of the Trade
Enkitec
 
OOW15 - Getting Optimal Performance from Oracle E-Business Suite
OOW15 - Getting Optimal Performance from Oracle E-Business SuiteOOW15 - Getting Optimal Performance from Oracle E-Business Suite
OOW15 - Getting Optimal Performance from Oracle E-Business Suite
vasuballa
 
Performance in the Oracle Cloud
Performance in the Oracle CloudPerformance in the Oracle Cloud
Performance in the Oracle Cloud
Kellyn Pot'Vin-Gorman
 
Oracle performance tuning
Oracle performance tuningOracle performance tuning
Oracle performance tuning
vksgarg
 

Viewers also liked (12)

Double the Performance of Oracle SOA Suite 11g? Absolutely!
Double the Performance of Oracle SOA Suite 11g? Absolutely!Double the Performance of Oracle SOA Suite 11g? Absolutely!
Double the Performance of Oracle SOA Suite 11g? Absolutely!
 
Top 10 tips for Oracle performance (Updated April 2015)
Top 10 tips for Oracle performance (Updated April 2015)Top 10 tips for Oracle performance (Updated April 2015)
Top 10 tips for Oracle performance (Updated April 2015)
 
Ebs performance tuning session feb 13 2013---Presented by Oracle
Ebs performance tuning session  feb 13 2013---Presented by OracleEbs performance tuning session  feb 13 2013---Presented by Oracle
Ebs performance tuning session feb 13 2013---Presented by Oracle
 
How to find what is making your Oracle database slow
How to find what is making your Oracle database slowHow to find what is making your Oracle database slow
How to find what is making your Oracle database slow
 
Oracle Performance Tuning Fundamentals
Oracle Performance Tuning FundamentalsOracle Performance Tuning Fundamentals
Oracle Performance Tuning Fundamentals
 
Monitoring and Tuning Oracle FMW 11g
Monitoring and Tuning Oracle FMW 11gMonitoring and Tuning Oracle FMW 11g
Monitoring and Tuning Oracle FMW 11g
 
Oracle R12 EBS Performance Tuning
Oracle R12 EBS Performance TuningOracle R12 EBS Performance Tuning
Oracle R12 EBS Performance Tuning
 
Exploring Oracle Database Performance Tuning Best Practices for DBAs and Deve...
Exploring Oracle Database Performance Tuning Best Practices for DBAs and Deve...Exploring Oracle Database Performance Tuning Best Practices for DBAs and Deve...
Exploring Oracle Database Performance Tuning Best Practices for DBAs and Deve...
 
Oracle Performance Tools of the Trade
Oracle Performance Tools of the TradeOracle Performance Tools of the Trade
Oracle Performance Tools of the Trade
 
OOW15 - Getting Optimal Performance from Oracle E-Business Suite
OOW15 - Getting Optimal Performance from Oracle E-Business SuiteOOW15 - Getting Optimal Performance from Oracle E-Business Suite
OOW15 - Getting Optimal Performance from Oracle E-Business Suite
 
Performance in the Oracle Cloud
Performance in the Oracle CloudPerformance in the Oracle Cloud
Performance in the Oracle Cloud
 
Oracle performance tuning
Oracle performance tuningOracle performance tuning
Oracle performance tuning
 

Similar to Stop the Chaos! Get Real Oracle Performance by Query Tuning Part 2

Beginners guide to_optimizer
Beginners guide to_optimizerBeginners guide to_optimizer
Beginners guide to_optimizer
Maria Colgan
 
Workshop on Advanced Design Patterns for Amazon DynamoDB - DAT405 - re:Invent...
Workshop on Advanced Design Patterns for Amazon DynamoDB - DAT405 - re:Invent...Workshop on Advanced Design Patterns for Amazon DynamoDB - DAT405 - re:Invent...
Workshop on Advanced Design Patterns for Amazon DynamoDB - DAT405 - re:Invent...
Amazon Web Services
 
Boosting the Performance of your Rails Apps
Boosting the Performance of your Rails AppsBoosting the Performance of your Rails Apps
Boosting the Performance of your Rails Apps
Matt Kuklinski
 
Microsoft SQL Server Query Tuning
Microsoft SQL Server Query TuningMicrosoft SQL Server Query Tuning
Microsoft SQL Server Query Tuning
Mark Ginnebaugh
 
Ebs dba con4696_pdf_4696_0001
Ebs dba con4696_pdf_4696_0001Ebs dba con4696_pdf_4696_0001
Ebs dba con4696_pdf_4696_0001
jucaab
 
The Plan Cache Whisperer - Performance Tuning SQL Server
The Plan Cache Whisperer - Performance Tuning SQL ServerThe Plan Cache Whisperer - Performance Tuning SQL Server
The Plan Cache Whisperer - Performance Tuning SQL Server
Jason Strate
 
SOUG_Deployment__Automation_DB
SOUG_Deployment__Automation_DBSOUG_Deployment__Automation_DB
SOUG_Deployment__Automation_DB
UniFabric
 
22-4_PerformanceTuningUsingtheAdvisorFramework.pdf
22-4_PerformanceTuningUsingtheAdvisorFramework.pdf22-4_PerformanceTuningUsingtheAdvisorFramework.pdf
22-4_PerformanceTuningUsingtheAdvisorFramework.pdf
yishengxi
 
Advanced ASE Performance Tuning Tips
Advanced ASE Performance Tuning Tips Advanced ASE Performance Tuning Tips
Advanced ASE Performance Tuning Tips
SAP Technology
 
Getting the most out of your Oracle 12.2 Optimizer (i.e. The Brain)
Getting the most out of your Oracle 12.2 Optimizer (i.e. The Brain)Getting the most out of your Oracle 12.2 Optimizer (i.e. The Brain)
Getting the most out of your Oracle 12.2 Optimizer (i.e. The Brain)
SolarWinds
 
Migration to ClickHouse. Practical guide, by Alexander Zaitsev
Migration to ClickHouse. Practical guide, by Alexander ZaitsevMigration to ClickHouse. Practical guide, by Alexander Zaitsev
Migration to ClickHouse. Practical guide, by Alexander Zaitsev
Altinity Ltd
 
AWS re:Invent 2016| DAT318 | Migrating from RDBMS to NoSQL: How Sony Moved fr...
AWS re:Invent 2016| DAT318 | Migrating from RDBMS to NoSQL: How Sony Moved fr...AWS re:Invent 2016| DAT318 | Migrating from RDBMS to NoSQL: How Sony Moved fr...
AWS re:Invent 2016| DAT318 | Migrating from RDBMS to NoSQL: How Sony Moved fr...
Amazon Web Services
 
KoprowskiT_SQLSaturday409_MaintenancePlansForBeginners
KoprowskiT_SQLSaturday409_MaintenancePlansForBeginnersKoprowskiT_SQLSaturday409_MaintenancePlansForBeginners
KoprowskiT_SQLSaturday409_MaintenancePlansForBeginners
Tobias Koprowski
 
KoprowskiT_SQLSat409_MaintenancePlansForBeginners
KoprowskiT_SQLSat409_MaintenancePlansForBeginnersKoprowskiT_SQLSat409_MaintenancePlansForBeginners
KoprowskiT_SQLSat409_MaintenancePlansForBeginners
Tobias Koprowski
 
How to analyze and tune sql queries for better performance
How to analyze and tune sql queries for better performanceHow to analyze and tune sql queries for better performance
How to analyze and tune sql queries for better performance
oysteing
 
Reduce SRE Stress: Minimizing Service Downtime with Grafana, InfluxDB and Tel...
Reduce SRE Stress: Minimizing Service Downtime with Grafana, InfluxDB and Tel...Reduce SRE Stress: Minimizing Service Downtime with Grafana, InfluxDB and Tel...
Reduce SRE Stress: Minimizing Service Downtime with Grafana, InfluxDB and Tel...
InfluxData
 
6 tips for improving ruby performance
6 tips for improving ruby performance6 tips for improving ruby performance
6 tips for improving ruby performance
Engine Yard
 
Dr Elephant: LinkedIn's Self-Service System for Detecting and Treating Hadoop...
Dr Elephant: LinkedIn's Self-Service System for Detecting and Treating Hadoop...Dr Elephant: LinkedIn's Self-Service System for Detecting and Treating Hadoop...
Dr Elephant: LinkedIn's Self-Service System for Detecting and Treating Hadoop...
DataWorks Summit
 
Introducing Postgres Plus Advanced Server 9.4
Introducing Postgres Plus Advanced Server 9.4 Introducing Postgres Plus Advanced Server 9.4
Introducing Postgres Plus Advanced Server 9.4
EDB
 
Welcome To The 2016 Query Store!
Welcome To The 2016 Query Store!Welcome To The 2016 Query Store!
Welcome To The 2016 Query Store!
SolarWinds
 

Similar to Stop the Chaos! Get Real Oracle Performance by Query Tuning Part 2 (20)

Beginners guide to_optimizer
Beginners guide to_optimizerBeginners guide to_optimizer
Beginners guide to_optimizer
 
Workshop on Advanced Design Patterns for Amazon DynamoDB - DAT405 - re:Invent...
Workshop on Advanced Design Patterns for Amazon DynamoDB - DAT405 - re:Invent...Workshop on Advanced Design Patterns for Amazon DynamoDB - DAT405 - re:Invent...
Workshop on Advanced Design Patterns for Amazon DynamoDB - DAT405 - re:Invent...
 
Boosting the Performance of your Rails Apps
Boosting the Performance of your Rails AppsBoosting the Performance of your Rails Apps
Boosting the Performance of your Rails Apps
 
Microsoft SQL Server Query Tuning
Microsoft SQL Server Query TuningMicrosoft SQL Server Query Tuning
Microsoft SQL Server Query Tuning
 
Ebs dba con4696_pdf_4696_0001
Ebs dba con4696_pdf_4696_0001Ebs dba con4696_pdf_4696_0001
Ebs dba con4696_pdf_4696_0001
 
The Plan Cache Whisperer - Performance Tuning SQL Server
The Plan Cache Whisperer - Performance Tuning SQL ServerThe Plan Cache Whisperer - Performance Tuning SQL Server
The Plan Cache Whisperer - Performance Tuning SQL Server
 
SOUG_Deployment__Automation_DB
SOUG_Deployment__Automation_DBSOUG_Deployment__Automation_DB
SOUG_Deployment__Automation_DB
 
22-4_PerformanceTuningUsingtheAdvisorFramework.pdf
22-4_PerformanceTuningUsingtheAdvisorFramework.pdf22-4_PerformanceTuningUsingtheAdvisorFramework.pdf
22-4_PerformanceTuningUsingtheAdvisorFramework.pdf
 
Advanced ASE Performance Tuning Tips
Advanced ASE Performance Tuning Tips Advanced ASE Performance Tuning Tips
Advanced ASE Performance Tuning Tips
 
Getting the most out of your Oracle 12.2 Optimizer (i.e. The Brain)
Getting the most out of your Oracle 12.2 Optimizer (i.e. The Brain)Getting the most out of your Oracle 12.2 Optimizer (i.e. The Brain)
Getting the most out of your Oracle 12.2 Optimizer (i.e. The Brain)
 
Migration to ClickHouse. Practical guide, by Alexander Zaitsev
Migration to ClickHouse. Practical guide, by Alexander ZaitsevMigration to ClickHouse. Practical guide, by Alexander Zaitsev
Migration to ClickHouse. Practical guide, by Alexander Zaitsev
 
AWS re:Invent 2016| DAT318 | Migrating from RDBMS to NoSQL: How Sony Moved fr...
AWS re:Invent 2016| DAT318 | Migrating from RDBMS to NoSQL: How Sony Moved fr...AWS re:Invent 2016| DAT318 | Migrating from RDBMS to NoSQL: How Sony Moved fr...
AWS re:Invent 2016| DAT318 | Migrating from RDBMS to NoSQL: How Sony Moved fr...
 
KoprowskiT_SQLSaturday409_MaintenancePlansForBeginners
KoprowskiT_SQLSaturday409_MaintenancePlansForBeginnersKoprowskiT_SQLSaturday409_MaintenancePlansForBeginners
KoprowskiT_SQLSaturday409_MaintenancePlansForBeginners
 
KoprowskiT_SQLSat409_MaintenancePlansForBeginners
KoprowskiT_SQLSat409_MaintenancePlansForBeginnersKoprowskiT_SQLSat409_MaintenancePlansForBeginners
KoprowskiT_SQLSat409_MaintenancePlansForBeginners
 
How to analyze and tune sql queries for better performance
How to analyze and tune sql queries for better performanceHow to analyze and tune sql queries for better performance
How to analyze and tune sql queries for better performance
 
Reduce SRE Stress: Minimizing Service Downtime with Grafana, InfluxDB and Tel...
Reduce SRE Stress: Minimizing Service Downtime with Grafana, InfluxDB and Tel...Reduce SRE Stress: Minimizing Service Downtime with Grafana, InfluxDB and Tel...
Reduce SRE Stress: Minimizing Service Downtime with Grafana, InfluxDB and Tel...
 
6 tips for improving ruby performance
6 tips for improving ruby performance6 tips for improving ruby performance
6 tips for improving ruby performance
 
Dr Elephant: LinkedIn's Self-Service System for Detecting and Treating Hadoop...
Dr Elephant: LinkedIn's Self-Service System for Detecting and Treating Hadoop...Dr Elephant: LinkedIn's Self-Service System for Detecting and Treating Hadoop...
Dr Elephant: LinkedIn's Self-Service System for Detecting and Treating Hadoop...
 
Introducing Postgres Plus Advanced Server 9.4
Introducing Postgres Plus Advanced Server 9.4 Introducing Postgres Plus Advanced Server 9.4
Introducing Postgres Plus Advanced Server 9.4
 
Welcome To The 2016 Query Store!
Welcome To The 2016 Query Store!Welcome To The 2016 Query Store!
Welcome To The 2016 Query Store!
 

More from SolarWinds

SolarWinds Government and Education Webinar: Greatest SolarWinds Features I N...
SolarWinds Government and Education Webinar: Greatest SolarWinds Features I N...SolarWinds Government and Education Webinar: Greatest SolarWinds Features I N...
SolarWinds Government and Education Webinar: Greatest SolarWinds Features I N...
SolarWinds
 
SolarWinds Government and Education Webinar: Gaps Exist in Your Monitoring In...
SolarWinds Government and Education Webinar: Gaps Exist in Your Monitoring In...SolarWinds Government and Education Webinar: Gaps Exist in Your Monitoring In...
SolarWinds Government and Education Webinar: Gaps Exist in Your Monitoring In...
SolarWinds
 
Government Webinar: Alerting and Reporting in the Age of Observability
Government Webinar: Alerting and Reporting in the Age of ObservabilityGovernment Webinar: Alerting and Reporting in the Age of Observability
Government Webinar: Alerting and Reporting in the Age of Observability
SolarWinds
 
Government and Education Webinar: Full Stack Observability
Government and Education Webinar: Full Stack ObservabilityGovernment and Education Webinar: Full Stack Observability
Government and Education Webinar: Full Stack Observability
SolarWinds
 
Government and Education Webinar: Public Sector Cybersecurity Survey - What I...
Government and Education Webinar: Public Sector Cybersecurity Survey - What I...Government and Education Webinar: Public Sector Cybersecurity Survey - What I...
Government and Education Webinar: Public Sector Cybersecurity Survey - What I...
SolarWinds
 
Becoming Secure By Design: Questions You Should Ask Your Software Vendors
Becoming Secure By Design: Questions You Should Ask Your Software VendorsBecoming Secure By Design: Questions You Should Ask Your Software Vendors
Becoming Secure By Design: Questions You Should Ask Your Software Vendors
SolarWinds
 
Government and Education Webinar: Real-Time Mission, CIO, and Command Dashboards
Government and Education Webinar: Real-Time Mission, CIO, and Command DashboardsGovernment and Education Webinar: Real-Time Mission, CIO, and Command Dashboards
Government and Education Webinar: Real-Time Mission, CIO, and Command Dashboards
SolarWinds
 
Government and Education Webinar: Simplify Your Database Performance Manageme...
Government and Education Webinar: Simplify Your Database Performance Manageme...Government and Education Webinar: Simplify Your Database Performance Manageme...
Government and Education Webinar: Simplify Your Database Performance Manageme...
SolarWinds
 
Government and Education Webinar: SolarWinds Orion Platform: Audit and Stream...
Government and Education Webinar: SolarWinds Orion Platform: Audit and Stream...Government and Education Webinar: SolarWinds Orion Platform: Audit and Stream...
Government and Education Webinar: SolarWinds Orion Platform: Audit and Stream...
SolarWinds
 
Government and Education Webinar: Leverage Automation to Improve IT Operations
Government and Education Webinar: Leverage Automation to Improve IT OperationsGovernment and Education Webinar: Leverage Automation to Improve IT Operations
Government and Education Webinar: Leverage Automation to Improve IT Operations
SolarWinds
 
Government and Education Webinar: Improving Application Performance
Government and Education Webinar: Improving Application PerformanceGovernment and Education Webinar: Improving Application Performance
Government and Education Webinar: Improving Application Performance
SolarWinds
 
Government and Education: IT Tools to Support Your Hybrid Workforce
Government and Education: IT Tools to Support Your Hybrid WorkforceGovernment and Education: IT Tools to Support Your Hybrid Workforce
Government and Education: IT Tools to Support Your Hybrid Workforce
SolarWinds
 
Government and Education Webinar: There's More Than One Way to Monitor SQL Da...
Government and Education Webinar: There's More Than One Way to Monitor SQL Da...Government and Education Webinar: There's More Than One Way to Monitor SQL Da...
Government and Education Webinar: There's More Than One Way to Monitor SQL Da...
SolarWinds
 
SolarWinds Government and Education Webinar: Virtual Technology Briefing 08.0...
SolarWinds Government and Education Webinar: Virtual Technology Briefing 08.0...SolarWinds Government and Education Webinar: Virtual Technology Briefing 08.0...
SolarWinds Government and Education Webinar: Virtual Technology Briefing 08.0...
SolarWinds
 
Government and Education Webinar: Zero-Trust Panel Discussion
Government and Education Webinar: Zero-Trust Panel Discussion Government and Education Webinar: Zero-Trust Panel Discussion
Government and Education Webinar: Zero-Trust Panel Discussion
SolarWinds
 
Government and Education: Leveraging The SolarWinds Orion Assistance Program ...
Government and Education: Leveraging The SolarWinds Orion Assistance Program ...Government and Education: Leveraging The SolarWinds Orion Assistance Program ...
Government and Education: Leveraging The SolarWinds Orion Assistance Program ...
SolarWinds
 
Government and Education Webinar: SQL Server—Advanced Performance Tuning
Government and Education Webinar: SQL Server—Advanced Performance Tuning Government and Education Webinar: SQL Server—Advanced Performance Tuning
Government and Education Webinar: SQL Server—Advanced Performance Tuning
SolarWinds
 
Government and Education Webinar: Recovering IP Addresses on Your Network
Government and Education Webinar: Recovering IP Addresses on Your NetworkGovernment and Education Webinar: Recovering IP Addresses on Your Network
Government and Education Webinar: Recovering IP Addresses on Your Network
SolarWinds
 
Government and Education Webinar: Optimize Performance With Advanced Host Mon...
Government and Education Webinar: Optimize Performance With Advanced Host Mon...Government and Education Webinar: Optimize Performance With Advanced Host Mon...
Government and Education Webinar: Optimize Performance With Advanced Host Mon...
SolarWinds
 
Government and Education Webinar: Conquering Remote Work IT Challenges
Government and Education Webinar: Conquering Remote Work IT Challenges Government and Education Webinar: Conquering Remote Work IT Challenges
Government and Education Webinar: Conquering Remote Work IT Challenges
SolarWinds
 

More from SolarWinds (20)

SolarWinds Government and Education Webinar: Greatest SolarWinds Features I N...
SolarWinds Government and Education Webinar: Greatest SolarWinds Features I N...SolarWinds Government and Education Webinar: Greatest SolarWinds Features I N...
SolarWinds Government and Education Webinar: Greatest SolarWinds Features I N...
 
SolarWinds Government and Education Webinar: Gaps Exist in Your Monitoring In...
SolarWinds Government and Education Webinar: Gaps Exist in Your Monitoring In...SolarWinds Government and Education Webinar: Gaps Exist in Your Monitoring In...
SolarWinds Government and Education Webinar: Gaps Exist in Your Monitoring In...
 
Government Webinar: Alerting and Reporting in the Age of Observability
Government Webinar: Alerting and Reporting in the Age of ObservabilityGovernment Webinar: Alerting and Reporting in the Age of Observability
Government Webinar: Alerting and Reporting in the Age of Observability
 
Government and Education Webinar: Full Stack Observability
Government and Education Webinar: Full Stack ObservabilityGovernment and Education Webinar: Full Stack Observability
Government and Education Webinar: Full Stack Observability
 
Government and Education Webinar: Public Sector Cybersecurity Survey - What I...
Government and Education Webinar: Public Sector Cybersecurity Survey - What I...Government and Education Webinar: Public Sector Cybersecurity Survey - What I...
Government and Education Webinar: Public Sector Cybersecurity Survey - What I...
 
Becoming Secure By Design: Questions You Should Ask Your Software Vendors
Becoming Secure By Design: Questions You Should Ask Your Software VendorsBecoming Secure By Design: Questions You Should Ask Your Software Vendors
Becoming Secure By Design: Questions You Should Ask Your Software Vendors
 
Government and Education Webinar: Real-Time Mission, CIO, and Command Dashboards
Government and Education Webinar: Real-Time Mission, CIO, and Command DashboardsGovernment and Education Webinar: Real-Time Mission, CIO, and Command Dashboards
Government and Education Webinar: Real-Time Mission, CIO, and Command Dashboards
 
Government and Education Webinar: Simplify Your Database Performance Manageme...
Government and Education Webinar: Simplify Your Database Performance Manageme...Government and Education Webinar: Simplify Your Database Performance Manageme...
Government and Education Webinar: Simplify Your Database Performance Manageme...
 
Government and Education Webinar: SolarWinds Orion Platform: Audit and Stream...
Government and Education Webinar: SolarWinds Orion Platform: Audit and Stream...Government and Education Webinar: SolarWinds Orion Platform: Audit and Stream...
Government and Education Webinar: SolarWinds Orion Platform: Audit and Stream...
 
Government and Education Webinar: Leverage Automation to Improve IT Operations
Government and Education Webinar: Leverage Automation to Improve IT OperationsGovernment and Education Webinar: Leverage Automation to Improve IT Operations
Government and Education Webinar: Leverage Automation to Improve IT Operations
 
Government and Education Webinar: Improving Application Performance
Government and Education Webinar: Improving Application PerformanceGovernment and Education Webinar: Improving Application Performance
Government and Education Webinar: Improving Application Performance
 
Government and Education: IT Tools to Support Your Hybrid Workforce
Government and Education: IT Tools to Support Your Hybrid WorkforceGovernment and Education: IT Tools to Support Your Hybrid Workforce
Government and Education: IT Tools to Support Your Hybrid Workforce
 
Government and Education Webinar: There's More Than One Way to Monitor SQL Da...
Government and Education Webinar: There's More Than One Way to Monitor SQL Da...Government and Education Webinar: There's More Than One Way to Monitor SQL Da...
Government and Education Webinar: There's More Than One Way to Monitor SQL Da...
 
SolarWinds Government and Education Webinar: Virtual Technology Briefing 08.0...
SolarWinds Government and Education Webinar: Virtual Technology Briefing 08.0...SolarWinds Government and Education Webinar: Virtual Technology Briefing 08.0...
SolarWinds Government and Education Webinar: Virtual Technology Briefing 08.0...
 
Government and Education Webinar: Zero-Trust Panel Discussion
Government and Education Webinar: Zero-Trust Panel Discussion Government and Education Webinar: Zero-Trust Panel Discussion
Government and Education Webinar: Zero-Trust Panel Discussion
 
Government and Education: Leveraging The SolarWinds Orion Assistance Program ...
Government and Education: Leveraging The SolarWinds Orion Assistance Program ...Government and Education: Leveraging The SolarWinds Orion Assistance Program ...
Government and Education: Leveraging The SolarWinds Orion Assistance Program ...
 
Government and Education Webinar: SQL Server—Advanced Performance Tuning
Government and Education Webinar: SQL Server—Advanced Performance Tuning Government and Education Webinar: SQL Server—Advanced Performance Tuning
Government and Education Webinar: SQL Server—Advanced Performance Tuning
 
Government and Education Webinar: Recovering IP Addresses on Your Network
Government and Education Webinar: Recovering IP Addresses on Your NetworkGovernment and Education Webinar: Recovering IP Addresses on Your Network
Government and Education Webinar: Recovering IP Addresses on Your Network
 
Government and Education Webinar: Optimize Performance With Advanced Host Mon...
Government and Education Webinar: Optimize Performance With Advanced Host Mon...Government and Education Webinar: Optimize Performance With Advanced Host Mon...
Government and Education Webinar: Optimize Performance With Advanced Host Mon...
 
Government and Education Webinar: Conquering Remote Work IT Challenges
Government and Education Webinar: Conquering Remote Work IT Challenges Government and Education Webinar: Conquering Remote Work IT Challenges
Government and Education Webinar: Conquering Remote Work IT Challenges
 

Recently uploaded

Freshworks Rethinks NoSQL for Rapid Scaling & Cost-Efficiency
Freshworks Rethinks NoSQL for Rapid Scaling & Cost-EfficiencyFreshworks Rethinks NoSQL for Rapid Scaling & Cost-Efficiency
Freshworks Rethinks NoSQL for Rapid Scaling & Cost-Efficiency
ScyllaDB
 
5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides
DanBrown980551
 
“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...
“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...
“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...
Edge AI and Vision Alliance
 
Monitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdfMonitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdf
Tosin Akinosho
 
Choosing The Best AWS Service For Your Website + API.pptx
Choosing The Best AWS Service For Your Website + API.pptxChoosing The Best AWS Service For Your Website + API.pptx
Choosing The Best AWS Service For Your Website + API.pptx
Brandon Minnick, MBA
 
AWS Cloud Cost Optimization Presentation.pptx
AWS Cloud Cost Optimization Presentation.pptxAWS Cloud Cost Optimization Presentation.pptx
AWS Cloud Cost Optimization Presentation.pptx
HarisZaheer8
 
dbms calicut university B. sc Cs 4th sem.pdf
dbms  calicut university B. sc Cs 4th sem.pdfdbms  calicut university B. sc Cs 4th sem.pdf
dbms calicut university B. sc Cs 4th sem.pdf
Shinana2
 
System Design Case Study: Building a Scalable E-Commerce Platform - Hiike
System Design Case Study: Building a Scalable E-Commerce Platform - HiikeSystem Design Case Study: Building a Scalable E-Commerce Platform - Hiike
System Design Case Study: Building a Scalable E-Commerce Platform - Hiike
Hiike
 
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with SlackLet's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
shyamraj55
 
June Patch Tuesday
June Patch TuesdayJune Patch Tuesday
June Patch Tuesday
Ivanti
 
GraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracyGraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracy
Tomaz Bratanic
 
Taking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdfTaking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdf
ssuserfac0301
 
leewayhertz.com-AI in predictive maintenance Use cases technologies benefits ...
leewayhertz.com-AI in predictive maintenance Use cases technologies benefits ...leewayhertz.com-AI in predictive maintenance Use cases technologies benefits ...
leewayhertz.com-AI in predictive maintenance Use cases technologies benefits ...
alexjohnson7307
 
Dandelion Hashtable: beyond billion requests per second on a commodity server
Dandelion Hashtable: beyond billion requests per second on a commodity serverDandelion Hashtable: beyond billion requests per second on a commodity server
Dandelion Hashtable: beyond billion requests per second on a commodity server
Antonios Katsarakis
 
Skybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoptionSkybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoption
Tatiana Kojar
 
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development ProvidersYour One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
akankshawande
 
Trusted Execution Environment for Decentralized Process Mining
Trusted Execution Environment for Decentralized Process MiningTrusted Execution Environment for Decentralized Process Mining
Trusted Execution Environment for Decentralized Process Mining
LucaBarbaro3
 
Programming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup SlidesProgramming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup Slides
Zilliz
 
Introduction of Cybersecurity with OSS at Code Europe 2024
Introduction of Cybersecurity with OSS  at Code Europe 2024Introduction of Cybersecurity with OSS  at Code Europe 2024
Introduction of Cybersecurity with OSS at Code Europe 2024
Hiroshi SHIBATA
 
Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024
Jason Packer
 

Recently uploaded (20)

Freshworks Rethinks NoSQL for Rapid Scaling & Cost-Efficiency
Freshworks Rethinks NoSQL for Rapid Scaling & Cost-EfficiencyFreshworks Rethinks NoSQL for Rapid Scaling & Cost-Efficiency
Freshworks Rethinks NoSQL for Rapid Scaling & Cost-Efficiency
 
5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides
 
“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...
“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...
“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...
 
Monitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdfMonitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdf
 
Choosing The Best AWS Service For Your Website + API.pptx
Choosing The Best AWS Service For Your Website + API.pptxChoosing The Best AWS Service For Your Website + API.pptx
Choosing The Best AWS Service For Your Website + API.pptx
 
AWS Cloud Cost Optimization Presentation.pptx
AWS Cloud Cost Optimization Presentation.pptxAWS Cloud Cost Optimization Presentation.pptx
AWS Cloud Cost Optimization Presentation.pptx
 
dbms calicut university B. sc Cs 4th sem.pdf
dbms  calicut university B. sc Cs 4th sem.pdfdbms  calicut university B. sc Cs 4th sem.pdf
dbms calicut university B. sc Cs 4th sem.pdf
 
System Design Case Study: Building a Scalable E-Commerce Platform - Hiike
System Design Case Study: Building a Scalable E-Commerce Platform - HiikeSystem Design Case Study: Building a Scalable E-Commerce Platform - Hiike
System Design Case Study: Building a Scalable E-Commerce Platform - Hiike
 
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with SlackLet's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
 
June Patch Tuesday
June Patch TuesdayJune Patch Tuesday
June Patch Tuesday
 
GraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracyGraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracy
 
Taking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdfTaking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdf
 
leewayhertz.com-AI in predictive maintenance Use cases technologies benefits ...
leewayhertz.com-AI in predictive maintenance Use cases technologies benefits ...leewayhertz.com-AI in predictive maintenance Use cases technologies benefits ...
leewayhertz.com-AI in predictive maintenance Use cases technologies benefits ...
 
Dandelion Hashtable: beyond billion requests per second on a commodity server
Dandelion Hashtable: beyond billion requests per second on a commodity serverDandelion Hashtable: beyond billion requests per second on a commodity server
Dandelion Hashtable: beyond billion requests per second on a commodity server
 
Skybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoptionSkybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoption
 
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development ProvidersYour One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
 
Trusted Execution Environment for Decentralized Process Mining
Trusted Execution Environment for Decentralized Process MiningTrusted Execution Environment for Decentralized Process Mining
Trusted Execution Environment for Decentralized Process Mining
 
Programming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup SlidesProgramming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup Slides
 
Introduction of Cybersecurity with OSS at Code Europe 2024
Introduction of Cybersecurity with OSS  at Code Europe 2024Introduction of Cybersecurity with OSS  at Code Europe 2024
Introduction of Cybersecurity with OSS at Code Europe 2024
 
Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024
 

Stop the Chaos! Get Real Oracle Performance by Query Tuning Part 2

  • 1. Stop the Chaos! Get Real Oracle Performance by Query Tuning – Part 2 Janis Griffin Senior DBA / Performance Evangelist
  • 2. © 2017 SolarWinds Worldwide, LLC. All rights reserved. Who am I? • Senior DBA / Performance Evangelist for SolarWinds • Janis.Griffin@solarwinds.com • Twitter® - @DoBoutAnything • Current – 25+ Years in Oracle®, DB2®, ASE, SQL Server®, MySQL® • DBA and Developer • Specialize in performance Tuning • Review database performance for customers and prospects • Common question: “How do I tune it?”
  • 3. © 2017 SolarWinds Worldwide, LLC. All rights reserved. Agenda • A quick review of part 1 • Using wait time analysis (WTA) • Reviewing the execution plan • Understanding the optimizer • Finding the expensive steps • Discuss several tuning techniques • SQL diagramming • Partitioning and other useful features • How to identify coding mistakes • Engineer out the stupid • What to do if you can’t change the code • Third-party applications • Avoiding hints
  • 4. • Who registered yesterday for SQL Tuning? SELECT s.fname, s.lname, r.signup_date FROM student s INNER JOIN registration r ON s.student_id = r.student_id INNER JOIN class c ON r.class_id = c.class_id WHERE c.name = 'SQL TUNING' AND r.signup_date BETWEEN :beg_date AND :end_date AND r.cancelled = 'N‘ • Execution Stats – 21,829 Buffer Gets • Execution Time – 22 seconds to execute • Wait Events – Waits 90% direct path read Case Study for Review User complained. Query spent over 3 hours in the database. © 2017 SolarWinds Worldwide, LLC. All rights reserved.
  • 5. Execution Plan © 2017 SolarWinds Worldwide, LLC. All rights reserved.
  • 6. Relationship Diagram © 2017 SolarWinds Worldwide, LLC. All rights reserved.
  • 7. • Recommends – three new indexes Tuning Advisor DECLARE l_sql_tune_task_id VARCHAR2(100); BEGIN l_sql_tune_task_id := DBMS_SQLTUNE.create_tuning_task ( sql_id => '&sql_id', scope => DBMS_SQLTUNE.scope_comprehensive, time_limit => 60, task_name => '&sql_id', description => 'Tuning task for class registration query'); DBMS_OUTPUT.put_line('l_sql_tune_task_id: ' || l_sql_tune_task_id); END; / EXEC DBMS_SQLTUNE.execute_tuning_task(task_name => '&sql_id'); © 2017 SolarWinds Worldwide, LLC. All rights reserved.
  • 8. • Need to know the size of the actual data sets for each step in execution plan • In Joins (Right, Left, Outer) • What are the filtering predicates? • When is each filtering predicate applied? • Try to filter earlier rather than later • Compare size of final result set with data read • Find the driving table • To reduce buffer gets Tune the Query SELECT s.fname, s.lname, r.signup_date FROM student s INNER JOIN registration r ON s.student_id = r.student_id INNER JOIN class c ON r.class_id = c.class_id WHERE c.name = 'SQL TUNING' AND r.signup_date BETWEEN :beg_date AND :end_date AND r.cancelled = 'N' Joins Filtering Predicates © 2017 SolarWinds Worldwide, LLC. All rights reserved.
  • 9. • “SQL Tuning” by Dan Tow • Great book that teaches SQL Diagramming • http://www.singingsql.com SQL Diagramming registration student class 5 1 30 1 4% .1% select count(1) from registration where cancelled = 'N' and signup_date between '2016-12-10 00:00' and '2016-12-11 00:00' 64112 / 1783066 * 100 = 3.59 or 4% select count(1) from class where name = 'SQL TUNING' 2 / 1,267 * 100 = .1% © 2017 SolarWinds Worldwide, LLC. All rights reserved.
  • 10. © 2017 SolarWinds Worldwide, LLC. All rights reserved. • CREATE INDEX cl_name ON class(name); • Execution Stats – 20,348 buffer gets • Why is a full table scan still occurring on REGISTRATION? New Execution Plan
  • 11. • CLASS_ID not left leading in index • Execution Stats – 20,348 buffer gets • Twice the work to use Primary Key Index on REGISTRATION Review Index Order © 2017 SolarWinds Worldwide, LLC. All rights reserved.
  • 12. © 2017 SolarWinds Worldwide, LLC. All rights reserved. • CREATE INDEX reg_alt ON registration(class_id); • Execution Stats – 3000 Buffer Gets / Average Execs - .008 Secs New Execution Plan
  • 13. © 2017 SolarWinds Worldwide, LLC. All rights reserved. • CREATE INDEX reg_cancel_signup ON registration(cancelled,signup_date); Tuning Advisor Suggested Index Execution Stats: 1107 Buffer Gets Avg Executions: 0.140 Secs
  • 14. © 2017 SolarWinds Worldwide, LLC. All rights reserved. • CREATE INDEX reg_alt ON registration(class_id,signup_date, cancelled); • Execution Stats – 445 Buffer Gets / Average Execs - .002 Secs Better Execution Plan
  • 15. Performance Improved reg_canceled_signup index Average Wait Time per Execution for SQL Statement Class_Registration | CECE_JGRIFFIN-2 January 27, 2015 Daily Time Range: 1:00 PM-10:00 PM © 2017 SolarWinds Worldwide, LLC. All rights reserved.
  • 16. © 2017 SolarWinds Worldwide, LLC. All rights reserved. Case Study – Current Pay Check For Specific Employees SELECT e.first_name, e.last_name, l.region_name FROM emp e INNER JOIN dept d ON e.department_id = d.department_id INNER JOIN loc l ON l.location_id = d.location_id WHERE (e.last_name LIKE :b1) AND e.employee_id IN ( SELECT employee_id FROM wage_pmt w WHERE w.employee_id = e.employee_id AND w.pay_date>= trunc(sysdate)-31);
  • 17. © 2017 SolarWinds Worldwide, LLC. All rights reserved. Wait Time Analysis Almost 100% on PGA memory allocation wait. New wait event in 12.2 – not documented No statistics, Unique indexes Added PKs and Fks
  • 18. © 2017 SolarWinds Worldwide, LLC. All rights reserved. Execution Plan © 2017 SolarWinds Worldwide, LLC. All rights reserved.
  • 19. © 2017 SolarWinds Worldwide, LLC. All rights reserved. Understanding the Underlying Objects
  • 20. ACCEPT SQL_ID CHAR PROMPT 'Enter SQL_ID> ' DECLARE l_sql_tune_task_id VARCHAR2(100); BEGIN l_sql_tune_task_id := DBMS_SQLTUNE.create_tuning_task ( sql_id => '&sql_id', scope => DBMS_SQLTUNE.scope_comprehensive, time_limit => 60, task_name => '&sql_id', description => 'Tuning task for Current Paycheck'); DBMS_OUTPUT.put_line('l_sql_tune_task_id: ' || l_sql_tune_task_id); END; / EXEC DBMS_SQLTUNE.execute_tuning_task(task_name => '&sql_id'); SELECT DBMS_SQLTUNE.report_tuning_task('&sql_id') AS recommendations FROM dual; EXEC DBMS_SQLTUNE.drop_tuning_task('&sql_id'); © 2017 SolarWinds Worldwide, LLC. All rights reserved. Ask the Tuning Advisor No recommendations
  • 21. SQL Diagramming select count(1) from wage_pmt where pay_date >= sysdate – 31 2,184 / 142,708 * 100 = 1.5% select avg(cnt) from (select substr(last_name,1,3), count(*) cnt from emp group by substr(last_name,1,3)) 278.5 / 3,899 * 100 = .7.14% With full last nume = .1% emp dept wage_pmt 975 1 37 1 .7% 2% loc 1 1 .1% © 2017 SolarWinds Worldwide, LLC. All rights reserved.
  • 22. No change? © 2017 SolarWinds Worldwide, LLC. All rights reserved. Add Index on WAGE_PMT(employee_id)
  • 23. © 2017 SolarWinds Worldwide, LLC. All rights reserved. Adjust Index on WAGE_PMT CREATE INDEX idx_emp_date ON wage_pmt (employee_id, pay_date);
  • 24. © 2017 SolarWinds Worldwide, LLC. All rights reserved. Improved Performance Created index IDX_EMP_DATE
  • 25. • FETCH FIRST n ROWS ONLY • Retrieves first rows without scanning everything • Faster than using rownum • OFFSET n ROWS FETCH FIRST n ROWS ONLY • Skip some number of rows • 12.2 Approximate Query Processing • Used for approximate ‘count distinct’ values • And adds percentile aggregation • Allows for faster processing of large data sets • Not exact but usually within 95%+ range • Three new parameters – alter system/session • approx_for_aggregation Default=FALSE • approx_for_count_distinct Default=FALSE • approx_for_percentile Default=NONE © 2017 SolarWinds Worldwide, LLC. All rights reserved. Other Tuning Tips
  • 26. © 2017 SolarWinds Worldwide, LLC. All rights reserved. Approximate SQL Example Without Changing Code Why is it exact? Need to set both
  • 27. • Convert non-partitioned table • To a partitioned table ONLINE • Many new partition options • Automatic Lists • Multi-column Lists • Partitioned external tables • Other maintenance options © 2017 SolarWinds Worldwide, LLC. All rights reserved. New 12.2 Partitioning Features UPDATE INDEXES clause is optional. Indexes with SYS names will be generated if not used.
  • 28. • Look for performance inhibitors • Cursor or row by row processing • Parallel processing • Don’t use in an OLTP environment • Use only when accessing large data sets and additional resources can be allocated • Nested views that use db_links • Abuse of Wild Cards (*) or No Where Clause • Select ONLY those columns in a query which are required. • Extra columns cause more I/O on the database and increase network traffic • Code-based SQL Generators (e.g. Hibernate) • Using functions on indexed columns (SUBSTR, TO_CHAR, UPPER, TRUNC) • Optimizer can’t use the index • Instead move the function to the constant or variable side of equation • Consider creating a function based index • Hard-coded hints Engineer Out the Stupid select… where upper(last_name) = ‘GRIFFIN’ Better way: select … where last_name = upper(:b1); © 2017 SolarWinds Worldwide, LLC. All rights reserved.
  • 29. • Reduce SORT operations as they slow down your queries • Don’t use the UNION operator if you can use UNION ALL • Avoid the DISTINCT keyword if you don’t need it • Ensure the left-leading column of a multi-column index is reference • Otherwise an INDEX SKIP SCAN may occur • Often no better than a FULL TABLE SCAN • Try to avoid Cartesian product queries • Use bind variables instead of literal values • Reduces repeated parsing of the same statement • If using sub-queries, make use of the EXISTS operator when possible • Optimizer will stop with a match and avoid a FULL TABLE SCAN • Try to use an index if less than 5% of the data needs to be accessed • Exception: small table are best accessed through a FULL TABLE SCAN • Consider keeping in memory More Do’s and Don’ts © 2017 SolarWinds Worldwide, LLC. All rights reserved.
  • 30. • Use equi-joins whenever possible • Try not to use ‘not in’, !=, <>, not null, etc. • Optimizer has more choices to choose from • Avoid complex expressions such as NVL(col1,0), TO_DATE(), TO_NUMBER() • They prevent the optimizer from assigning valid cardinality or selectivity estimates • Can affect the overall plan and the join methods • Avoid joining complex views • May instantiate all views to run query against (reading too much data) • Querying views requires all tables from the view to be accessed • If they aren’t required, then don’t use the view • Use the partition key in the ‘WHERE’ clause if querying a partitioned table • Partition pruning will be used to reduce the amount of data read Avoid Common Pitfalls © 2017 SolarWinds Worldwide, LLC. All rights reserved.
  • 31. • If you can hint it, baseline it (per Tom Kyte) • Alternative to using hints • Hints difficult to manage over time • Once added, usually forgotten about • Third-party software – can’t modify code • Example: Merge Join Cartesian > Nested Loop select /* jg */ p.product_name from order_items o, product p where o.unit_price = :b1 and o.quantity > :b2 and o.product_id = p.product_id and p.product_id = :b3; What to Do If You Can't Change the Query select /*+ USE_NL(o p) */ /* jg */ p.product_name from order_items o, product p where o.unit_price = :b1 and o.quantity > :b2 and o.product_id = p.product_id and p.product_id = :b3; © 2017 SolarWinds Worldwide, LLC. All rights reserved.
  • 32. • Create baseline of original plan Alter session set optimizer_capture_sql_plan_baselines = TRUE; • Or dbms_spm.load_plans_from_cursor_cache • Example next slide How to Change the Baseline From cache Baseline © 2017 SolarWinds Worldwide, LLC. All rights reserved.
  • 33. • Manually run hinted query • Hint = /*+ USE_NL(p) +/ Change the Baseline – Cont. Get SQL_ID, Plan hash value from cache Load from cache into baseline © 2017 SolarWinds Worldwide, LLC. All rights reserved.
  • 34. © 2017 SolarWinds Worldwide, LLC. All rights reserved. SELECT c_last, c_first, c_street_1, c_city, c_state, c_zip, c_phone, o_entry_d, d_name, ol_delivery_d, ol_quantity, ol_amount FROM order_line, orders, district, customer, stock WHERE o_id = ol_o_id AND o_c_id=c_id AND s_i_id = ol_i_id AND d_id = ol_d_id AND ol_w_id = :B2 AND ol_d_id = :B4 AND (ol_o_id < :B3 ) AND ol_o_id >= (:B3 - 20) AND s_w_id = :B2 AND s_quantity < :B1 AND d_id = :B4 AND c_last like :B5 ; Another Case Study – Orders by Customer Last Name
  • 35. © 2017 SolarWinds Worldwide, LLC. All rights reserved. Review the Execution Plan select * from table (dbms_xplan.display_cursor(null,null, format=> '+report'));
  • 36. © 2017 SolarWinds Worldwide, LLC. All rights reserved. • Stock: Get Object Information create index stock_idx on stock (s_i_id, s_w_id, s_quantity);
  • 37. © 2017 SolarWinds Worldwide, LLC. All rights reserved. • Orders: Get Object Information Actual Rows = 60,000
  • 38. Find the Driving Table orders stock district 100 1 30 1 .7% .03 select count(*) from order_line where ol_o_id < 200 and ol_o_id >= 200-20; 3941 / 600916 * 100 = .6558% select avg(cnt) from (select c_last, count(*) cnt from customer group by c_last); 20 / 60000 * 100 = .03333% Filter on Stock: 3109 / 283000 * 100 = 1% order_line customer warehouse WHERE o_id = ol_o_id AND o_c_id=c_id AND s_i_id = ol_i_id AND d_id = ol_d_id AND ol_w_id = :B2 AND ol_d_id = :B4 AND (ol_o_id < :B3 ) AND ol_o_id >= (:B3 - 20) AND s_w_id = :B2 AND s_quantity < :B1 AND d_id = :B4 AND c_last like :B5 ; 1 20 1 1 6 60092 10 1% © 2017 SolarWinds Worldwide, LLC. All rights reserved.
  • 39. • create index stock_idx on stock (s_i_id, s_w_id, s_quantity); © 2017 SolarWinds Worldwide, LLC. All rights reserved. Engineer Out the Stupid
  • 40. • create index orders_i2 on orders(o_id,o_c_id, o_entry_d); Add Index on Orders to INCLUDE Customer © 2017 SolarWinds Worldwide, LLC. All rights reserved.
  • 41. © 2017 SolarWinds Worldwide, LLC. All rights reserved. Did Performance Improve? Added Index on Stock Added Index on Orders
  • 42. • Make sure you are tuning the correct query • Use wait time analysis • Understand the execution plan • Focus on the costly steps • Know what the optimizer knows • Try these tuning techniques • SQL diagraming to find the best execution plan • Consider new fetch, approximate and partitioning features • Engineer out the stupid • Be on the lookout for coding mistakes • If you can’t change the code • Try using baselines or patches © 2017 SolarWinds Worldwide, LLC. All rights reserved. Summary
  • 43. • Try Database Performance Analyzer FREE for 14 days • Improve root cause of slow performance • Quickly identify root cause of issues that impact end-user response time • See historical trends over days, months, and years • Understand impact of VMware® performance • Agentless architecture with no dependence on Oracle Packs, installs in minutes © 2017 SolarWinds Worldwide, LLC. All rights reserved. Resolve performance issues quickly - free trial www.solarwinds.com/dpa-download/
  • 44. The SolarWinds, SolarWinds & Design, Orion, and THWACK trademarks are the exclusive property of SolarWinds Worldwide, LLC or its affiliates, are registered with the U.S. Patent and Trademark Office, and may be registered or pending registration in other countries. All other SolarWinds trademarks, service marks, and logos may be common law marks or are registered or pending registration. All other trademarks mentioned herein are used for identification purposes only and are trademarks of (and may be registered trademarks) of their respective companies. Thank You!!!