MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Factors considered by DB2 to determine access path

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Database
View previous topic :: View next topic  
Author Message
ashutosh_agl3
Beginner


Joined: 14 Aug 2003
Posts: 28
Topics: 15

PostPosted: Mon Feb 13, 2006 12:41 pm    Post subject: Factors considered by DB2 to determine access path Reply with quote

What are the factors taken in consideration by DB2 to determine the access path ?

Is it possible that with the same index definition DB2 determine different paths in different data environments.

Thank You
Back to top
View user's profile Send private message Yahoo Messenger
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Mon Feb 13, 2006 12:57 pm    Post subject: Reply with quote

ashutosh_agl3,

Try this link which might answer your queries

http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/DSNAGH10/5.10.2?DT=20010212102121

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
ashutosh_agl3
Beginner


Joined: 14 Aug 2003
Posts: 28
Topics: 15

PostPosted: Mon Feb 13, 2006 2:44 pm    Post subject: Factors considered by DB2 to determine access path Reply with quote

Thanks Kolusu. This certainly is useful information.

However this does not answer my questions as I am looking to know the factors affecting the output of EXPLAIN and if the amount and type of data plays a role.

I know some what about interpreting the results of EXPLAIN but what really bothers is that if the same SQL can give different EXPLAIN output on 2 different environments where there are same indexes and same table structure except for data.

Does the link http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/DSNAGH10/5.9.1?DT=20010212102121 provide answer to the question?

Thank You
Back to top
View user's profile Send private message Yahoo Messenger
CZerfas
Intermediate


Joined: 31 Jan 2003
Posts: 211
Topics: 8

PostPosted: Tue Feb 14, 2006 9:41 am    Post subject: Reply with quote

There are three main input factors DB2 has to choose an access path for a SQL statement:
- the coding of the statement
- the structure of the data
- the statistics in the DB2 catalog about the data

The most important factor is the last one: Why bother about choosing an index to access the data if the tablespace only contains three data pages? It is much more efficient to go via a tablespace scan.

This was a trivial example, of course, but it gives you the idea of choosing an access path. Looking at a join situation: Which table should be the outer and which one the inner table? Shurely "number of qualifying rows" is a main parameter to answer this question.

Therefore the essence of cost-based optimizing of access paths is the volume and the distribution of data.

regards
Christian
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Database All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group