SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2008 Forums
 SQL Server Administration (2008)
 Why add a clustered index to a table?
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

sql_er
Constraint Violating Yak Guru

267 Posts

Posted - 07/24/2013 :  11:43:14  Show Profile  Reply with Quote
Hi guys,

I have a very simple question - "Why add a clustered index to a table"?

When I google it, the resulting pages all show you how to do it, but not why.

I've just been exposed to a database that has lots of tables and none of them have a clustered index.

Should I start adding them? Why? What will it help with?

Please advise.

Thanks in advance!

SwePeso
Patron Saint of Lost Yaks

Sweden
30281 Posts

Posted - 07/24/2013 :  14:03:47  Show Profile  Visit SwePeso's Homepage  Reply with Quote
It's a good practice to have a clustered index on a table. On Azure, it's mandatory.
The clustered index IS the data in the table. The clustered index controls in which order rows are physically stored in the table.



Microsoft SQL Server MVP, MCT, MCSE, MCSA, MCP, MCITP, MCTS, MCDBA
Go to Top of Page

sql_er
Constraint Violating Yak Guru

267 Posts

Posted - 07/24/2013 :  16:55:54  Show Profile  Reply with Quote
SwePeso - "a good practice" does not tell me much though. The question is - Why? What will it help with?

Thank you!
Go to Top of Page

tkizer
Almighty SQL Goddess

USA
37316 Posts

Posted - 07/24/2013 :  17:37:29  Show Profile  Visit tkizer's Homepage  Reply with Quote
Why? For good database design and for performance reasons.

Good article from Michelle Ufford: https://www.simple-talk.com/sql/learn-sql-server/effective-clustered-indexes/

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

sql_er
Constraint Violating Yak Guru

267 Posts

Posted - 07/24/2013 :  17:44:30  Show Profile  Reply with Quote
Thanks Tara - i'll read it through and come back if i have questions.
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.05 seconds. Powered By: Snitz Forums 2000