Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 SQL Server Administration (2005)
 Some Questions about Index Tuning

Author  Topic 

Peace2007
Posting Yak Master

239 Posts

Posted - 2009-02-22 : 03:22:46
Hi,

1. our server needs to be index tuned but it's too slow to run profiler. so I've queried DMVs a few times a few days and got different results about missing indexes (each lists different result for missing indexes) I now doubt which one to apply?

2. If we define a PK on a table and don't create any clustered index on it, an index is automatically created on PK, as u know. However, it's better to have, for example, index on (last name, first name) instead of employee_ID (which is PK). I'd like to know if I should delete the index on employee_ID and then create index on (last name, first name) or let the two index remain on the table.

3. As I know, it's better to create index on columns that comes after Groupby and order by. If we create index on such columns, does it still use tempdb for sorting? or the index provides the required space for that?

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2009-02-22 : 03:25:02
1. It depends. You should never just add the missing indexes unless you have verified its impact and benefit.
2. You should probably have an index on both, but it's not something we can answer without seeing the queries.

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

Subscribe to my blog
Go to Top of Page

sodeep
Master Smack Fu Yak Hacker

7174 Posts

Posted - 2009-02-22 : 13:17:12
quote:
If we create index on such columns, does it still use tempdb for sorting? or the index provides the required space for that?



By Default,It doesn't. You can set Sort in TempDB option to ON if your tempDB files are on separate disk.
Go to Top of Page
   

- Advertisement -