Professional Documents
Culture Documents
Mainframe Performance Tuning Workshop: Thirdware Technology Solutions 1
Mainframe Performance Tuning Workshop: Thirdware Technology Solutions 1
Performance Tuning
WORKSHOP
DB2 Optimization
Q &A
Brainstorming Session
Subsystem Optimization
- DB2/
- IMS
- CICS
Access Paths and Access Strategies – Performance Data Collection – Review Statistics
3 R’s - RUNSTATS/REBIND/REORG
Use NULL Sparingly while designing; Use appropriate Data Types; Avoid Defaults
Revisit Indexes
Results
SQL Relational Data System
Apply stage 2
predicates and sort
data
Optimized
Data Manager
SQL
Apply stage 1
predicates
Checks authorization
DB2
Optimizer
Other System
Information
Query Cost
Formulas
Optimized Access
Path(s)
DB2
Catalogue
DBAS
Optimization Hint
OPTHINT In
PLAN_TABLE
Filter Factor
o Ratio between 0 and 1
o Lower the FF > Lower the cost > More efficient query
Many times it is not possible to predict what algorithm the optimizer will choose
An “explain” facility is provided that shows what steps the DBMS will take to evaluate a particular
query
While SQL is a great mechanism that makes life easy for programming, the programmer and designer
have to take care when it comes to performance
Mostly reactive
Tune SQL while building Profile the way the Identify slowdowns fast
the application application accesses the DB and fix them
(proactively) Analyze application Analyze performance
Development and tuning performance while proactively to identify
work hand-in-hand. simulating the production problems ahead of time
env. Monitoring, diagnosis
Tuning, impact analysis and resolution
and profiling solutions.
2.
2.Rewrite
RewriteSQL
SQL
1.
1.Identify
Identify
Problematic 3. Benchmark SQL
ProblematicSQL
SQL
alternatives
Best SQL
Avoid DISTINCT and UNION if really not necessary; Use UNION ALL instead of UNION
Code Efficient WHERE Clauses with maximum possible filters, Index Keyed Columns in WHERE
Use Constants and Literals if the values will not change for the next 3 years (for static queries)
Do not use Arithmetic Expressions in a Predicate (Remove Calculations in Join and Where Clause)
Better to create Indexes on columns that have integer values instead of characters. Integer values use less
overhead than character values
o JOINs on common indexed column or columns shared the Joined tables is preferred.
o Make sure to use the most restrictive JOIN table first; and provide as many indexed and restrictive
WHERE clauses as possible to limit the amount of data that needs to be Joined to the second or
subsequent tables.