Showing posts with label beween. Show all posts
Showing posts with label beween. Show all posts

Sunday, March 25, 2012

Difference Between Clustered Index and non Clustered Index

hi all, can u tell me what is basic difference beween
clusterd index and non clusterd index?
Thanks in advance
hrishikeshHello Hrishikesh !
Quioted from DBA-Forum:
--
Assuming SQL 7 or 2K:
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 column(s) of the index.
So a clustered index organizes 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 WHERE clause of a
query, you gain absolutely nothing. Actually, you take a hit because you are
wasting drive space, query time and memory space on a useless index.
If you create an index (Clustered or non clustered) that IS in the WHERE
clause, you will gain a benefit because the index points to the data.
--
HTH, Jens Süßmeyer.|||BOL says:
A clustered index determines the physical order of data in a table. A
clustered index is analogous to a telephone directory, which arranges data
by last name. Because the clustered index dictates the physical storage
order of the data in the table, a table can contain only one clustered
index. However, the index can comprise multiple columns (a composite index),
like the way a telephone directory is organized by last name and first name.
Nonclustered indexes have the same B-tree structure as clustered indexes,
with two significant differences:
a.. The data rows are not sorted and stored in order based on their
nonclustered keys.
b.. The leaf layer of a nonclustered index does not consist of the data
pages.
"Hrishikesh Musale" <musaleh@.mahindrabt.com> wrote in message
news:0da301c36d4f$2ca746f0$a101280a@.phx.gbl...
> hi all, can u tell me what is basic difference beween
> clusterd index and non clusterd index?
> Thanks in advance
> hrishikeshsql