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
 General SQL Server Forums
 New to SQL Server Programming
 index creation

Author  Topic 

Babli
Yak Posting Veteran

53 Posts

Posted - 2008-10-15 : 19:57:36
Is there any improvement in performance if i use method2 instead of method1?

METHOD1:

CREATE NONCLUSTERED INDEX [NCIdx1] ON [dbo].[t1]
(
[col1] ASC,
[col2] ASC
)


CREATE NONCLUSTERED INDEX [NCIdx2] ON [dbo].[t1]
(
[col1] ASC,
[col3] ASC
)


METHOD2:

CREATE NONCLUSTERED INDEX [NCIdx2] ON [dbo].[t1]
(
[col1] ASC,
[col2] ASC,
[col3] ASC
)

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2008-10-15 : 20:04:36
It depends on the query. But yes it can make a difference.

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

Subscribe to my blog
Go to Top of Page
   

- Advertisement -