Date: Sat, 29 Sep 2007 20:58:15 -0700
Reply-To: Patrick <patrick.matter@GMX.CH>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Patrick <patrick.matter@GMX.CH>
Organization: http://groups.google.com
Subject: Re: OUTER JOIN and order of WHERE Clause processing
In-Reply-To: <1191078647.689691.106070@19g2000hsx.googlegroups.com>
Content-Type: text/plain; charset="us-ascii"
Hi Hari
I'm also working through this training. Are you happy with the
response times?
Quite interesting your findings. I think that the note for the outer
join is wrong.
I found quite an interesting SUGI paper: http://www2.sas.com/proceedings/sugi30/101-30.pdf
Using the SQL option _method as described in this paper, your code
generates the following log messages:
First SQL:
sqxslct
sqxfil
sqxjm
sqxsort
sqxsrc( SASUSER.FLIGHTSCHEDULE(alias = F) )
sqxsort
sqxsrc( SASUSER.PAYROLLCHANGES(alias = P) )
Second SQL:
sqxslct
sqxjm
sqxsort
sqxsrc( SASUSER.FLIGHTSCHEDULE(alias = F) )
sqxsort
sqxsrc( SASUSER.PAYROLLCHANGES(alias = P) )
This two SQL differ only in one step which comes in the very end:
sqxfil ...and sqxfil means "filter rows"
Conclussion: The left outer join is processed first, the where clause
subsets the result of the join.
Very curious what other more experienced SAS/SQLers will answer.
Patrick