If I am running a cross-tab query on a table that has 15000 records in it to check specific records (It basically is running a table-valued function about 10,000 timesHere's the actual querySelect a.EmployeeID,b.*from #TmpActiveEmployeesWSeverance across apply dbo.fn_Severance_AccountItemsTableBULKRUN(a.EmployeeID,a.BenefitTypeID,null,null,null,null,null ) b
Within that function there is a sub-query on a table that isSelect col3 from T_Mytable awhere col1 = @EmployeeIDand Col2 = @BenefitTypeID
I can not figure out why there not ANY performance increase in having a non-clusterd index on T_Mytable(EmployeeID,BenefitTypeID)Shouldn't Sql Reference this index when determining the plan execution, or is it because the record count is only about 10,000 records, so there is no need for sql to use the index?Thanks for the clarification, I just would like to know why this is.