SlideShare uma empresa Scribd logo
1 de 10
The Five R’s
There Can Be No DB2 Performance
Improvements Without Them!
By Craig S. Mullins
2
Application Performance
BIND and REBIND are critical for application performance
Wise organizations plan their REBIND strategy
There are several common approaches:

Daily maintenance: REBIND after RUNSTATS
— Perhaps not every day, but REBIND are done after RUNSTATS

Global REBIND after migration to new DB2 version

Global REBIND after installing new PTFs
— For the above two, access paths change only when DB2 changes

REBIND after x days / weeks / months …

Let it Ride! (“If it ain’t broke, don’t fix it.”)
3
Let It Ride
— Programs once bound, are (almost) never rebound.
— Reason:

Fear of access path degradation
— Result:

No improvement to access paths

No CPU savings from new DB2 efficiencies

Sub-optimal performance

Every DB2 program potentially suffers for fear
that one or two SQL statements will become
inefficient
4
Regular REBIND
— Better Approach: Regular REBINDing

The Three R’s (next slide)
— Reason:

Access paths are more up-to-date based on the
current state of the data.
— Result:

Generally, improved access paths

CPU savings from new DB2 efficiencies

Optimal performance
— Of course, you can still get those “problem”
access paths.
5
The Three R’s

REORG

RUNSTATS

REBIND
As far back as February 1993
6
But the Three R’s are Not Enough!

With only Three R’s, a lot of questions remain…
— When should you REORGanize?

To properly determine requires RUNSTATS (or RTS).

So should it be RUNSTATS, REORG, RUNSTATS, REBIND?
— When should you run RUNSTATS?

To properly determine you need to know the make-up,
usage, and volatility of your data.
— When should you REBIND?

When statistics have changed significantly enough to
change access paths.
7
OK, so When Should we REBIND?
When do we REBIND?

The best answer to this questions is: “Whenever data has changed
significantly enough that it may impact the performance of the
existing access paths.”
— The problem is knowing exactly when this happens.

DB2 application performance can be negatively affected by
uncontrolled REBINDs.

Causes
— Optimizer inefficiency
— Volatile tables
— Catalog pollution
— Inefficient use of RUNSTATS
8
Reviewing the Steps: The 3 5 R’s
1. RTS (or RUNSTATS)
2. REORG
3. RUNSTATS
4. REBIND
5. Recheck

In other words, what did the REBIND do?
— Access path changes – better or worse?
9
Bind ImpactExpert
The big problem implementing the 5 R’s is how to
recheck after rebinding
SEGUS Bind ImpactExpert automates change control
for DB2 access paths so…

…only improved access paths are accepted
Then you only need to recheck the bad ones!
For more information on Bind ImpactExpert:
http://segus.com/language=en/887
9
Bind ImpactExpert
The big problem implementing the 5 R’s is how to
recheck after rebinding
SEGUS Bind ImpactExpert automates change control
for DB2 access paths so…

…only improved access paths are accepted
Then you only need to recheck the bad ones!
For more information on Bind ImpactExpert:
http://segus.com/language=en/887

Mais conteúdo relacionado

Mais procurados

Tuning SQL for Oracle Exadata: The Good, The Bad, and The Ugly Tuning SQL fo...
 Tuning SQL for Oracle Exadata: The Good, The Bad, and The Ugly Tuning SQL fo... Tuning SQL for Oracle Exadata: The Good, The Bad, and The Ugly Tuning SQL fo...
Tuning SQL for Oracle Exadata: The Good, The Bad, and The Ugly Tuning SQL fo...
Enkitec
 
DB2 LUW - Backup and Recovery
DB2 LUW - Backup and RecoveryDB2 LUW - Backup and Recovery
DB2 LUW - Backup and Recovery
imranasayed
 
62620940 charm-configuration-procedures
62620940 charm-configuration-procedures62620940 charm-configuration-procedures
62620940 charm-configuration-procedures
narendar99
 

Mais procurados (20)

Ibm db2
Ibm db2Ibm db2
Ibm db2
 
