Hi All,
I have a table EMPLOYEE_DETAIL with columns such as
EMP_ID int (primary key, non clustered index)
EMP_LNAME char(25)
EMP_FNAME char(25)
DEPT_ID int (clustered index)
The dept_ID is a foreign key from the DEPARTMENT table. I created indexes as mentioned above. Most of my queries on this table works as below:
select emp_lname, emp_fname
from employee_detail
where emp_id = @intEmpID
The execution plan leads to bookmark lookups and index scans.
Is there any way I could eliminate the bookmark lookups?
Is it a good decision to create a composite clustered index on dept_id and emp_id?
Please advise.
Thanks
I have a table EMPLOYEE_DETAIL with columns such as
EMP_ID int (primary key, non clustered index)
EMP_LNAME char(25)
EMP_FNAME char(25)
DEPT_ID int (clustered index)
The dept_ID is a foreign key from the DEPARTMENT table. I created indexes as mentioned above. Most of my queries on this table works as below:
select emp_lname, emp_fname
from employee_detail
where emp_id = @intEmpID
The execution plan leads to bookmark lookups and index scans.
Is there any way I could eliminate the bookmark lookups?
Is it a good decision to create a composite clustered index on dept_id and emp_id?
Please advise.
Thanks