Download presentation
Presentation is loading. Please wait.
Published byFanny Veenstra Modified over 6 years ago
1
Optimizing SQL Performance with BMC SQL Performance for DB2 Introduction and Technical Update
9/20/2018
2
SQL Performance The Business Problem
The most challenging problem in DB2 shops today Direct impact on meeting service level objectives Direct impact on cost of ownership for the IT organization What makes it difficult? Dynamic Application Workloads More and more dynamic SQL coming from distributed connections SQL coding quality and validation Why is this an even bigger deal today? IT Dynamics driving the problem Trending toward more dynamic SQL = less control Outsourced application development Less staff People and experience to handle what is a complex task 9/20/2018 ©2005 BMC Software
3
Analyzing and Tuning Your SQL - Sources of Information
Atomic SQL SQL Workload Focus on individual SQL statements Do they meet “best practice” coding standards Do they use expected/accepted DB2 access paths Do they deliver desired result set in acceptable time with acceptable resource consumption Developed and tested in controlled environment More predictive in nature Focus on workload dynamics How does concurrent execution affect response time/resource consumption Does this SQL statement/program collide with other transactions Real world unpredictability comes into play More focus on measuring the workload and rapidly reacting 9/20/2018 ©2005 BMC Software
4
SQL Performance for DB2 The BMC Solution
Solution Objectives Control or eliminate poorly performing SQL code SQL performance problems identified and solved quickly Proactive identification of inefficient SQL Solution Components APPTUNE captures and analyzes SQL execution metrics SQL Explorer is the SQL analysis tool that extends far beyond the DB2 Explain Index Analysis Component provides specific features for effectively managing DB2 indexes Common Explain available in solution and point products SQL Performance for DB2 Data Collector APPTUNE for DB2 SQL Explorer for DB2 Index Component 9/20/2018 ©2005 BMC Software
5
SQL Performance for DB2 Solution Architecture
This diagram illustrates the APPTUNE products major components: Data Collector Online Reports Batch Reports Administration The following slides describe each of the major components in more detail.
6
SQL Performance for DB2 Starting at the /top
Key points DB2 subsystems across your enterprise on a single screen DB2s with highest elapsed times bubble to the top (generally the best place to start) Results can be sorted on different field on display (getpages or CPU for example) with simple command Drilldowns aplenty Numerous drilldowns will take you into detail organized to your interest ASQEQRPW/P View a Report LINE 1 OF 7 Command ====> _______________________________________________ Scroll ===> CSR_ BMCSftwr.SQMCACTS SUBSYSTEM ANALYSIS (DATA) /27 14:36:58 Source : V52A-ACTIVE Intvl : 08/27 00:00 - UNLIMITED More: > Actions: G-AppGrps R-Programs C-ConnID T-Detail A-Averages O-Object P-Plans U-Users S-Stmts E-SQL Errors L-CorrID Actions for SAP systems: V-Server N-Work Process Number I-Work Process ID AppGrp: User: ConnID: Plan: CorrID: Program: Stmt No: SQL Total IN-SQL Time S DB2 SSID MVS ID Calls Elapsed % CPU % Getpage Numb + DFH1 (8.1) SYSM K 01: % 00: % + DFG1 (7.1) SYSO : % 00: % Poor performance at the subsystem level 9/20/2018 ©2005 BMC Software
7
Which statement is using the most resources?
Key points Top SQL statements in terms of total elapsed time sorted to top Dynamic and Static SQL visible Numerous drilldowns for additional detail SQL Text Objects Accessed Top three statements are using 90% of the CPU S “S” again to see the SQL text 9/20/2018 ©2005 BMC Software
8
“X” will invoke the common Explain function
Here’s the SQL Key points Provides extensive SQL statement execution detail on elapsed time, getpage activity, BP usage, lock events and CPU consumption You can launch directly into a full-function explain from the common Explain function “X” will invoke the common Explain function X 9/20/2018 ©2005 BMC Software
9
Let’s Explain the statement
9/20/2018 ©2005 BMC Software
10
Which DB2 Objects Are Used by this Statement?
9/20/2018 ©2005 BMC Software
11
APPTUNE for DB2 As a Troubleshooting Tool
Current transaction problem ? Subsystem Thread Locking contention Do you have Distributed Applications? Do you need to identify the transaction by Workstation? Need a way to report on application SQL errors? 9/20/2018 ©2005 BMC Software
12
APPTUNE for DB2 Active Threads Running …
9/20/2018 ©2005 BMC Software
13
SQL Error Analysis report
9/20/2018 ©2005 BMC Software
14
SQL Explorer for DB2 Explain function Online interactive tool Batch
See detail when you want to see it on statistics, predicates, access path, objects Customize the layout of the data the way you want to see it Get advice and tips from Explain rules See visual comparison from editing SQL and re-explaining See visual comparison of dynamic explain and BIND with EXPLAIN(YES) Solution password enables Index Component analysis on cloned objects: Add one or more indexes Drop one of more indexes Update statistics on one or more indexes Batch See summary and detail explain information for many packages, collection IDs, or plans. Explain objects in batch and save to product history tables to be used in Compare 9/20/2018 ©2005 BMC Software
15
BMC Common Explain A Little More Detail
Predicate Information 9/20/2018 ©2005 BMC Software
16
SQL Explorer for DB2 Additional Functionality
Compare Access Paths from two points in time Compares on SQL Text, not statement number Sets return code 8 if access path got worse Shows differences in statistics that were used at the time of the Explain Mismatch Analysis Reports mismatches in data type or length that can affect access paths Now incorporated into Explain Predicate report Impact Analysis Find all statements affected by a schema change DBRM/LOAD Library Compare Find mismatches in timestamps between DBRM and LOAD before you promote to production to avoid -805 / -818 SQL errors. Migrate Access Path Statistics Copy PROD statistics to TEST to get a better picture of the access paths Declarations Generator Generates null indicator variables to help avoid coding errors 9/20/2018 ©2005 BMC Software
17
SQL Performance for DB2 – Index Component
Collects predicate data Number of times a column was specified in a predicate and in what manner (Indexable Equal, Indexable Range) Collects I/O information for DB2 objects Inactive tables and inactive indexes DB2 catalog statistics for tables and indexes SQL statements associated with a table Collects index usage Percentage of getpages from indexes Provides What-if Index analysis on cloned objects Add indexes Drop indexes Update statistics on indexes 9/20/2018 ©2005 BMC Software
18
Data at statement level provide matrix of activity
SQL Performance for DB2 – Index Component Table Access by GETPAGE/STMT Ratio report Data at statement level provide matrix of activity Activity against Objects 9/20/2018 ©2005 BMC Software
19
SQL Performance for DB2 – Index Component Table Access by GETPAGE/STMT Ratio report
Enter M for Crud Matrix on the CR_Individual table This is the percentage of getpages from indexes 9/20/2018 ©2005 BMC Software
20
SQL Performance for DB2 – Index Component Table CRUD Matrix report
Let’s look at the usage of this column in the workload captured 9/20/2018 ©2005 BMC Software
21
SQL Performance for DB2 – Index Component Table CRUD Matrix report – Column Detail
9/20/2018 ©2005 BMC Software
22
SQL Performance for DB2 – Index Component Drilldown to SQL Text
The “X” option will launch the BMC Common Explain feature Common Explain is an integrated common component used by a number of BMC products Now we’ll proceed to the Explain function 9/20/2018 ©2005 BMC Software
23
BMC Common Explain What-if Index Analysis Using Cloning
Now let’s look at modeling a new index that could provide a better access path Common Explain uses a cloning technique that creates new objects or modifies existing objects Clones created in a BMC database so no DBD locks Objects created with DEFINE NO Objects not created till a dynamic explain is executed Objects dropped upon exiting Explain Index statistics can be modified Index DDL can be saved or imported into the process 9/20/2018 ©2005 BMC Software
24
BMC Common Explain What-if Analysis
We’ve created a new index in this step and modified the statistics so the optimizer will have enough information We can also delete existing indexes (deleted from the clone only) or update statistics data for existing indexes as well Here is the index we created in the previous step Remember the index hasn’t actually been created yet Next step we’ll using the XD (Dynamic Explain) to create the clone 9/20/2018 ©2005 BMC Software
25
BMC Common Explain What-if Analysis
With the new index the access path changes dramatically Meanwhile the cost of the statement has gone down as well DDL for creating this index can be saved for later use The new index has dramatically affected the access path and caused the Cost Rate for this statement to go down More importantly, the access path went from a tablespace scan to a matching index access 9/20/2018 ©2005 BMC Software
26
SQL Performance for DB2 3.3.00 Solution Update Generally Available November 9, 2006
9/20/2018
27
SQL Performance 3.3.00 Technical Overview Release Highlights
Reduce solution overhead Data Collector CPU and storage overhead Architectural changes mean overhead reductions Index Component overhead reduction Eliminate bind requirement Streamline reporting to reduce/eliminate redundant reports Deliver new filtering capabilities Exception only reporting (XOR) Increased number of collection keys Increased flexibility in defining exceptions and reducing overhead 9/20/2018 ©2005 BMC Software
28
SQL Performance for DB2 3.3 Filtering Enhancements
Extensive work on current filtering capabilities to: Deliver more filtering functionality Make filtering easier to use Enable new XOR option Discussed later Functional enhancements Exceptions on GETPAGES, SQL Codes, Timeout/Deadlock Occurrences, Synchronous I/O Counts In addition to existing exceptions (Elapsed and CPU times) Ignore the literal in dynamic SQL statements where the rest of the statement is the same Treats SQL statement as a single statement New collection keys Change collection items without cycling Data Collector (through filters) 9/20/2018 ©2005 BMC Software
29
New Collection Options Panel
Simple means to turn off collection for qualifiers New collection keys 9/20/2018 ©2005 BMC Software
30
New Collection Options Exception only roll-ups
Resource saving options specified as part of individual filter so they can be applied to specific portions of the workload Combined with other collection options to create a tailored profile for applications Triggers exception only reporting Idea is to minimize collection overhead for stable applications with minimal monitoring requirements 9/20/2018 ©2005 BMC Software
31
New Collection Options Identifying Exception Criteria
Specifies exceptions on Elapsed and CPU time, Negative SQL code, Deadlocks and Timeouts, and synchronous I/O Counts Exception records will be cut for each of the exceptions that occur Specifies collection of host variable values 9/20/2018 ©2005 BMC Software
32
New Collection Options Filter Profile Definition for Legacy Applications
Exception-only reporting (XOR) specified for programs (ACCT*) and plan (KAD4050) No collection at all for payroll program - PAYR650 9/20/2018 ©2005 BMC Software
33
New Collection/Filtering Options Identifying Filters in Place for a Specific Interval
Allows user to identify collection/filtering options in place during a specific interval Based on current profile 9/20/2018 ©2005 BMC Software
34
New Collection/Filtering Options Details on Active Filters
Collection options in place at time of interval 9/20/2018 ©2005 BMC Software
35
New Collection/Filtering Options Drilling Into Exceptions
9/20/2018 ©2005 BMC Software
36
New Collection/Filtering Options Exception Analysis
9/20/2018 ©2005 BMC Software
37
Exception Analysis Exception Detail
9/20/2018 ©2005 BMC Software
38
Exception Analysis Exception Detail w/Host Variables
9/20/2018 ©2005 BMC Software
39
Additional SQL Performance Enhancements
Improvements in reporting on Query Parallelism PSSBLOAD – Utility for loading APPTUNE performance data to DB2 tables for analysis PSSEXTRC – Explain and compare dynamic SQL access paths across time or DB2 releases 9/20/2018 ©2005 BMC Software
40
PSSBLOAD: Loading APPTUNE data into DB2 Tables
Load performance data into DB2 for analysis Historical performance trends—You might want to know which SQL statements had the highest CPU in a given month, or which statement had the highest number of executions during a batch window. Audit database—You might want to know which users accessed a particular table, or which users tried to access unauthorized tables. Impact Analysis—You might want to identify the programs, statement numbers, and SQL text that accessed a particular table. How’s it work Reads archived trace data sets containing SQL performance data Extracts the BMC IFCID data from the archives SQL Text SQL Errors (SQLCA) SQL Statement Summary Object Statistics (per statement) Creates output data sets used for loading into DB2 tables 9/20/2018 ©2005 BMC Software
41
Summary SQL Performance for DB2 3.3 available November 9th
APPTUNE 5.3 SQL Explorer for DB2 5.3 Significant reduction in Data Collector overhead For APPTUNE and Index Component New functionality in managing collection keys and filters Continued investment in BMC’s DB2 solutions Continued focus on things that differentiate BMC World class support Innovative technology that solves critical business issues Strong financial condition 9/20/2018 ©2005 BMC Software
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.