Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Join execution order
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
![]() |
![]() |