Page 1 of 1

clustering index

PostPosted: Tue Apr 19, 2011 11:44 am
by makkena
can some one pls provide me the best mnual for understanding wt is clustering index. i am not able to get the good one in google.

Re: clustering index

PostPosted: Tue Apr 19, 2011 4:59 pm
by alexm
Question here is what's a "good one"...
Have a look at this excerpt of an IBM manual, or get an idea from this blog.

The important thing is:
[...] causes DB2 to insert the records as nearly as possible in the order of their index values [...]

Re: clustering index

PostPosted: Thu Apr 21, 2011 4:16 pm
by Suny
I cannot point to a good manual (difficult to define whats good) but I will try to get you a start here. The logic is same as KSDS VSAM index logic.
Ok, So now you have a Db2 table without any index. You define an index now and do a Build index (possibly a reorg to get a correct sequence). The index values sequence will have the same sequence to DB2 rows. Now if you try to insert a row whose index falls somewhere in between , Db2 will try to insert the row in the corresponding location by utilizing the freespace in a page.