View previous topic :: View next topic |
Author |
Message |
monaco Beginner
Joined: 20 May 2004 Posts: 77 Topics: 31
|
Posted: Mon May 31, 2004 5:18 am Post subject: how does the index of a db2 table work? |
|
|
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 |
|
|
monaco Beginner
Joined: 20 May 2004 Posts: 77 Topics: 31
|
Posted: Mon May 31, 2004 6:52 am Post subject: |
|
|
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 |
|
|
Maton_Man Beginner
Joined: 30 Jan 2004 Posts: 123 Topics: 0
|
Posted: Tue Jun 01, 2004 1:15 am Post subject: |
|
|
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 |
|
|
CZerfas Intermediate
Joined: 31 Jan 2003 Posts: 211 Topics: 8
|
Posted: Tue Jun 01, 2004 5:46 am Post subject: |
|
|
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 |
|
|
|
|