Вы находитесь на странице: 1из 2

A clustered index orders the table and is loaded into memory.

SQL Svr
accesses data in the table by directly accessing the Index.
A non clustered index does NOT order the data. It establishes a list of the
locations of the data pages containing the columns! of the index.
So a clustered index organi"es the data for maximum efficient access and a
non clustered index does not.
If you create an index on a field that is NOT in the #$%&% clause of a
'uery( you gain absolutely nothing. Actually( you ta)e a hit because you are
*asting drive space( 'uery time and memory space on a useless index.
If you create an index +lustered or non clustered! that IS in the #$%&%
clause( you *ill gain a benefit because the index points to the data.
,,,
$T$( -ens S./meyer.
0OL says1
A clustered index determines the physical order of data in a table. A
clustered index is analogous to a telephone directory( *hich arranges data
by last name. 0ecause the clustered index dictates the physical storage
order of the data in the table( a table can contain only one clustered
index. $o*ever( the index can comprise multiple columns a composite index!(
li)e the *ay a telephone directory is organi"ed by last name and first name.
Nonclustered indexes have the same 0,tree structure as clustered indexes(
*ith t*o significant differences1
a.. The data ro*s are not sorted and stored in order based on their
nonclustered )eys.
b.. The leaf layer of a nonclustered index does not consist of the data
pages.
2$rishi)esh 3usale2 4musaleh5mahindrabt.com6 *rote in message
ne*s17da879c8:d;f<=ca>;:f7<a979=?7a5phx.gbl...
6 hi all( can u tell me *hat is basic difference be*een
6 clusterd index and non clusterd index@
6 Than)s in advance
6 hrishi)esh
Uri
Dimant
Clustered indexes:
SA0AS% continually sorts and re,sorts the ro*s of a table so that their physical order is
al*ays the same as their logical or indexed! order. Aou can have only one clustered
index per table.
Nonclustered indexes1 the physical order of ro*s is not necessarily the same as their
indexed order. %ach nonclustered index provides access to the data in its o*n sort order(
giving the appearance of data in that physical order. Aou can have up to =;B non,
clustered indexes on one table.
+lustered indexes allo* faster searches than non,clustered indexes. +lustered indexes are
often called the primary )ey of the table. If you donCt specify *hich type of index you
*ant( it *ill be a non,clustered index by default.
There are a lot of options for creating an index( but the most commonly used one is
uni'ue. 0oth clustered and non,clustered indexes can be uni'ue. A uni'ue index prohibits
duplicate values in the column that the index is on. Dor example( every credit card has a
different number( so you could create a uni'ue index based on credit card numbers.
An index can be created that based on multiple columnsE this is )no*n as a composite
index. Dor example( you might *ant to create an index for a table based on "ip code and
city name.
There are clustered and nonclustered indexes. A clustered index is a special type of index that
reorders the way records in the table are physically stored. Therefore table can have only one
clustered... (1/18/2004 9:13:38 PM)

Вам также может понравиться