Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Join execution order

Join execution order

From: Lecter23 <lecter23_at_gmail.com>
Date: Thu, 05 Jul 2007 01:26:19 -0700
Message-ID: <1183623979.013085.196440@c77g2000hse.googlegroups.com>


Hi everybody.

My question is: Joins are executed after or before applying WHERE clause?

I have 2 tables:

USERS
Id (PK)
UserName
IdCountry (FK -> COUNTRIES)
Admin

COUNTRIES
Id (PK)
CountryName

And i have this SQL:

SELECT UserName, CountryName
FROM USERS U
LEFT JOIN COUNTRIES C ON U.IDCOUNTRY = C.ID WHERE Admin = 1

This query returns about 100 rows of 20000 total rows in users table. I need to know if Oracle applies WHERE and then LEFT JOIN with only 100 rows or make the join with all 20000 users and then filters admins.

Thanks in advance! Received on Thu Jul 05 2007 - 03:26:19 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US