Posts: 607
Threads: 553
Joined: Dec 2013
CS403 Database Management Systems GDB No. 01 Solution and Discussion Fall 2014 Due Date:August 12, 2014
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.
Posts: 607
Threads: 553
Joined: Dec 2013
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.
Posts: 5,456
Threads: 5,349
Joined: Dec 2011
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.