Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Execution Plan showing scan not seek

Status
Not open for further replies.

djj55

Programmer
Feb 6, 2006
1,761
US
Hello, SQL 2000
I have a query
Code:
SELECT 
    A.PK_value, 
    A.somevlaue1, 
    B.somevalue2 
FROM table1 A 
INNER JOIN table2 B 
    ON A.PK_value = B.PK_value 
WHERE A.PK_value = 'abc'

I get an execution plan that uses clustered index seek on table1 and a clustered index scan on table2 which has a cost of 67%.

Why since the join is between two primary keys does it use scan instead of seek for table2?

Thanks

djj
The Lord is My Shepard (Psalm 23) - I need someone to lead me!
 
Do both columns have the same data type?

-George

"The great things about standards is that there are so many to choose from." - Fortune Cookie Wisdom
 
That might be the problem as one is nvarchar and the other is varchar. My manager came up with that same thought and I was about to post when I saw your response.

Thank you for the reply.

djj
The Lord is My Shepard (Psalm 23) - I need someone to lead me!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top