Single table condition in join or where

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • LarsBytes
    New Member
    • Feb 2009
    • 2

    #1

    Single table condition in join or where

    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
  • LarsBytes
    New Member
    • Feb 2009
    • 2

    #2
    ping! Is this very obvious?

    Comment

    • ck9663
      Recognized Expert Specialist
      • Jun 2007
      • 2878

      #3
      Try checking the execution plan.

      -- CK

      Comment

      Working...