We are here with you hands in hands to facilitate your learning & don't appreciate the idea of copying or replicating solutions. Read More>>

Looking For Something at vustudents.ning.com? Click Here to Search

www.bit.ly/vucodes

+ Link For Assignments, GDBs & Online Quizzes Solution

www.bit.ly/papersvu

+ Link For Past Papers, Solved MCQs, Short Notes & More


Dear Students! Share your Assignments / GDBs / Quizzes files as you receive in your LMS, So it can be discussed/solved timely. Add Discussion

How to Add New Discussion in Study Group ? Step By Step Guide Click Here.

Question:

 Suppose we have a table “Employee” having column “age” in it. The table “employee” might have a data of different age groups according to their designations. The employee at high levels of post like Project Manager, Managing director etc has different age group when we are comparing it with other junior or senior level employees.

 

You have studied various indexing techniques for random access and better organization of data. By having a context of above scenario; if you have given an option to choose one indexing technique from two below indexes, which you would like to choose that will help to get optimized results? 

 

§         Clustered index

§         Un-clustered/Non-clustered index

 

You have to choose only one technique out of the two and give valid reasons to support your answer.


Note: Try to provide precise, to the point answer and avoid irrelevant details.

+ How to Follow the New Added Discussions at Your Mail Address?

+ How to Join Subject Study Groups & Get Helping Material?

+ How to become Top Reputation, Angels, Intellectual, Featured Members & Moderators?

+ VU Students Reserves The Right to Delete Your Profile, If?


See Your Saved Posts Timeline

Views: 9142

.

+ http://bit.ly/vucodes (Link for Assignments, GDBs & Online Quizzes Solution)

+ http://bit.ly/papersvu (Link for Past Papers, Solved MCQs, Short Notes & More)

+ Click Here to Search (Looking For something at vustudents.ning.com?)

+ Click Here To Join (Our facebook study Group)

Replies to This Discussion

Clustered
Clustered indexes sort and store the data rows in the table or view based on their key values. These are the columns included in the index definition. There can be only one clustered index per table, because the data rows themselves can be sorted in only one order.
The only time the data rows in a table are stored in sorted order is when the table contains a clustered index. When a table has a clustered index, the table is called a clustered table. If a table has no clustered index, its data rows are stored in an unordered structure called a heap.

Nonclustered
Nonclustered indexes have a structure separate from the data rows. A nonclustered index contains the nonclustered index key values and each key value entry has a pointer to the data row that contains the key value.
The pointer from an index row in a nonclustered index to a data row is called a row locator. The structure of the row locator depends on whether the data pages are stored in a heap or a clustered table. For a heap, a row locator is a pointer to the row. For a clustered table, the row locator is the clustered index key.
You can add nonkey columns to the leaf level of the nonclustered index to by-pass existing index key limits, 900 bytes and 16 key columns, and execute fully covered, indexed, queries. For more information, see Create Indexes with Included Columns.
Both clustered and nonclustered indexes can be unique. This means no two rows can have the same value for the index key.

aquaris zra point ko tu clear kr dain ksy ap ne kaha k dono best ha

Clustered Index

Only one per table
Faster to read than non clustered as data is physically stored in index order
Non Clustered Index

Can be used many times per table
Quicker for insert and update operations than a clustered index
Both types of index will improve performance when select data with fields that use the index but will slow down update and insert operations.

Because of the slower insert and update clustered indexes should be set on a field that is normally incremental ie Id or Time stamp.

Clustered
Clustered indexes sort and store the data rows in the table or view based on their key values. These are the columns included in the index definition. There can be only one clustered index per table, because the data rows themselves can be sorted in only one order.
The only time the data rows in a table are stored in sorted order is when the table contains a clustered index. When a table has a clustered index, the table is called a clustered table. If a table has no clustered index, its data rows are stored in an unordered structure called a heap.
Nonclustered
Nonclustered indexes have a structure separate from the data rows. A nonclustered index contains the nonclustered index key values and each key value entry has a pointer to the data row that contains the key value.
The pointer from an index row in a nonclustered index to a data row is called a row locator. The structure of the row locator depends on whether the data pages are stored in a heap or a clustered table. For a heap, a row locator is a pointer to the row. For a clustered table, the row locator is the clustered index key.
You can add nonkey columns to the leaf level of the nonclustered index to by-pass existing index key limits, 900 bytes and 16 key columns, and execute fully covered, indexed, queries. For more information, see Create Indexes with Included Columns.

rubab sister point is both index are best whether you approach from high to low or low to high as in given scenario we are asked to give comments on only in one techniquw which is wrong.ap just schain k clustered k bina un clustered adhura ha or unckustered k bina clsuter adura hai ya dono techniques hr table ma hti hain so we cant deny even one.
baki ap just clustered or unclustered dono ki properties likh dain

i dont think the university has given a tricky question.

if there is a clustered index then the search is called Index seek

if there is no clustered index the search is called heap look up( RID look up).

Anyway, i found a very informative page on the internet.

hope it helps

http://www.mssqltips.com/sqlservertip/1206/understanding-sql-server...

Oh and i think clustered index is better.

you can ask a snenior person mohsen i think you didnt understand the question properly!

anyway every person has different views.You have posted your opinion Thank You so much! It will be informative for others!

if it comes to different sites on internet then you can check by yourself every site has different views some sites are saying CI is best some are saying NCI is best! Then whom with you go except from general knowledge you have!

But its good to search sites as it will not only increased your mental skills as well as the information you are having 

Tariq bhai ap b apny views dy zra kindlyy!!

clusterd index py views dyny ya non clusterd index py koi btay ga ?????????????

Aquairus bhai qstn m sirf aik optn slct krny ka kha gya h

RSS

© 2019   Created by + M.Tariq Malik.   Powered by

Promote Us  |  Report an Issue  |  Privacy Policy  |  Terms of Service

.