Db2
Db2Db2
Db2
 
Vsam
VsamVsam
Vsam
 
DB2 for z/OS - Starter's guide to memory monitoring and control
DB2 for z/OS - Starter's guide to memory monitoring and controlDB2 for z/OS - Starter's guide to memory monitoring and control
DB2 for z/OS - Starter's guide to memory monitoring and control
 
Solution Manager 7.2 Overview final
Solution Manager 7.2 Overview finalSolution Manager 7.2 Overview final
Solution Manager 7.2 Overview final
 
Db2 analytics accelerator on ibm integrated analytics system technical over...
Db2 analytics accelerator on ibm integrated analytics system   technical over...Db2 analytics accelerator on ibm integrated analytics system   technical over...
Db2 analytics accelerator on ibm integrated analytics system technical over...
 
DB2 on Mainframe
DB2 on MainframeDB2 on Mainframe
DB2 on Mainframe
 
DB2 LUW Access Plan Stability
DB2 LUW Access Plan StabilityDB2 LUW Access Plan Stability
DB2 LUW Access Plan Stability
 
Tuning SQL for Oracle Exadata: The Good, The Bad, and The Ugly Tuning SQL fo...
 Tuning SQL for Oracle Exadata: The Good, The Bad, and The Ugly Tuning SQL fo... Tuning SQL for Oracle Exadata: The Good, The Bad, and The Ugly Tuning SQL fo...
Tuning SQL for Oracle Exadata: The Good, The Bad, and The Ugly Tuning SQL fo...
 
Educational seminar lessons learned from customer db2 for z os health check...
Educational seminar   lessons learned from customer db2 for z os health check...Educational seminar   lessons learned from customer db2 for z os health check...
Educational seminar lessons learned from customer db2 for z os health check...
 
online training for IBM DB2 LUW UDB DBA
online training for IBM DB2 LUW UDB DBAonline training for IBM DB2 LUW UDB DBA
online training for IBM DB2 LUW UDB DBA
 
DB2 LUW - Backup and Recovery
DB2 LUW - Backup and RecoveryDB2 LUW - Backup and Recovery
DB2 LUW - Backup and Recovery
 
62620940 charm-configuration-procedures
62620940 charm-configuration-procedures62620940 charm-configuration-procedures
62620940 charm-configuration-procedures
 
Oracle Database performance tuning using oratop
Oracle Database performance tuning using oratopOracle Database performance tuning using oratop
Oracle Database performance tuning using oratop
 
Oracle data guard for beginners
Oracle data guard for beginnersOracle data guard for beginners
Oracle data guard for beginners
 
Solving the DB2 LUW Administration Dilemma
Solving the DB2 LUW Administration DilemmaSolving the DB2 LUW Administration Dilemma
Solving the DB2 LUW Administration Dilemma
 
M|18 Deep Dive: InnoDB Transactions and Write Paths
M|18 Deep Dive: InnoDB Transactions and Write PathsM|18 Deep Dive: InnoDB Transactions and Write Paths
M|18 Deep Dive: InnoDB Transactions and Write Paths
 
DOAG Oracle Unified Audit in Multitenant Environments
DOAG Oracle Unified Audit in Multitenant EnvironmentsDOAG Oracle Unified Audit in Multitenant Environments
DOAG Oracle Unified Audit in Multitenant Environments
 
DB2 Data Sharing Performance
DB2 Data Sharing PerformanceDB2 Data Sharing Performance
DB2 Data Sharing Performance
 
Comparison of ACFS and DBFS
Comparison of ACFS and DBFSComparison of ACFS and DBFS
Comparison of ACFS and DBFS
 

Semelhante a The Five R's: There Can be no DB2 Performance Improvement Without Them!

Top 10 Tips for an Effective Postgres Deployment
Top 10 Tips for an Effective Postgres DeploymentTop 10 Tips for an Effective Postgres Deployment
Top 10 Tips for an Effective Postgres Deployment
EDB
 
