1 What Are You Waiting For? A Performance Tuning Process Thomas LaRock Senior DBA, Confio Software.

Slides:



Advertisements
Similar presentations
Using the SQL Access Advisor
Advertisements

Numbers Treasure Hunt Following each question, click on the answer. If correct, the next page will load with a graphic first – these can be used to check.
Chapter 13: Query Processing
1 Senn, Information Technology, 3 rd Edition © 2004 Pearson Prentice Hall James A. Senns Information Technology, 3 rd Edition Chapter 7 Enterprise Databases.
1
Feichter_DPG-SYKL03_Bild-01. Feichter_DPG-SYKL03_Bild-02.
© 2008 Pearson Addison Wesley. All rights reserved Chapter Seven Costs.
Copyright © 2003 Pearson Education, Inc. Slide 1 Computer Systems Organization & Architecture Chapters 8-12 John D. Carpinelli.
Chapter 1 The Study of Body Function Image PowerPoint
Copyright © 2011, Elsevier Inc. All rights reserved. Chapter 6 Author: Julia Richards and R. Scott Hawley.
Author: Julia Richards and R. Scott Hawley
1 Copyright © 2013 Elsevier Inc. All rights reserved. Appendix 01.
1 Copyright © 2013 Elsevier Inc. All rights reserved. Chapter 3 CPUs.
UNITED NATIONS Shipment Details Report – January 2006.
1 RA I Sub-Regional Training Seminar on CLIMAT&CLIMAT TEMP Reporting Casablanca, Morocco, 20 – 22 December 2005 Status of observing programmes in RA I.
Jeopardy Q 1 Q 6 Q 11 Q 16 Q 21 Q 2 Q 7 Q 12 Q 17 Q 22 Q 3 Q 8 Q 13
Jeopardy Q 1 Q 6 Q 11 Q 16 Q 21 Q 2 Q 7 Q 12 Q 17 Q 22 Q 3 Q 8 Q 13
Title Subtitle.
Exit a Customer Chapter 8. Exit a Customer 8-2 Objectives Perform exit summary process consisting of the following steps: Review service records Close.
Create an Application Title 1A - Adult Chapter 3.
My Alphabet Book abcdefghijklm nopqrstuvwxyz.
FACTORING ax2 + bx + c Think “unfoil” Work down, Show all steps.
Year 6 mental test 5 second questions
Year 6 mental test 10 second questions
REVIEW: Arthropod ID. 1. Name the subphylum. 2. Name the subphylum. 3. Name the order.
Information Systems Today: Managing in the Digital World
13 Copyright © 2005, Oracle. All rights reserved. Monitoring and Improving Performance.
Database Performance Tuning and Query Optimization
ABC Technology Project
EU market situation for eggs and poultry Management Committee 20 October 2011.
EU Market Situation for Eggs and Poultry Management Committee 21 June 2012.
Bright Futures Guidelines Priorities and Screening Tables
Microsoft Confidential. We look at the world... with our own eyes...
Yong Choi School of Business CSU, Bakersfield
Displaying Data from Multiple Tables
Copyright © The OWASP Foundation Permission is granted to copy, distribute and/or modify this document under the terms of the OWASP License. The OWASP.
2 |SharePoint Saturday New York City
Green Eggs and Ham.
IP Multicast Information management 2 Groep T Leuven – Information department 2/14 Agenda •Why IP Multicast ? •Multicast fundamentals •Intradomain.
VOORBLAD.
8 Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Using Explicit Cursors.
1 Breadth First Search s s Undiscovered Discovered Finished Queue: s Top of queue 2 1 Shortest path from s.
Factor P 16 8(8-5ab) 4(d² + 4) 3rs(2r – s) 15cd(1 + 2cd) 8(4a² + 3b²)
Basel-ICU-Journal Challenge18/20/ Basel-ICU-Journal Challenge8/20/2014.
1..
© 2012 National Heart Foundation of Australia. Slide 2.
LO: Count up to 100 objects by grouping them and counting in 5s 10s and 2s. Mrs Criddle: Westfield Middle School.
Understanding Generalist Practice, 5e, Kirst-Ashman/Hull
Presented by Douglas Greer Creating and Maintaining Business Objects Universes.
DB analyzer utility An overview 1. DB Analyzer An application used to track discrepancies and other reports in Sanchay Post Constantly updated by SDC.
Model and Relationships 6 M 1 M M M M M M M M M M M M M M M M
25 seconds left…...
Subtraction: Adding UP
Januar MDMDFSSMDMDFSSS
Week 1.
Analyzing Genes and Genomes
We will resume in: 25 Minutes.
©Brooks/Cole, 2001 Chapter 12 Derived Types-- Enumerated, Structure and Union.
Essential Cell Biology
Intracellular Compartments and Transport
PSSA Preparation.
Essential Cell Biology
Energy Generation in Mitochondria and Chlorplasts
Use the tools support uses.
The tool that could change everything 1 The Tool that could for Employees Change Everything.
Presentation transcript:

