If we have 2 tables, tableA
(with column1, column2
) and tableB
(with column1, column2
), what’s the difference between the following two queries? Which one has better performance? What if we have indexing for both tables?
Query #1:
x
select
b.column2
from
tableA a,
tableB b
where
a.column1 = b.column1
and a.column2 = ?;
Query #2:
select
b.column2
from
tableA a
inner join
tableB b on a.column1 = b.column1
where
a.column2 = ?;
Advertisement
Answer
Both will perform equally. One is an ansi style and the other is old fashioned style of joining You may compare the explain plans and most likely you will find them to be the same.