DB2 Performance Tuning Z/OS - email me please for more details
DB2 Performance Tuning Z/OS - email me please for more detailsDB2 Performance Tuning Z/OS - email me please for more details
DB2 Performance Tuning Z/OS - email me please for more details
Manikandan Suresh
 
Con7091 sql tuning for expert db as-oow17_oct2_1507314871265001m0x4
Con7091 sql tuning for expert db as-oow17_oct2_1507314871265001m0x4Con7091 sql tuning for expert db as-oow17_oct2_1507314871265001m0x4
Con7091 sql tuning for expert db as-oow17_oct2_1507314871265001m0x4
asifanw
 
PPCD_And_AmazonRDS
PPCD_And_AmazonRDSPPCD_And_AmazonRDS
PPCD_And_AmazonRDS
Vibhor Kumar
 

Semelhante a The Five R's: There Can be no DB2 Performance Improvement Without Them! (20)

IMS to DB2 Migration: How a Fortune 500 Company Made the Move in Record Time ...
IMS to DB2 Migration: How a Fortune 500 Company Made the Move in Record Time ...IMS to DB2 Migration: How a Fortune 500 Company Made the Move in Record Time ...
IMS to DB2 Migration: How a Fortune 500 Company Made the Move in Record Time ...
 
DB2 11 for z/OS Migration Planning and Early Customer Experiences
DB2 11 for z/OS Migration Planning and Early Customer ExperiencesDB2 11 for z/OS Migration Planning and Early Customer Experiences
DB2 11 for z/OS Migration Planning and Early Customer Experiences
 
Db2 update day 2015 managing db2 with ibm db2 tools svenn aage
Db2 update day 2015   managing db2 with ibm db2 tools svenn aageDb2 update day 2015   managing db2 with ibm db2 tools svenn aage
Db2 update day 2015 managing db2 with ibm db2 tools svenn aage
 
Dynamics of Leading Legacy Databases
Dynamics of Leading Legacy DatabasesDynamics of Leading Legacy Databases
Dynamics of Leading Legacy Databases
 
Dealing With The Optimizer complexity
Dealing With The Optimizer complexityDealing With The Optimizer complexity
Dealing With The Optimizer complexity
 
Top 10 Tips for an Effective Postgres Deployment
Top 10 Tips for an Effective Postgres DeploymentTop 10 Tips for an Effective Postgres Deployment
Top 10 Tips for an Effective Postgres Deployment
 
Data Server Manager for DB2 for z/OS
Data Server Manager for DB2 for z/OS Data Server Manager for DB2 for z/OS
Data Server Manager for DB2 for z/OS
 
Predicting When Your Applications Will Go Off the Rails! Managing DB2 Appli...
Predicting When Your Applications Will Go Off the Rails!  Managing DB2 Appli...Predicting When Your Applications Will Go Off the Rails!  Managing DB2 Appli...
Predicting When Your Applications Will Go Off the Rails! Managing DB2 Appli...
 
Dark launch
Dark launchDark launch
Dark launch
 
MySQL Performance Best Practices
MySQL Performance Best PracticesMySQL Performance Best Practices
MySQL Performance Best Practices
 
KoprowskiT_SQLRelay2014#2_Southampton_MaintenancePlansForBeginners
KoprowskiT_SQLRelay2014#2_Southampton_MaintenancePlansForBeginnersKoprowskiT_SQLRelay2014#2_Southampton_MaintenancePlansForBeginners
KoprowskiT_SQLRelay2014#2_Southampton_MaintenancePlansForBeginners
 
DB2 Performance Tuning Z/OS - email me please for more details
DB2 Performance Tuning Z/OS - email me please for more detailsDB2 Performance Tuning Z/OS - email me please for more details
DB2 Performance Tuning Z/OS - email me please for more details
 
Distributed RDBMS: Data Distribution Policy: Part 3 - Changing Your Data Dist...
Distributed RDBMS: Data Distribution Policy: Part 3 - Changing Your Data Dist...Distributed RDBMS: Data Distribution Policy: Part 3 - Changing Your Data Dist...
Distributed RDBMS: Data Distribution Policy: Part 3 - Changing Your Data Dist...
 
