Sunday, February 12, 2012

Clustered Index or NonClustered Index

Hello I want to learn disparity clustered index or nonclustered index and in queries which one run better.

example

select * from orders where orderID=5

to this query clustered or nonclustered

thanks

Big topic. Simple answer, yes, you probably want to cluster on the surrogate key, especially when using a smaller datatype surrogate like an int. The way SQL Server uses clustered indexes it is almost always the best choice.

Better answer. Read indexing topics in books online, and the start here one the web: http://www.sql-server-performance.com/optimizing_indexes.asp. Or just start there if you wanna. Books online has good information that is crucial to understanding indexes, however.

|||

Thank you very much

No comments:

Post a Comment