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 2008 Forums
 Transact-SQL (2008)
 Composite or Separate Indexes

Author  Topic 

Ken Blum
Constraint Violating Yak Guru

383 Posts

Posted - 2011-06-14 : 09:24:17
Let's say I have a table that contains 2 integer columns - Customer_No and Employee_No. Now I have a query that filters on these columns like so...


Select * From MyTable where Customer_No in (1,2,3,4) and Employee_No in (1,2,3,4)


Would it be better to have a single composite index of Customer_No and Employee_No or separate indexes - one for Customer_No and one for Employee_No?

GilaMonster
Master Smack Fu Yak Hacker

4507 Posts

Posted - 2011-06-14 : 09:35:43
http://sqlinthewild.co.za/index.php/2010/09/14/one-wide-index-or-multiple-narrow-indexes/

--
Gail Shaw
SQL Server MVP
Go to Top of Page
   

- Advertisement -