Con7091 sql tuning for expert db as-oow17_oct2_1507314871265001m0x4
Con7091 sql tuning for expert db as-oow17_oct2_1507314871265001m0x4Con7091 sql tuning for expert db as-oow17_oct2_1507314871265001m0x4
Con7091 sql tuning for expert db as-oow17_oct2_1507314871265001m0x4
 
Concept to production Nationwide Insurance BigInsights Journey with Telematics
Concept to production Nationwide Insurance BigInsights Journey with TelematicsConcept to production Nationwide Insurance BigInsights Journey with Telematics
Concept to production Nationwide Insurance BigInsights Journey with Telematics
 
Getting the most out of Amazon RDS investment with Toad for MySQL
Getting the most out of Amazon RDS investment with Toad for MySQLGetting the most out of Amazon RDS investment with Toad for MySQL
Getting the most out of Amazon RDS investment with Toad for MySQL
 
Supporting operations personnel a software engineers perspective
Supporting operations personnel a software engineers perspectiveSupporting operations personnel a software engineers perspective
Supporting operations personnel a software engineers perspective
 
Migrating from Oracle to Postgres
Migrating from Oracle to PostgresMigrating from Oracle to Postgres
Migrating from Oracle to Postgres
 
Big data and polyglot solutions
Big data and polyglot solutionsBig data and polyglot solutions
Big data and polyglot solutions
 
PPCD_And_AmazonRDS
PPCD_And_AmazonRDSPPCD_And_AmazonRDS
PPCD_And_AmazonRDS
 

Mais de Craig Mullins

The impact of regulatory compliance on DBA(latest)
The impact of regulatory compliance on DBA(latest)The impact of regulatory compliance on DBA(latest)
The impact of regulatory compliance on DBA(latest)
Craig Mullins
 
DB2 V8 - For Developers Only
DB2 V8 -  For Developers OnlyDB2 V8 -  For Developers Only
DB2 V8 - For Developers Only
Craig Mullins
 
Data breach protection from a DB2 perspective
Data breach protection from a  DB2 perspectiveData breach protection from a  DB2 perspective
Data breach protection from a DB2 perspective
Craig Mullins
 

Mais de Craig Mullins (10)

Database Archiving - Managing Data for Long Retention Periods
Database Archiving - Managing Data for Long Retention PeriodsDatabase Archiving - Managing Data for Long Retention Periods
Database Archiving - Managing Data for Long Retention Periods
 
Database auditing essentials
Database auditing essentialsDatabase auditing essentials
Database auditing essentials
 
The Tao of DB2
The Tao of DB2The Tao of DB2
The Tao of DB2
 
DB2 UDB for z/OS Version 7 - An Overview
DB2 UDB for z/OS Version 7 - An OverviewDB2 UDB for z/OS Version 7 - An Overview
DB2 UDB for z/OS Version 7 - An Overview
 
The impact of regulatory compliance on DBA(latest)
The impact of regulatory compliance on DBA(latest)The impact of regulatory compliance on DBA(latest)
The impact of regulatory compliance on DBA(latest)
 
DB2 V8 - For Developers Only
DB2 V8 -  For Developers OnlyDB2 V8 -  For Developers Only
DB2 V8 - For Developers Only
 
DBA101
DBA101DBA101
DBA101
 
Data breach protection from a DB2 perspective
Data breach protection from a  DB2 perspectiveData breach protection from a  DB2 perspective
Data breach protection from a DB2 perspective
 
Db trends final
Db trends   finalDb trends   final
Db trends final
 
DB2 V10 Migration Guidance
DB2 V10 Migration GuidanceDB2 V10 Migration Guidance
DB2 V10 Migration Guidance
 

Último

Último (20)

Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 

