Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

2
  • > it seems as if the index isn't used at all. That can't be right. Obviously the index is used, because there are two index scans in the plan. It may not be doing the seek you want, but it's still used. What confuses me in the plan and question is that these are both PK indexes. I see no reference to the FK index in plan, which might reduce the cost of the join. But even your index hint was pushing the PK index, and not the FK. Perhaps if you added the name column as a non-indexed field to the FK index, so that the index covers the variable table, you might get different results. Commented Mar 10, 2014 at 16:56
  • You correctly edited the title of the question. I meant why it is a scan not a seek, will re-phase question accordingly as well. Commented Mar 10, 2014 at 17:19