Connecting Tech Pros Worldwide Forums | Help | Site Map

Single table condition in join or where

Newbie
 
Join Date: Feb 2009
Posts: 2
#1: Feb 11 '09
Hi all,

It is possible that this question has already been answered before, but I've searched through the forums and couldn't really find a satisfactory answer to the following question:

What is the difference in terms of execution and performance of the following queries on SQL SERVER 2005.

1.
SELECT *
FROM A a
JOIN B b ON (a.id = b.id)
WHERE a.x > 10 AND b.y < 100


2.
SELECT *
FROM A a
JOIN B b ON (a.id = b.id AND a.x > 10 AND b.y < 100)

Consider the scenarios where the columns x,y have / do not have a non-clustered index.

Also it would be great if someone could answer the same question for SYBASE.

Thanks
Lars

Newbie
 
Join Date: Feb 2009
Posts: 2
#2: Feb 24 '09

re: Single table condition in join or where


ping! Is this very obvious?
ck9663's Avatar
Expert
 
Join Date: Jun 2007
Posts: 1,925
#3: Feb 24 '09

re: Single table condition in join or where


Try checking the execution plan.

-- CK
Reply