The Five R's: There Can be no DB2 Performance Improvement Without Them!

  • 1. The Five R’s There Can Be No DB2 Performance Improvements Without Them! By Craig S. Mullins
  • 2. 2 Application Performance BIND and REBIND are critical for application performance Wise organizations plan their REBIND strategy There are several common approaches:  Daily maintenance: REBIND after RUNSTATS — Perhaps not every day, but REBIND are done after RUNSTATS  Global REBIND after migration to new DB2 version  Global REBIND after installing new PTFs — For the above two, access paths change only when DB2 changes  REBIND after x days / weeks / months …  Let it Ride! (“If it ain’t broke, don’t fix it.”)
  • 3. 3 Let It Ride — Programs once bound, are (almost) never rebound. — Reason:  Fear of access path degradation — Result:  No improvement to access paths  No CPU savings from new DB2 efficiencies  Sub-optimal performance  Every DB2 program potentially suffers for fear that one or two SQL statements will become inefficient
  • 4. 4 Regular REBIND — Better Approach: Regular REBINDing  The Three R’s (next slide) — Reason:  Access paths are more up-to-date based on the current state of the data. — Result:  Generally, improved access paths  CPU savings from new DB2 efficiencies  Optimal performance — Of course, you can still get those “problem” access paths.
  • 6. 6 But the Three R’s are Not Enough!  With only Three R’s, a lot of questions remain… — When should you REORGanize?  To properly determine requires RUNSTATS (or RTS).  So should it be RUNSTATS, REORG, RUNSTATS, REBIND? — When should you run RUNSTATS?  To properly determine you need to know the make-up, usage, and volatility of your data. — When should you REBIND?  When statistics have changed significantly enough to change access paths.
  • 7. 7 OK, so When Should we REBIND? When do we REBIND?  The best answer to this questions is: “Whenever data has changed significantly enough that it may impact the performance of the existing access paths.” — The problem is knowing exactly when this happens.  DB2 application performance can be negatively affected by uncontrolled REBINDs.  Causes — Optimizer inefficiency — Volatile tables — Catalog pollution — Inefficient use of RUNSTATS
  • 8. 8 Reviewing the Steps: The 3 5 R’s 1. RTS (or RUNSTATS) 2. REORG 3. RUNSTATS 4. REBIND 5. Recheck  In other words, what did the REBIND do? — Access path changes – better or worse?
  • 9. 9 Bind ImpactExpert The big problem implementing the 5 R’s is how to recheck after rebinding SEGUS Bind ImpactExpert automates change control for DB2 access paths so…  …only improved access paths are accepted Then you only need to recheck the bad ones! For more information on Bind ImpactExpert: http://segus.com/language=en/887
  • 10. 9 Bind ImpactExpert The big problem implementing the 5 R’s is how to recheck after rebinding SEGUS Bind ImpactExpert automates change control for DB2 access paths so…  …only improved access paths are accepted Then you only need to recheck the bad ones! For more information on Bind ImpactExpert: http://segus.com/language=en/887

