Changing a certain IN-subquery to a join.
Merge branch '188-sql_optimizing'