ow machan eka dannawa.clustered nam rows sort wela un clustered nam sort naha kiyala..ita wada wistharayak one machan. ekai ahuwekisima piliwelak nathi index ekak......

[COLOR="DarkRed"]2 2 aaa[/COLOR]
[COLOR="Red"]3 3 bbb[/COLOR]
[COLOR="Magenta"]4 4 ccc[/COLOR]
[COLOR="Blue"]5 5 ddd[/COLOR]
[COLOR="DarkRed"]2[/COLOR] [COLOR="Blue"]5 ddd[/COLOR]
[COLOR="Red"]3[/COLOR] [COLOR="DarkRed"]2 aaa[/COLOR]
[COLOR="Magenta"]4[/COLOR] [COLOR="Red"]3 bbb[/COLOR]
[COLOR="Blue"]5[/COLOR] [COLOR="Magenta"]4 ccc[/COLOR]

clustered waladi machan index eke piliwelatama thamayi data rows tikak thiyenne. Just like normal primary keys in a table.
Non clustered waladi wenama table ekak wage ekak use wenawa. eken kerenne pointers thiyaganna eka. Non clustered wala index ekai, physical row ekakui set wenne pointer ekak haraha.
clusteres waladi umbata 6th row eka thiyaganna puluwan 6th index ekemai. eth umbata 6th row eka 4th index eke thiyaganna puluwan non clusteres waladi. e ekedi pointer table ekak use wena nisa. pointer table eke umbata define karanna puluwan 4th index eka point wenne 6th row ekata kiyala.
(mamath machan meka gena denagena hitiye ne. dan net eke search karala balagaththe.)
♥-Aurora-♥;14162545 said:index එකක් හැදුවම කොටස් 2ක් තියෙනවනෙ, key & data කියලා. clustered වලදි වෙන්නෙ මේ දෙකම තියෙන්නෙ එකම විදියට sort වෙලා.
eg:
non clustered වලදි sort වෙන්නෙ key හෙවත් index එක විතරයි.Code:[COLOR=DarkRed]2 2 aaa[/COLOR] [COLOR=Red]3 3 bbb[/COLOR] [COLOR=Magenta]4 4 ccc[/COLOR] [COLOR=Blue]5 5 ddd[/COLOR]
eg:
key field එක අනිවාර්යෙන් sorted. නැත්තම් index එකක් නෙවිනෙ.Code:[COLOR=DarkRed]2[/COLOR] [COLOR=Blue]5 ddd[/COLOR] [COLOR=Red]3[/COLOR] [COLOR=DarkRed]2 aaa[/COLOR] [COLOR=Magenta]4[/COLOR] [COLOR=Red]3 bbb[/COLOR] [COLOR=Blue]5[/COLOR] [COLOR=Magenta]4 ccc[/COLOR]
ටේබල් එකකට clustered index 1යි නෙ තියෙන්න පුලුවන්. එතකොට ඒකට අනුව data ටික sort වෙනවා. non-clustered indexes හදද්දි data වලට මුකුත් වෙන්නෙ නෑ. index එකක් create වෙනවා විතරයි.
මේ පින්තූරෙත් පොඩ්ඩක් බලන්න..
මේකෙ non-clustered index එක අරන් තියෙන්නෙ last name එකෙන්.
![]()
තවත් තේරුන් නැත්තම් අහන්න..![]()