-
Performance Problem
Hi All,
I had one problem there is one table which is having 3,000,000 rows.
Table is like this
empid pk,
create_date_time datetime,
dept
now my query is select TOP 1 empID, from emp with (nolock) where
dept = 'MNH' ORDER BY CREATE_DATE_TIME OPTION (FAST 1)
the query is executing very slow so any body can tell me how to improve the performance of the same.
-
Do you have index on create_date_time datetime? If so, does system use it? YOu can check it by showing query execution plan.
-
You should create an index in DEPT column too.
Or even better if you can cover the query with a composite index on all three columns
empid,
create_date_time,
dept
-
Reply to index
I am having one index on the emp id which is the primary key how can i create the cluster index, i think i had to make a composite key for the same means pk for empid and create date time.
-
You can just create index on create_date_time column.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|