From: Jeffrey Michael Gerber <jeffrey_gerber@mail.amsinc.com>
Subject: Join Across a Link
Date: 1998/02/02
Message-ID: <34D61525.39E5F713@mail.amsinc.com>#1/1
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset=us-ascii
Organization: AMS, Inc.
MIME-Version: 1.0
Reply-To: jeffrey_gerber@mail.amsinc.com
Newsgroups: comp.databases.oracle.misc



We have the following piece of SQL (actually, it's longer, but this is
the relevant part):
	 WHERE    ( "A"."NUM" = "C"."ID") AND
		      ( "A"."NUM" = 12)


The "A" table is in the current database while the "C" table is in
another database accessed via link.  Is it true that a join across a
link will bring back ALL rows and then do the join (i.e., we'll get all
rows in "C" and then it'll compare it to the row in "A" which NUM =
12)?  Our client has suggested the following...
	WHERE C.NUM = 12 AND A.ID = 12

That is, to get rid of the join.  Does this make sense?  Are we
defeating some Oracle optimization?  Is this actually equivalent (i.e.,
will we always get the same result set from both statements)?

Thanks!

-Jeff


