We have a table with good amount of rows(150,000+) and each row has to be selected based on a SUB query on another table. The values return by SUB query is independent to the column in this table. So, will oracle run the SUB query for every tuple ?
Example
TableZ
id,
location
TableA (150K+)
name,
id,
type
TableB
type,
color
Query
select * from TableZ
join
(select name, id, type from TableA where type is null or type in
(select type from TableB where color='red')
) tblA_RED on TableZ.id=tblA_RED.id
My question is how many time will the SUB query select type from TableB where color='red' execute ?