Notas do Editor

  1. OK, so we know that BIND and REBIND are important components in assuring optimal application performance. It is the bind process that determines exactly how your DB2 data is accessed in your application programs. As such, it critically important that you develop an appropriate strategy for when and how to REBIND your programs. There are several common approaches taken by DB2 customers. By far, the best approach is the first – as we will learn. This approach involves some form of regular maintenance that keeps DB2 statistics up to date and formulates new access paths as data volumes and patterns change. More on this in a moment. Other approaches include binding only when a new version of DB2 is installed, or perhaps more ambitious, whenever new PTFs are applied to DB2. Another approach is to rebind automatically after a regular period of time, whether it is days, weeks, months, what have you. This approach can work if the period of time is wisely chosen based on the application data – but it still can pose significant administrative issues. The final approach – if it ain’t broke don’t fix it - is taken by some organizations… and it is the worst of the several approaches here. Let’s go on to the next slide to discuss the issues with this tactic.
  2. The biggest problem with this approach is that you are penalizing EVERY program in your subsystem for fear that a program or two will have a few degraded access paths. This results in potentially many programs having sub-optimal performance because the optimizer never gets a chance to create better access paths as the data changes. Of course, the possibility of degraded performance is real. The problem is being able to find which statements may be worse. The ideal would situation would be to be able to review the access path changes before hand to determine if they are better or worse. But DB2 does not provide any systematic method of administering access paths that way.
  3. As I mentioned previously, the best approach is to perform regular REBINDs as your data changes. This involves what has become known as the three Rs. We’ll discuss this approach on the next slide in just a moment. At any rate, your goal should be to keep your access paths up-to-date with the current state of your data. Failing to do this means that DB2 is accessing data based upon false assumptions. DB2 is unlikely to make the same access path choice as your data grows – and as patterns within the data change. By REBINDing you can generally improve the overall performance of your applications because the access paths will be better designed based on an accurate view of the data. Additionally, as DB2 changes are made (via new releases or PTFs) optimizer improvements and new access techniques can be incorporated into the access paths. OF course, this means you will have to develop a methodology for reviewing your access paths and taking care of any “potential” problem access paths. But tackling this as a manual process can be difficult.
  4. Anyway, the proper approach of regular rebinds is typically referred to as the Three R’s. This means regularly reorganizing the data to ensure that it is optimally structured. That is followed by RUNSTATS to be sure that the reorganized state of the data is reflected in the DB2 Catalog. Finally, we follow that up with REBINDs of the application programs that access the data structures that have been reorganized and RUNSTATed.
  5. Of course, the Three R’s can pose more questions than it answers. For example, when should you REORGanize? In order to properly determine when a REORG is needed you’ll have to look at statistics. This mean looking at either RUNSTATS or Real-Time Statistics. So, perhaps it should be at least 4 R’s – in other words, RUNSTATS, REORG, RUNSTATS, REBIND. Some folks don’t rely on statistics to schedule a REORG but just build the JCL to REORG their database objects when they create the object. So they create a table space then build the REORG job and schedule it to run monthly, or quarterly, or on some regular basis. This is better than no REORG at all, but it is probably not the best approach because you are probably either reorging too soon (in which case you waste the CPU cycles to do the REORG) or you are reorging too late (in which case performance is suffering for a period of time before the REORG runs). Better to base your REORGs off of statistics – either RUNSTATS or RTS. OK, then when should you run RUNSTATS? My answer is "As frequently as possible based on how often your data changes.” Of course, this means you need to know a thing or two about your data growth patterns. To properly determine a schedule for statistics you need to know things about your data: what is its make-up, how is it used, how fast does it grow, and how often does it change? These patterns will differ for every table space in your system. Next we need to decide when to REBIND? The best answer for this is when statistics have changed significantly enough to change access paths. But knowing when this is so is the hard part.
  6. OK, so how do we use the statistics to REBIND. If we know that data has significantly changed it makes sense to REBIND (after RUNSTATS, of course). But the trick is knowing exactly when we have a significant change in our data. Without an automated method of comparing and contrasting statistics (or even better yet, access paths) coming up with an answer in a manual way can be time-consuming and error-prone – especially when we get into the thousands of programs. And we always have to be alert for a rogue access path – that is, when the optimizer formulates a new access path that performs worse than the previous access path. This can happen for a variety of reasons. Of course, number one is that the optimizer, though good, is not perfect. So mistakes can happen. Other factors can cause worse access, too. The access paths for volatile tables depend on when you run the RUNSTATS. Volatile tables are those that start out empty, get rows added to them during processing, and are emptied out at the end of the day. And, of course, if the catalog or statistics are not accurate we can get problems, too.
  7. So the 3 R’s probably need to become the 5 R’s. We have to start off with a RUNSTATS (or use RTS) to determine when to REORG, after which we should RUNSTATS, followed by a REBIND. But we also really need that fifth R – which is to recheck what the REBIND actually did. As we mentioned, the optimizer can make mistakes. And, of course, so can you. Users don't call you when performance is better (or the same) – at least not usually. But if performance gets worse, you can bet on getting a call from irate users. So we need to put in place best practices whereby we test BINDs to compare the before and after impact of the optimizer’s choices. This is easier said than done.