Welcome to Scribd, the world's digital library. Read, publish, and share books and documents. See more
Download
Standard view
Full view
of .
Look up keyword
Like this
1Activity
0 of .
Results for:
No results containing your search query
P. 1
10_SQL_Tips

10_SQL_Tips

Ratings: (0)|Views: 1|Likes:
Published by ank_gcetts

More info:

Published by: ank_gcetts on Mar 25, 2011
Copyright:Attribution Non-commercial

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as PDF, TXT or read online from Scribd
See more
See less

10/07/2014

pdf

text

original

 
 
Top Ten SQL Performance Tips
By Sheryl M. Larsen
 
 
 
Contents
2
 
 
 
Top Ten SQL Performance Tips
By Sheryl M. Larsen
Introduction
Structured Query Language (SQL) is the blessing and the curse of relational DBMSs. Sinceany data retrieved from a relational database requires SQL, this topic is relevant to anybodyaccessing a relational database; from the end user to the developer to the DBA. When efficientSQL is used, the results are highly scalable, flexible, and manageable systems. Wheninefficient SQL is used, response times are lengthy, programs run longer and applicationoutages can occur. Considering that a typical database system spends 90% of the processingtime just retrieving data from the database, it’s easy to see how important it is to ensure your SQL is as efficient as possible. Checking for common SQL problems such as ‘SELECT *FROM’ is just the tip of the iceberg. In this paper, we’ll explore other common SQL problemsthat are just as easy to fix. Bear in mind, a SQL statement can be written with many variationsand result in the same data being returned — there are no “Good” SELECT statements or “Bad” SELECT statements, just the “Appropriate for the Requirement.” Each relationalDBMS has its own way of optimizing and executing SELECT statements. Therefore, eachDBMS has its own Top SELECT Performance Tips. This paper will focus on DB2 for OS/390and z/0S, with examples and overview from Quest Software’s Quest Central for DB2 product.
Overview
Seventeen years ago this list of tips would have been much longer and contained antidotes tothe smallest SELECT scenarios. Each new release of DB2 brings thousands of lines of newcode that expand the intelligence of the optimization, query rewrite, and query execution. For example, over the years a component called Data Manager, commonly referred to as ‘Stage 1processing,’ has increased its filtering capacity one hundred fold. Another component is theRelational Data Server, commonly referred to as ‘Stage 2 processing,’ and its main function isquery rewrite and optimization. Another key component is the DB2 optimizer, whichdetermines the access path used to retrieve the data based on the SQL presented. The DB2optimizer improves with each release of DB2, taking into account additional statistics in theDB2 catalog, and providing new and improved access paths. These components and manymore, shown in Figure 1, depict how DB2 processes requests for data or SQL. This is wherethe following DB2 SQL Performance tips are derived from.
3
 

You're Reading a Free Preview

Download
scribd
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->