Which "select..from..where" syntax is running faster?

UDA
N/A

Which "select..from..where" syntax is running faster?

Hi, i am wondering from the 2 syntax below, which is running faster or is the best practice?

First option
==========
Select A.Col1,B.Col1,A.Col2,A.Col3

From

(Select

Col1,

Col2,

Col3

From Table1) A

Left join

(Select

Col1,

Col2,

Col3

From Table2) B

on A.Col1= B.Col1

where A.Col1=XXX

Second option
==========

Select A.Col1,B.Col1,A.Col2,A.Col3

From

(Select

Col1,

Col2,

Col3

From Table1

where Col1=XXX)A

Left join

(Select

Col1,

Col2,

Col3

From Table2) B

on A.Col1= B.Col1

Will be the second option more faster? Because the "where" is more upper than the first option?
Thanks!
1 REPLY

Re: Which "select..from..where" syntax is running faster?

I think, optimizer will generate the same execution plan for both the queries (same as you are expecting in query 2). You can verify through the EXPLAIN of both the queries.