1 What Are You Waiting For? A Performance Tuning Process Thomas LaRock Senior DBA, Confio Software

Who Am I? Database Administrator Ten+ years experience SQL MVP PASS Board of Directors

24 Hours of PASS Join us online on September for 24 hours of free, nonstop SQL Server training Show you how to take better advantage of the SQL Server capabilities already at your fingertips Give you an in-depth look at the hottest SQL and BI topics, including relational database design, performance tuning and troubleshooting, SSIS tips and tricks, data warehousing foundations, and much more… Take your questions directly and answer them live! Register now at 24hours.sqlpass.org

I Wrote A Book!

Do You Have Value? 5

What Are You Measured By? 6

Performance Tuning is Hard! 3-5 Day Classes are typical Cannot be everything to everyone Requires expertise in many areas Takes time Low Priority Where do you begin? 7

What Do People Crave? 8

Same Thing For Adults 9

DMAIC Define Measure Analyze Improve Control 10 Six Sigma Lessons

What Can DMAIC Do For Me? Help you locate bottlenecks Help you resolve bottlenecks Help you become efficient Help you to demonstrate your value 11

DMAIC: Define How are issues defined? What are the challenges you face when trying to define issues? 12

DMAIC: Define Common sources for issues: Benchmarks User experience Business requirements Common challenges: User perception OLTP vs. OLAP Business requirements keep changing 13

DMAIC: Measure What are you measuring? How do you measure? 14

DMAIC: Measure Common measures: Memory CPU Disk I/O Network How are metrics gathered? SQL Trace DMVs 3 rd party tools 15 Roll Your Own

16 DMAIC: Measure Understand the total time a Query spends in Database Measure time while Query executes SQL Server helps by providing Wait Types Focus on End User Response Time

DMAIC: Measure Common Wait Types: ASYNC_NETWORK_IO CXPACKET LATCH_x LOCK_x PAGEIOLATCH_x WRITELOG 17

DMAIC: Analyze Is it a problem? Experience is valued here the most How do you analyze? 18

DMAIC: Analyze 19

DMAIC: Improve How do you make improvements? Where do you look to make changes first? 20

21 Which scenario is worse? SQL Statement 1 Executed 100 times Caused 10 minutes of wait time for end user Waited 90% of time on PAGEIOLATCH_SH SQL Statement 2 Executed 1 time Caused 10 minutes of wait time for end user Waited 90% on LCK_M_X DMAIC: Improve

Where would you begin to improve this? 22 SELECT Top 50 T_ID, T_DTS, ST_NAME, TT_NAME, T_S_SYMB, T_QTY,T_EXEC_NAME, T_CHRG, S_NAME, EX_NAME FROM E_TRADE, E_STATUS_TYPE, E_TRADE_TYPE, E_SECURITY, E_EXCHANGE WHERE T_CA_ID = 490 AND ST_ID = T_ST_ID AND TT_ID = T_TT_ID AND S_SYMB = T_S_SYMB AND EX_ID = S_EX_ID ORDER BY T_DTS desc;

DMAIC: Improve SQL Diagramming Dan Tow 23

DMAIC: Improve When handed a query to build or tune, perform the following 12 steps: 1. List all tables in query 2. Gather rowcounts for each table 3. Find all filters a)WHERE clause b)JOIN clause 4. Calculate the selectivity 24

DMAIC: Improve 25 OrdersDetailsCustomers 19k rows31k rows121k rows Need 3k rows Need 12k rows Need 18k rows selectivity selectivity selectivity

DMAIC: Improve Next Steps: 5. Gather info on additional columns used 6. Gather info on existing keys and indexes 7. Examine the execution plan a)SET STATISTICS IO ON b)SET STATISTICS TIME ON c)DBCC DROPCLEANBUFFERS 8. Record results 26

DMAIC: Improve Demo script: 27 SELECT c.CustomerID, soh.ShipDate FROM Sales.SalesOrderDetail sod INNER JOIN Sales.SalesOrderHeader soh ON sod.SalesOrderID = soh.SalesOrderID INNER JOIN Sales.Customer c ON c.CustomerID = soh.CustomerID WHERE sod.SpecialOfferID = 2 AND soh.ShipDate between ' :00:00.000' and ' :00:00.000' AND c.CustomerType = 'I'

DMAIC: Improve 9. Adjust indexes for table with lowest selectivity first 10. Re-run query and examine results and execution plans 11. Repeat on next lowest selectivity table 12. Continue on, reducing your logical and physical reads WARNING: Adding additional indexes is not always the right thing to do! Compare volume of other DUI statements! 28

DMAIC: Control Run the same measures again! 29

Now What? 30

Show Your Value! You can track your progress Note significant improvements Create Top Ten lists Provide weekly summaries Note success for high-profile projects Ask for a raise/promotion/training Explain what do you do here? 31

What Are You Waiting For? Get your definitions Get your measures in place Start analyzing Suggest improvements Control reports Rinse, lather, repeat 32

For More Information

Questions? 34 ?