IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

need some info on DB2 indexes


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
raja1128

New User


Joined: 09 Jan 2007
Posts: 17
Location: india

PostPosted: Sat Jul 30, 2011 6:25 pm
Reply with quote

Hello Forum,

I am trying to understand DB2 indexes. I saw below paragraph in a document and couldnt understand the numbers.

""""Most DB2 professionals know intuitively that index-only processing is a good thing. An example supports that intuition. A million-row table with 100-byte rows occupies about 28,572 pages (ceiling(1,000,000 / floor(3870/(100 byte row + 8 bytes))). An index on a 10-byte column occupies
about 4695 (ceiling(1,000,000 / floor (3634 / (10 byte column + 4 byte RID + 3 bytes)) leaf pages. Obviously, processing all leaf pages is more efficient than processing all data pages. Even if only a few values are required, avoiding I/O to the data pages results in savings.""""

can some one kindly explain the numbers and theory mentioned above.

thank you!
Raja
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Sat Jul 30, 2011 7:58 pm
Reply with quote

Hello,

Suggest you ignore the numbers - they are only an example. As we say, your milage may vary.

The theory (and it is not only theory) is that the less i/o done, the better a process will perform. If the SELECT can be satisfied by using only index entries (rather than data entries) the overhead of reading the "data" is avoided.

This is something we should be aware of but not spend too much time on. To add columns to some index(ex) to take advantage of index-only processing is most often the wrong thing to do.
Back to top
View user's profile Send private message
GuyC

Senior Member


Joined: 11 Aug 2009
Posts: 1281
Location: Belgium

PostPosted: Mon Aug 01, 2011 1:24 pm
Reply with quote

dick scherrer wrote:
To add columns to some index(ex) to take advantage of index-only processing is most often the wrong thing to do.
Then why is IBM adding INCLUDE columns in DB2 V10?
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Mon Aug 01, 2011 8:09 pm
Reply with quote

Hi Guy,

As with many things - probably because some asked for it or someone in the ivory tower thought it was a good idea at the time. Compared to the high-performance databases (which have become fewer and fewer<g>, db2 can use all the help it can get. . . As many VPs and Dirfectors have said, they really didn't want to go to db2 but did because of the risk of their preference "going away".

As i mentioned, this can occasionally help, but very few situations should call it a "requirement".
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts in REXX,how to get sysprt info CLIST & REXX 9
No new posts Copy a PDS to a new PDS - why do I ne... TSO/ISPF 8
No new posts Tivoli INFO/MANAGEMENT IBM Tools 1
No new posts Recreating VSAM cluster catalog info ... All Other Mainframe Topics 6
No new posts Need an info to store Hexadecimal val... DB2 5
Search our Forums:

Back to Top