views:

54

answers:

2

alt text

There are two tables that I join them together, one of them is a temp table and I create an index after creating the table. But it is said in the query execution plan above.

what should I consider to convert all scan operations to seek operations? There are parts which are joins and where conditions...

Regards bk

+1  A: 

Here is a very helpful website with relation to your question.

Ardman
@Ardmanfrom the web site;If you want to create the index, you can right click in the execution plan and select the “Missing Index Details…” command.it worked out!thnx
blgnklc
+1  A: 

The "Missing index" hint that is displayed is your best starting point. SQL Server has detected you would get better performance by adding the index that it tells you to.

It's difficult to be specific as really need to know what your SELECT statement is as a number of things could cause a scan to be done instead of seek.

As an example, I recently blogged about how the structure of your WHERE clause for (e.g.) date filtered queries, can turn seeks into scans - in this instance things to look out for are the use of functions within the WHERE clause.

AdaTheDev