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 

how does the index of a db2 table work?

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


Joined: 20 May 2004
Posts: 77
Topics: 31

PostPosted: Mon May 31, 2004 5:18 am    Post subject: how does the index of a db2 table work? Reply with quote

Hello,

i'd like to know how the index of a db2 table works?

I'm not sure if the index just contains pointers to the table or it also contain the data of the indexed columns.
The index always needs to go to the tabla to read the values?

Could you send me a link where i can learn how the index works?

Thanks a lot.
Back to top
View user's profile Send private message
monaco
Beginner


Joined: 20 May 2004
Posts: 77
Topics: 31

PostPosted: Mon May 31, 2004 6:52 am    Post subject: Reply with quote

Thank you for your answer.

But I'm still not sure.

My question is:

imagine a table with two columns indexed. If I request one of these two columns (or both) and the access is thought the index, the index needs to go to the table or in the index pages there are the values of these two columns?

Thanks.
Back to top
View user's profile Send private message
Maton_Man
Beginner


Joined: 30 Jan 2004
Posts: 123
Topics: 0

PostPosted: Tue Jun 01, 2004 1:15 am    Post subject: Reply with quote

I'm no guru but I knwo that the index is separate from the table. It does not contain pointers it contains actual data and is updated as the table is updated.

Read the DB2 Administration Guide 5.10.3.2 Overview of index access
_________________
My opinions are exactly that.
Back to top
View user's profile Send private message
CZerfas
Intermediate


Joined: 31 Jan 2003
Posts: 211
Topics: 8

PostPosted: Tue Jun 01, 2004 5:46 am    Post subject: Reply with quote

A DB2 index contains the values of the indexed columns plus an internal pointer to the actual data row (RID, record identifier). If you need only the values of columns, which are within the index, DB2 performs an "index only" access (referrenced in the plan table if bound with explain(yes)).

In that case DB2 can satisfy your query by only accessing the index and will skip the access to the data row.

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