I'm trying to understand the logic of the simple following query:
from table1 as t1 cross join table2 as t2
where t2.source_code = (
from table2 t3
where t3.source_code in (t1.code_value)
This (Terrible, Horrible, No Good, Very Bad) query is equivalent to:
select * from table1 as t1 join table2 as t2 on t1.code_value = t2.source_code;
If the relation between tables is 1:1 or 1:N then the theoretical complexity is O(n).
The actual complexity is database/data structures/statistics dependent.